From f2975d06887f3bef406a8a429bdc8b70462630fb Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 20 Jan 2002 23:29:03 +0000 Subject: [PATCH] no message --- stepmania/src/Background.cpp | 2 ++ stepmania/src/Background.h | 8 +++++ stepmania/src/MusicWheel.cpp | 10 ++++--- stepmania/src/Player.cpp | 8 ++--- stepmania/src/RageBitmapTexture.cpp | 20 +++++++++++-- stepmania/src/RageTexture.cpp | 45 ----------------------------- stepmania/src/Song.cpp | 6 ++++ stepmania/src/StepMania.dsp | 4 +++ stepmania/src/song.h | 5 ++++ 9 files changed, 53 insertions(+), 55 deletions(-) diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index 6809f6533c..bf3669d431 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -22,6 +22,8 @@ Background::Background() { m_bShowDanger = false; + m_sprDanger.SetZoom( 2 ); + m_sprDanger.SetEffectWagging(); m_sprDanger.Load( THEME->GetPathTo(GRAPHIC_DANGER) ); m_sprDanger.SetXY( CENTER_X, CENTER_Y ); diff --git a/stepmania/src/Background.h b/stepmania/src/Background.h index 5798a3d4fe..9789d5cf67 100644 --- a/stepmania/src/Background.h +++ b/stepmania/src/Background.h @@ -27,6 +27,14 @@ public: virtual void Update( float fDeltaTime ); virtual void RenderPrimitives(); + virtual void SetDiffuseColor( D3DXCOLOR c ) + { + m_sprVisualizationOverlay.SetDiffuseColor( c ); + m_sprSongBackground.SetDiffuseColor( c ); + m_sprDanger.SetDiffuseColor( c ); + m_sprDangerBackground.SetDiffuseColor( c ); + }; + virtual void TurnDangerOn() { m_bShowDanger = true; }; virtual void TurnDangerOff() { m_bShowDanger = false; }; diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index 73180d5c1f..d5423bfee5 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -314,7 +314,7 @@ void MusicWheel::RebuildWheelItems() float MusicWheel::GetBannerY( float fPosOffsetsFromMiddle ) { - return roundf( (fPosOffsetsFromMiddle)*43.2f ); + return fPosOffsetsFromMiddle*43.2f; } float MusicWheel::GetBannerBrightness( float fPosOffsetsFromMiddle ) @@ -370,7 +370,7 @@ float MusicWheel::GetBannerX( float fPosOffsetsFromMiddle ) } - return roundf( fX ); + return fX; } @@ -490,11 +490,13 @@ void MusicWheel::Update( float fDeltaTime ) // "rotate" wheel toward selected song - if( fabs(m_fPositionOffsetFromSelection) < 0.05f ) + if( fabs(m_fPositionOffsetFromSelection) < 0.02f ) m_fPositionOffsetFromSelection = 0; else { - m_fPositionOffsetFromSelection -= fDeltaTime * m_fPositionOffsetFromSelection*4; + m_fPositionOffsetFromSelection -= fDeltaTime * m_fPositionOffsetFromSelection*4; // linear + float fSign = m_fPositionOffsetFromSelection / fabs(m_fPositionOffsetFromSelection); + m_fPositionOffsetFromSelection -= fDeltaTime * fSign; // constant } } diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index 9a68957ef2..0106e847dd 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -18,11 +18,11 @@ -const float LIFE_PERFECT = 0.015f; -const float LIFE_GREAT = 0.008f; +const float LIFE_PERFECT = 0.010f; +const float LIFE_GREAT = 0.005f; const float LIFE_GOOD = 0.000f; -const float LIFE_BOO = -0.015f; -const float LIFE_MISS = -0.030f; +const float LIFE_BOO = -0.010f; +const float LIFE_MISS = -0.020f; const int ARROW_SIZE = 64; diff --git a/stepmania/src/RageBitmapTexture.cpp b/stepmania/src/RageBitmapTexture.cpp index abb6d54f66..1a6f94969e 100644 --- a/stepmania/src/RageBitmapTexture.cpp +++ b/stepmania/src/RageBitmapTexture.cpp @@ -23,6 +23,7 @@ #include "dxerr8.h" #include "DXUtil.h" #include "RageUtil.h" +#include "GameInfo.h" //#include #include @@ -61,6 +62,21 @@ void RageBitmapTexture::Create() { HRESULT hr; + D3DFORMAT fmtTexture; + if( !GAMEINFO ) + { + fmtTexture = D3DFMT_A4R4G4B4; + } + else + { + switch( GAMEINFO->m_GameOptions.m_iTextureColor ) + { + case 16: fmtTexture = D3DFMT_A4R4G4B4; break; + case 32: fmtTexture = D3DFMT_A8R8G8B8; break; + default: ASSERT( true ); // invalid iTextureColor value + } + } + D3DXIMAGE_INFO ddii; // load texture @@ -68,9 +84,9 @@ void RageBitmapTexture::Create() m_pd3dDevice, // device m_sFilePath, // soure file D3DX_DEFAULT, D3DX_DEFAULT, // width, height - D3DX_DEFAULT, // mip map levels + 3, // mip map levels 0, // usage (is a render target?) - D3DFMT_A4R4G4B4, // our preferred texture format + fmtTexture, // our preferred texture format D3DPOOL_MANAGED, // which memory pool D3DX_FILTER_BOX | D3DX_FILTER_DITHER, // filter D3DX_FILTER_BOX | D3DX_FILTER_DITHER, // mip filter diff --git a/stepmania/src/RageTexture.cpp b/stepmania/src/RageTexture.cpp index 8e7615d842..d500d7e2b6 100644 --- a/stepmania/src/RageTexture.cpp +++ b/stepmania/src/RageTexture.cpp @@ -78,8 +78,6 @@ void RageTexture::GetFrameDimensionsFromFileName( CString sPath, UINT* puFramesW *puFramesWide = *puFramesHigh = 1; // initialize in case we don't find dimensions in the file name sPath.MakeLower(); - if( sPath.Find("max300.png") != -1 ) - int kljds = 3; CString sDir, sFName, sExt; splitrelpath( sPath, sDir, sFName, sExt); @@ -109,47 +107,4 @@ void RageTexture::GetFrameDimensionsFromFileName( CString sPath, UINT* puFramesW return; } - - /* - ////////////////////////////////////////////////// - // Parse m_sFilePath for the frame dimensions - // - // The file name must look like "name 4x15.gif". The the space is required. - ////////////////////////////////////////////////// - CString sDimensionsString = sPath; // we will chop this down to the "4x15" part. Need regular... expressions... choke :-) - - // chop off the extension - int index_of_last_period = sDimensionsString.ReverseFind( '.' ); - if( index_of_last_period == -1 ) // this file name has no extension, but it the texture was loaded. I doubt this code will ever execute :-) - { - *puFramesWide = *puFramesHigh = 1; - return; - } - sDimensionsString = sDimensionsString.Left(index_of_last_period); - - // chop off everything before and including the last space - int index_of_last_space = sDimensionsString.ReverseFind( ' ' ); - if( index_of_last_space == -1 ) // this file name has space, so the dimensions tag cannot be read - { - *puFramesWide = *puFramesHigh = 1; - return; - } - sDimensionsString.Delete( 0, index_of_last_space+1 ); - - // now we are left with "4x15" - int index_of_x = sDimensionsString.Find( 'x' ); - if( index_of_x == -1 ) // this file name doesn't have an x in the last token. So, this probably isn't a dimension tag. - { - *puFramesWide = *puFramesHigh = 1; - return; - } - *puFramesWide = (UINT) atoi( sDimensionsString.Left( index_of_x ) ); - - // chop off the frames wide part and read in the frames high - sDimensionsString.Delete( 0, index_of_x+1 ); - *puFramesHigh = (UINT) atoi( sDimensionsString ); - - if( *puFramesWide == 0 ) *puFramesWide = 1; - if( *puFramesHigh == 0 ) *puFramesHigh = 1; - */ } \ No newline at end of file diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index 0c286aadef..6be902d52b 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -76,6 +76,12 @@ Song::Song() m_fOffsetInSeconds = 0; m_iNumTimesPlayed = 0; + for( int i=0; i<6; i++ ) + { + m_iMaxCombo[i] = 0; + m_iTopScore[i] = 0; + m_TopGrade[i].FromString( "N" ); + } } diff --git a/stepmania/src/StepMania.dsp b/stepmania/src/StepMania.dsp index 17fa8bae60..93e1e85c83 100644 --- a/stepmania/src/StepMania.dsp +++ b/stepmania/src/StepMania.dsp @@ -460,6 +460,10 @@ SOURCE=.\StepMania.cpp # End Source File # Begin Source File +SOURCE=.\StepMania.h +# End Source File +# Begin Source File + SOURCE=.\StepMania.ICO # End Source File # Begin Source File diff --git a/stepmania/src/song.h b/stepmania/src/song.h index 900e1e32c4..811b5d3527 100644 --- a/stepmania/src/song.h +++ b/stepmania/src/song.h @@ -90,6 +90,11 @@ public: public: int m_iNumTimesPlayed; + // statistics for single-basic, single-another... double-basic... double-maniac: + Grade m_TopGrade[6]; + int m_iTopScore[6]; + int m_iMaxCombo[6]; + private: CString m_sSongFilePath;