diff options
author | P. J. McDermott <pjm@nac.net> | 2013-02-24 18:10:40 (EST) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2013-02-24 18:10:40 (EST) |
commit | ce21693e65a79d6005c5bd6092799fff208fb45b (patch) | |
tree | d996abd56f2c4a3c0d2a58573e82cc8a475b137a | |
parent | 708db30ba67192e37462a849efe59a437b2d8319 (diff) | |
download | overworld-rpg-ce21693e65a79d6005c5bd6092799fff208fb45b.zip overworld-rpg-ce21693e65a79d6005c5bd6092799fff208fb45b.tar.gz overworld-rpg-ce21693e65a79d6005c5bd6092799fff208fb45b.tar.bz2 |
src/resources/image.c: Clean up palette debugging.
-rw-r--r-- | src/resources/image.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/resources/image.c b/src/resources/image.c index ae7cd30..073d39e 100644 --- a/src/resources/image.c +++ b/src/resources/image.c @@ -12,9 +12,6 @@ img_png_get(const char *path) { SDL_RWops *rwops; struct image *img; -#ifdef DEBUG_PALETTES - int i; -#endif img = (struct image *) resource_get(&img_res, path); if (img != NULL) { @@ -31,12 +28,19 @@ img_png_get(const char *path) } #ifdef DEBUG_PALETTES - for (i = 0; i < img->image->format->palette->ncolors; ++i) { - debug("Color %3.3d: 0x%2.2x%2.2x%2.2x", - i, - img->image->format->palette->colors[i].r, - img->image->format->palette->colors[i].g, - img->image->format->palette->colors[i].b); + { + SDL_Palette *pal; + int col_i; + + debug("Palette for image \"%s\"\n", path); + pal = img->image->format->palette; + for (col_i = 0; col_i < pal->ncolors; ++col_i) { + debug(" Color %3.3d: 0x%2.2x%2.2x%2.2x", + col_i, + pal->colors[col_i].r, + pal->colors[col_i].g, + pal->colors[col_i].b); + } } #endif |