Mercurial > hg > dmlib
comparison tools/64vw.c @ 2200:dcd26cdc395e
Replace dmC64InitializeFormats() with dmLib64GFXInit() and dmLib64GFXClose().
Add in sorting of the C64 formats list.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 14 Jun 2019 00:00:27 +0300 |
parents | f331cc750b37 |
children | 9f3fb4004c20 |
comparison
equal
deleted
inserted
replaced
2199:f331cc750b37 | 2200:dcd26cdc395e |
---|---|
59 " frmt | Type | Description\n" | 59 " frmt | Type | Description\n" |
60 "------+-----------------+-------------------------------------\n" | 60 "------+-----------------+-------------------------------------\n" |
61 ); | 61 ); |
62 for (int i = 0; i < ndmC64ImageFormats; i++) | 62 for (int i = 0; i < ndmC64ImageFormats; i++) |
63 { | 63 { |
64 const DMC64ImageFormat *fmt = &dmC64ImageFormats[i]; | 64 const DMC64ImageFormat *fmt = dmC64ImageFormatsSorted[i]; |
65 char buf[64]; | 65 char buf[64]; |
66 printf("%-6s| %-15s | %s%s\n", | 66 printf("%-6s| %-15s | %s%s\n", |
67 fmt->fext, | 67 fmt->fext, |
68 dmC64GetImageTypeString(buf, sizeof(buf), fmt->format->type, FALSE), | 68 dmC64GetImageTypeString(buf, sizeof(buf), fmt->format->type, FALSE), |
69 fmt->name, | 69 fmt->name, |
267 SDL_Surface *surf = NULL; | 267 SDL_Surface *surf = NULL; |
268 BOOL initSDL = FALSE, exitFlag, needRedraw; | 268 BOOL initSDL = FALSE, exitFlag, needRedraw; |
269 size_t currIndex, prevIndex; | 269 size_t currIndex, prevIndex; |
270 int res; | 270 int res; |
271 | 271 |
272 dmC64InitializeFormats(); | 272 // Initialize pre-requisites |
273 if ((res = dmLib64GFXInit()) != DMERR_OK) | |
274 { | |
275 dmErrorMsg("Could not initialize lib64gfx: %s\n", | |
276 dmErrorStr(res)); | |
277 goto exit; | |
278 } | |
279 | |
273 dmSetScaleFactor(2.0); | 280 dmSetScaleFactor(2.0); |
274 memset(&spec, 0, sizeof(spec)); | 281 memset(&spec, 0, sizeof(spec)); |
275 memset(&setCharROM, 0, sizeof(setCharROM)); | 282 memset(&setCharROM, 0, sizeof(setCharROM)); |
276 | 283 |
277 dmInitProg("64vw", "Displayer for various C64 graphics formats", "0.4", NULL, NULL); | 284 dmInitProg("64vw", "Displayer for various C64 graphics formats", "0.4", NULL, NULL); |
597 SDL_FreeSurface(surf); | 604 SDL_FreeSurface(surf); |
598 | 605 |
599 if (initSDL) | 606 if (initSDL) |
600 SDL_Quit(); | 607 SDL_Quit(); |
601 | 608 |
609 dmLib64GFXClose(); | |
610 | |
602 return 0; | 611 return 0; |
603 } | 612 } |