Mercurial > hg > dmlib
comparison tools/lib64gfx.c @ 1822:9bec535956fd
Add indentation parameter to dmC64ImageDump().
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 22 Jun 2018 12:20:46 +0300 |
parents | ee2383d1a21e |
children | adf9f05c26e1 |
comparison
equal
deleted
inserted
replaced
1821:ee2383d1a21e | 1822:9bec535956fd |
---|---|
46 | 46 |
47 return buf; | 47 return buf; |
48 } | 48 } |
49 | 49 |
50 | 50 |
51 void dmC64ImageDump(FILE *fh, const DMC64Image *img, const DMC64ImageFormat *fmt) | 51 void dmC64ImageDump(FILE *fh, const DMC64Image *img, const DMC64ImageFormat *fmt, const char *indent) |
52 { | 52 { |
53 char typeStr[64], typeStr2[64]; | 53 char typeStr[64], typeStr2[64]; |
54 | 54 |
55 dmC64GetImageTypeString(typeStr, sizeof(typeStr), fmt->format->type, TRUE); | 55 dmC64GetImageTypeString(typeStr, sizeof(typeStr), fmt->format->type, TRUE); |
56 | 56 |
57 if (fmt != NULL) | 57 if (fmt != NULL) |
58 { | 58 { |
59 fprintf(fh, | 59 fprintf(fh, |
60 "Format : %s [%s]\n", | 60 "%sFormat : %s [%s]\n", |
61 fmt->name, fmt->fext); | 61 indent, fmt->name, fmt->fext); |
62 } | 62 } |
63 | 63 |
64 if (img != NULL) | 64 if (img != NULL) |
65 { | 65 { |
66 dmC64GetImageTypeString(typeStr2, sizeof(typeStr2), img->type, TRUE); | 66 dmC64GetImageTypeString(typeStr2, sizeof(typeStr2), img->type, TRUE); |
67 | 67 |
68 fprintf(fh, | 68 fprintf(fh, |
69 "Type : %s [%s]\n" | 69 "%sType : %s [%s]\n" |
70 "Banks : %d\n", | 70 "%sBanks : %d\n", |
71 typeStr, typeStr2, | 71 indent, typeStr, typeStr2, |
72 img->nbanks); | 72 indent, img->nbanks); |
73 | 73 |
74 if (img->type & D64_FMT_ILACE) | 74 if (img->type & D64_FMT_ILACE) |
75 { | 75 { |
76 char *tmps; | 76 char *tmps; |
77 switch (img->laceType) | 77 switch (img->laceType) |
79 case D64_ILACE_COLOR: tmps = "color"; break; | 79 case D64_ILACE_COLOR: tmps = "color"; break; |
80 case D64_ILACE_RES: tmps = "resolution"; break; | 80 case D64_ILACE_RES: tmps = "resolution"; break; |
81 default: tmps = "ERROR"; break; | 81 default: tmps = "ERROR"; break; |
82 } | 82 } |
83 fprintf(fh, | 83 fprintf(fh, |
84 "Interlace type : %s\n", | 84 "%sInterlace type : %s\n", |
85 tmps); | 85 indent, tmps); |
86 } | 86 } |
87 | 87 |
88 fprintf(fh, | 88 fprintf(fh, |
89 "Width x Height : %d x %d [%d x %d]\n" | 89 "%sWidth x Height : %d x %d [%d x %d]\n" |
90 "CHwidth x CHheight : %d x %d [%d x %d]\n", | 90 "%sCHwidth x CHheight : %d x %d [%d x %d]\n", |
91 img->width, img->height, | 91 indent, img->width, img->height, |
92 fmt->format->width, fmt->format->height, | 92 fmt->format->width, fmt->format->height, |
93 img->chWidth, img->chHeight, | 93 indent, img->chWidth, img->chHeight, |
94 fmt->format->chWidth, fmt->format->chHeight); | 94 fmt->format->chWidth, fmt->format->chHeight); |
95 } | 95 } |
96 else | 96 else |
97 { | 97 { |
98 fprintf(fh, | 98 fprintf(fh, |
99 "Type : %s\n" | 99 "%sType : %s\n" |
100 "Width x Height : %d x %d\n" | 100 "%sWidth x Height : %d x %d\n" |
101 "CHwidth x CHheight : %d x %d\n", | 101 "%sCHwidth x CHheight : %d x %d\n", |
102 typeStr, | 102 indent, typeStr, |
103 fmt->format->width, fmt->format->height, | 103 indent, fmt->format->width, fmt->format->height, |
104 fmt->format->chWidth, fmt->format->chHeight); | 104 indent, fmt->format->chWidth, fmt->format->chHeight); |
105 } | 105 } |
106 } | 106 } |
107 | 107 |
108 | 108 |
109 void dmSetDefaultC64Palette(DMImage *img) | 109 void dmSetDefaultC64Palette(DMImage *img) |