From 144a7339f2bd40ed0caedd7d4261dfc7f28ea6b2 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Wed, 11 Sep 2002 06:49:30 +0000 Subject: [PATCH] re-enabled alpha override and dithering for song BGs --- stepmania/TODO.chris | 4 ---- stepmania/src/Background.cpp | 9 +++++++++ stepmania/src/RageBitmapTexture.cpp | 25 ++++++++++++++----------- stepmania/src/Song.cpp | 2 +- 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/stepmania/TODO.chris b/stepmania/TODO.chris index 6e44497881..4c1ef8bcdc 100644 --- a/stepmania/TODO.chris +++ b/stepmania/TODO.chris @@ -2,10 +2,6 @@ Fix ///////////////////////// -test DWI writer - -Make Save both SM and DWI - The "groove bar" reports at the results screen is broken. Getting a nearly full voltage bar on a song when I barely maitain combo (it should be max combo/max possible combo), diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index 3c4c090abf..9cfca2c86f 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -133,6 +133,15 @@ void Background::LoadFromSong( Song* pSong ) // BackgroundAnimation* pTempBGA; + + // Tricky! The song background looks terrible unless its loaded with no alpha + // and dithered. Create a dummy sprite that loads the texture with the proper + // hints so we don't have to hack up BackgroundAnimation to handle this special + // case. + Sprite sprDummy; + sprDummy.Load( sSongBackgroundPath, true, 4, 0, true, false ); + + pTempBGA = new BackgroundAnimation; pTempBGA->LoadFromStaticGraphic( sSongBackgroundPath ); m_BackgroundAnimations.Add( pTempBGA ); diff --git a/stepmania/src/RageBitmapTexture.cpp b/stepmania/src/RageBitmapTexture.cpp index c863c8aba9..2295aca534 100644 --- a/stepmania/src/RageBitmapTexture.cpp +++ b/stepmania/src/RageBitmapTexture.cpp @@ -128,19 +128,22 @@ void RageBitmapTexture::Create( switch( dwTextureColorDepth ) { case 16: -// switch( iAlphaBits ) -// { -// case 0: fmtTexture = D3DFMT_R5G6B5; break; -// case 1: fmtTexture = D3DFMT_A1R5G5B5; break; -// default: fmtTexture = D3DFMT_A4R4G4B4; break; -// } - - // Ignore dwTextureColorDepth, and infer based on image format - switch( ddii.Format ) + switch( iAlphaBits ) { - case D3DFMT_P8: fmtTexture = D3DFMT_A1R5G5B5; break; - default: fmtTexture = D3DFMT_A4R4G4B4; break; + case 0: fmtTexture = D3DFMT_R5G6B5; break; + case 1: fmtTexture = D3DFMT_A1R5G5B5; break; + case 4: + // Ignore dwTextureColorDepth, and infer based on image format + switch( ddii.Format ) + { + case D3DFMT_P8: fmtTexture = D3DFMT_A1R5G5B5; break; + default: fmtTexture = D3DFMT_A4R4G4B4; break; + } + break; + default: + ASSERT(0); // invalid iAlphaBits value } + break; case 32: fmtTexture = D3DFMT_A8R8G8B8; diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index e0972cceef..b431ac9aba 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -45,7 +45,7 @@ #include "NotesLoaderKSF.h" #include "NotesWriterDWI.h" -const int FILE_CACHE_VERSION = 68; // increment this when Song or Notes changes to invalidate cache +const int FILE_CACHE_VERSION = 69; // increment this when Song or Notes changes to invalidate cache int CompareBPMSegments(const void *arg1, const void *arg2)