no message

This commit is contained in:
Chris Danford
2002-03-06 09:14:52 +00:00
parent 044ac127da
commit b0794fbd78
+17 -2
View File
@@ -119,7 +119,14 @@ void RageBitmapTexture::Create( DWORD dwHints )
bScaleImageToTextureSize = ddii.Width > caps.MaxTextureWidth bScaleImageToTextureSize = ddii.Width > caps.MaxTextureWidth
|| ddii.Height > caps.MaxTextureHeight; || ddii.Height > caps.MaxTextureHeight;
// HACK: The stupid Savage card will report that it can hold the entire texture,
// then allocate something smaller than the dimensions we need!
// after allocating the texture, make sure it's the size we expect. If not,
// load it again with scaling turned on.
DWORD dwExpectedWidth = ddii.Width;
DWORD dwExpectedHeight = ddii.Height;
while( 1 )
{
if( FAILED( hr = D3DXCreateTextureFromFileEx( if( FAILED( hr = D3DXCreateTextureFromFileEx(
m_pd3dDevice, // device m_pd3dDevice, // device
m_sFilePath, // soure file m_sFilePath, // soure file
@@ -138,7 +145,6 @@ void RageBitmapTexture::Create( DWORD dwHints )
RageErrorHr( ssprintf("D3DXCreateTextureFromFileEx() failed for file '%s'.", m_sFilePath), hr ); RageErrorHr( ssprintf("D3DXCreateTextureFromFileEx() failed for file '%s'.", m_sFilePath), hr );
} }
///////////////////// /////////////////////
// Save information about the texture // Save information about the texture
///////////////////// /////////////////////
@@ -154,6 +160,15 @@ void RageBitmapTexture::Create( DWORD dwHints )
m_uTextureHeight = ddsd.Height; m_uTextureHeight = ddsd.Height;
m_TextureFormat = ddsd.Format; m_TextureFormat = ddsd.Format;
if( dwExpectedWidth == ddsd.Width &&
dwExpectedHeight == ddsd.Height )
break; // done trying to load
}
if( bScaleImageToTextureSize ) if( bScaleImageToTextureSize )
{ {
m_uImageWidth = m_uTextureWidth; m_uImageWidth = m_uTextureWidth;