diff options
Diffstat (limited to 'src/resources')
-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 |