From 57ed77bf1a524c9985c491262adc35b49a3233c5 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Wed, 6 Mar 2002 09:25:57 +0000 Subject: [PATCH] no message --- stepmania/src/RageBitmapTexture.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/stepmania/src/RageBitmapTexture.cpp b/stepmania/src/RageBitmapTexture.cpp index c7528e5dba..f1db0d3a48 100644 --- a/stepmania/src/RageBitmapTexture.cpp +++ b/stepmania/src/RageBitmapTexture.cpp @@ -119,14 +119,16 @@ void RageBitmapTexture::Create( DWORD dwHints ) bScaleImageToTextureSize = ddii.Width > caps.MaxTextureWidth || 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 ) + for( int i=0; i<2; i++ ) // only try twice { + DWORD dwExpectedWidth = bScaleImageToTextureSize ? caps.MaxTextureWidth : ddii.Width; + DWORD dwExpectedHeight = bScaleImageToTextureSize ? caps.MaxTextureHeight : ddii.Height; + if( FAILED( hr = D3DXCreateTextureFromFileEx( m_pd3dDevice, // device m_sFilePath, // soure file @@ -163,6 +165,8 @@ void RageBitmapTexture::Create( DWORD dwHints ) if( dwExpectedWidth == ddsd.Width && dwExpectedHeight == ddsd.Height ) break; // done trying to load + else + bScaleImageToTextureSize = true; }