simplify a little, comment

This commit is contained in:
Glenn Maynard
2004-08-28 08:29:13 +00:00
parent 0169f9fcf6
commit 6009e72fc6
+15 -13
View File
@@ -211,21 +211,23 @@ void RageBitmapTexture::Create()
default: default:
RageException::Throw( "Invalid color depth: %d bits", actualID.iColorDepth ); RageException::Throw( "Invalid color depth: %d bits", actualID.iColorDepth );
} }
}
/* It's either not a paletted image, or we can't handle paletted textures. /* Dither if appropriate. XXX: This is a special case: don't bother dithering to
* Convert to the desired RGBA format, dithering if appropriate. */ * RGBA8888. We actually want to dither only if the destination has greater color
if( actualID.bDither && * depth on at least one color channel than the source. For example, it doesn't
(pixfmt==RageDisplay::FMT_RGBA4 || pixfmt==RageDisplay::FMT_RGB5A1) ) /* Don't dither if format is 32bpp; there's no point. */ * make sense to do this when pixfmt is RGBA5551 if the image is only RGBA555. */
{ if( actualID.bDither &&
/* Dither down to the destination format. */ (pixfmt==RageDisplay::FMT_RGBA4 || pixfmt==RageDisplay::FMT_RGB5A1) )
const RageDisplay::PixelFormatDesc *pfd = DISPLAY->GetPixelFormatDesc(pixfmt); {
RageSurface *dst = CreateSurface( img->w, img->h, pfd->bpp, /* Dither down to the destination format. */
pfd->masks[0], pfd->masks[1], pfd->masks[2], pfd->masks[3] ); const RageDisplay::PixelFormatDesc *pfd = DISPLAY->GetPixelFormatDesc(pixfmt);
RageSurface *dst = CreateSurface( img->w, img->h, pfd->bpp,
pfd->masks[0], pfd->masks[1], pfd->masks[2], pfd->masks[3] );
SM_SDL_ErrorDiffusionDither(img, dst); SM_SDL_ErrorDiffusionDither(img, dst);
delete img; delete img;
img = dst; img = dst;
}
} }
/* This needs to be done *after* the final resize, since that resize /* This needs to be done *after* the final resize, since that resize