diff --git a/stepmania/src/BitmapText.cpp b/stepmania/src/BitmapText.cpp index ee8607b937..52108f0d98 100644 --- a/stepmania/src/BitmapText.cpp +++ b/stepmania/src/BitmapText.cpp @@ -82,7 +82,7 @@ void BitmapText::Draw() float fCharWidthZoomed = m_fCharWidthsInSourcePixels[c] * GetZoom(); SetState( c ); fX += fCharWidthZoomed/2; - SetX( fX ); // set X acording to offset + SetX( roundf(fX) ); // set X acording to offset and round to help blurring Sprite::Draw(); fX += fCharWidthZoomed/2; } diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index 1861d5b0ea..9dfaed9e0d 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -325,9 +325,12 @@ void Player::OnCompleteStep( float fSongBeat, Step player_step, float fMaxBeatDi float fStepBeat = StepIndexToBeat( iIndexThatWasSteppedOn ); // show the gray arrow ghost - int iColumnNum = m_StepToColumnNumber[player_step]; - GrayArrowGhostStep( iColumnNum ); - + for( int c=0; c < m_iNumColumns; c++ ) { // for each arrow column + if( m_OriginalStep[iIndexThatWasSteppedOn] & m_ColumnNumberToStep[c] ) { // this column is still unstepped on? + GrayArrowGhostStep( c ); + } + } + float fBeatsUntilStep = fStepBeat - fSongBeat; float fPercentFromPerfect = (float)fabs( fBeatsUntilStep / fMaxBeatDiff ); diff --git a/stepmania/src/RageUtil.cpp b/stepmania/src/RageUtil.cpp index 2fa21fab45..10626436f7 100644 --- a/stepmania/src/RageUtil.cpp +++ b/stepmania/src/RageUtil.cpp @@ -22,7 +22,7 @@ const CString g_sLogFileName = "debug.log"; // Name: randomf() // Desc: //----------------------------------------------------------------------------- -FLOAT randomf( FLOAT low, FLOAT high ) +float randomf( float low, float high ) { return low + ( high - low ) * ( (FLOAT)rand() ) / RAND_MAX; } @@ -31,14 +31,14 @@ FLOAT randomf( FLOAT low, FLOAT high ) // Name: roundf() // Desc: //----------------------------------------------------------------------------- -int roundf( FLOAT f ) +int roundf( float f ) { return (int)((f)+0.5f); } int roundf( double f ) { - return (int)((f)+0.5f); + return (int)((f)+0.5); } //----------------------------------------------------------------------------- @@ -271,9 +271,9 @@ int CompareCStrings(const void *arg1, const void *arg2) return str1.CompareNoCase( str2 ); } -void SortCStringArray( CStringArray &AddTo, BOOL bSortAcsending ) +void SortCStringArray( CStringArray &arrayCStrings, BOOL bSortAcsending ) { - qsort( AddTo.GetData(), AddTo.GetSize(), sizeof(CString), CompareCStrings ); + qsort( arrayCStrings.GetData(), arrayCStrings.GetSize(), sizeof(CString), CompareCStrings ); } //----------------------------------------------------------------------------- diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index 9efecb6d52..ffe2eafd9b 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -384,4 +384,72 @@ void Song::TidyUpData() if( FAILED( hr = D3DXGetImageInfoFromFile(m_sFilePath,&ddii) ) ) { RageErrorHr( ssprintf("D3DXGetImageInfoFromFile() failed for file '%s'.", m_sFilePath), hr ); } -*/ \ No newline at end of file +*/ + + +void Song::GetStepsThatMatchGameMode( GameMode gm, CArray& arrayAddTo ) +{ + for( int i=0; im_StepsMode; + + switch( gm ) // different logic for different game modes + { + case single4: + if( sm == Steps::SMsingle4 ) + arrayAddTo.Add( pCurrentSteps ); + break; + case single6: + if( sm == Steps::SMsingle6 ) + arrayAddTo.Add( pCurrentSteps ); + break; + case versus4: + if( sm == Steps::SMsingle4 || sm == Steps::SMcouple || sm == Steps::SMbattle ) + arrayAddTo.Add( pCurrentSteps ); + break; + case double4: + if( sm == Steps::SMdouble4 ) + arrayAddTo.Add( pCurrentSteps ); + break; + } + } + +} + +void Song::GetNumFeet( GameMode gm, int& iDiffEasyOut, int& iDiffMediumOut, int& iDiffHardOut ) +{ + iDiffEasyOut = iDiffMediumOut = iDiffHardOut = -1; + CArray arrayMatchingSteps; + GetStepsThatMatchGameMode( gm, arrayMatchingSteps ); + + //bool bFoundEasy, bFoundMedium, bFoundHard; + //bFoundEasy = bFoundMedium = bFoundHard = false; + + for( int i=0; im_iNumFeet; + + switch( arrayMatchingSteps[i]->m_difficulty ) + { + case Steps::easy: + iDiffEasyOut = iNumFeet; + break; + case Steps::medium: + iDiffMediumOut = iNumFeet; + break; + case Steps::hard: + iDiffHardOut = iNumFeet; + break; + case Steps::other: + // should do something intelligent to fill in the missing spots... + if( iDiffEasyOut < 0 && iNumFeet <= 4 ) + iDiffEasyOut = iNumFeet; + else if( iDiffHardOut < 0 && iNumFeet >= 7 ) + iDiffHardOut = iNumFeet; + else + iDiffMediumOut = iNumFeet; + break; + } + } +} \ No newline at end of file diff --git a/stepmania/src/StepMania.dsp b/stepmania/src/StepMania.dsp index 6c3b0f44be..d5715fda2c 100644 --- a/stepmania/src/StepMania.dsp +++ b/stepmania/src/StepMania.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FR /YX /FD /c +# ADD CPP /nologo /GB /MT /W3 /GX /O2 /Ob1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FR /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" diff --git a/stepmania/src/song.h b/stepmania/src/song.h index 72465c4a81..e0dcd4ff89 100644 --- a/stepmania/src/song.h +++ b/stepmania/src/song.h @@ -15,6 +15,10 @@ #include "Steps.h" class Steps; // why is this needed? +#include "GameInfo.h" // for definition of GameMode +enum GameMode; // why is this needed? + + class Song { @@ -62,8 +66,6 @@ public: }; void GetBeatAndBPSFromElapsedTime( float fElapsedTime, float &fBeatOut, float &fBPSOut ) { - if( fElapsedTime > 50 ) - fElapsedTime = fElapsedTime; fElapsedTime += m_fOffsetInSeconds; for( int i=0; i& arrayAddTo ); + void GetNumFeet( GameMode gm, int& iDiffEasy, int& iDiffMedium, int& iDiffHard ); + public: