From ce21693e65a79d6005c5bd6092799fff208fb45b Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sun, 24 Feb 2013 18:10:40 -0500 Subject: src/resources/image.c: Clean up palette debugging. --- (limited to 'src/resources/image.c') 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 -- cgit v0.9.1