fix bugs that show up on Voodoo3

This commit is contained in:
Chris Danford
2003-05-28 00:50:10 +00:00
parent c3c96f390c
commit 9ab0d6ebee
2 changed files with 24 additions and 4 deletions
+10 -1
View File
@@ -245,9 +245,18 @@ void RageBitmapTexture::Create()
* done *before* we set up the palette, since it might change it. */
FixHiddenAlpha(img);
/* Make we're using a supported format.
* Every card supports either RGBA8 or RGBA4. */
if( !DISPLAY->SupportsTextureFormat(pixfmt) )
{
pixfmt = FMT_RGBA8;
if( !DISPLAY->SupportsTextureFormat(pixfmt) )
pixfmt = FMT_RGBA4;
}
/* Convert the data to the destination format and dimensions
* required by OpenGL if it's not in it already. */
const PixelFormatDesc *pfd = DISPLAY->GetPixelFormatDesc(pixfmt);
ConvertSDLSurface(img, m_iTextureWidth, m_iTextureHeight,
pfd->bpp, pfd->masks[0], pfd->masks[1], pfd->masks[2], pfd->masks[3]);