add texture hint to force mipmaps. Let the texture hint override the global pref.

This commit is contained in:
Chris Danford
2004-08-08 00:04:42 +00:00
parent d755e660a6
commit e7958c0a89
+5 -3
View File
@@ -91,6 +91,10 @@ void RageBitmapTexture::Create()
actualID.iAlphaBits = 1;
}
// let texture hints override the global setting
if( PREFSMAN->m_bForceMipMaps )
actualID.bMipMaps = true;
// look in the file name for a format hints
CString HintString = GetID().filename + actualID.AdditionalTextureHints;
HintString.MakeLower();
@@ -100,6 +104,7 @@ void RageBitmapTexture::Create()
if( HintString.Find("dither") != -1 ) actualID.bDither = true;
if( HintString.Find("stretch") != -1 ) actualID.bStretch = true;
if( HintString.Find("nomipmaps") != -1 ) actualID.bMipMaps = false;
if( HintString.Find("mipmaps") != -1 ) actualID.bMipMaps = true;
/* If the image is marked grayscale, then use all bits not used for alpha
* for the intensity. This way, if an image has no alpha, you get an 8-bit
@@ -116,9 +121,6 @@ void RageBitmapTexture::Create()
if( actualID.iGrayscaleBits != -1 && img->format->BitsPerPixel == 8 )
actualID.iGrayscaleBits = -1;
if( PREFSMAN->m_bForceMipMaps )
actualID.bMipMaps = true;
/* Cap the max texture size to the hardware max. */
actualID.iMaxSize = min( actualID.iMaxSize, DISPLAY->GetMaxTextureSize() );