no message

This commit is contained in:
Chris Danford
2001-11-30 09:38:35 +00:00
parent a9eec44e4a
commit 9b4f0e6918
6 changed files with 89 additions and 13 deletions
+1 -1
View File
@@ -82,7 +82,7 @@ void BitmapText::Draw()
float fCharWidthZoomed = m_fCharWidthsInSourcePixels[c] * GetZoom(); float fCharWidthZoomed = m_fCharWidthsInSourcePixels[c] * GetZoom();
SetState( c ); SetState( c );
fX += fCharWidthZoomed/2; 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(); Sprite::Draw();
fX += fCharWidthZoomed/2; fX += fCharWidthZoomed/2;
} }
+5 -2
View File
@@ -325,8 +325,11 @@ void Player::OnCompleteStep( float fSongBeat, Step player_step, float fMaxBeatDi
float fStepBeat = StepIndexToBeat( iIndexThatWasSteppedOn ); float fStepBeat = StepIndexToBeat( iIndexThatWasSteppedOn );
// show the gray arrow ghost // show the gray arrow ghost
int iColumnNum = m_StepToColumnNumber[player_step]; for( int c=0; c < m_iNumColumns; c++ ) { // for each arrow column
GrayArrowGhostStep( iColumnNum ); if( m_OriginalStep[iIndexThatWasSteppedOn] & m_ColumnNumberToStep[c] ) { // this column is still unstepped on?
GrayArrowGhostStep( c );
}
}
float fBeatsUntilStep = fStepBeat - fSongBeat; float fBeatsUntilStep = fStepBeat - fSongBeat;
float fPercentFromPerfect = (float)fabs( fBeatsUntilStep / fMaxBeatDiff ); float fPercentFromPerfect = (float)fabs( fBeatsUntilStep / fMaxBeatDiff );
+5 -5
View File
@@ -22,7 +22,7 @@ const CString g_sLogFileName = "debug.log";
// Name: randomf() // Name: randomf()
// Desc: // Desc:
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
FLOAT randomf( FLOAT low, FLOAT high ) float randomf( float low, float high )
{ {
return low + ( high - low ) * ( (FLOAT)rand() ) / RAND_MAX; return low + ( high - low ) * ( (FLOAT)rand() ) / RAND_MAX;
} }
@@ -31,14 +31,14 @@ FLOAT randomf( FLOAT low, FLOAT high )
// Name: roundf() // Name: roundf()
// Desc: // Desc:
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
int roundf( FLOAT f ) int roundf( float f )
{ {
return (int)((f)+0.5f); return (int)((f)+0.5f);
} }
int roundf( double f ) 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 ); 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 );
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
+68
View File
@@ -385,3 +385,71 @@ void Song::TidyUpData()
RageErrorHr( ssprintf("D3DXGetImageInfoFromFile() failed for file '%s'.", m_sFilePath), hr ); RageErrorHr( ssprintf("D3DXGetImageInfoFromFile() failed for file '%s'.", m_sFilePath), hr );
} }
*/ */
void Song::GetStepsThatMatchGameMode( GameMode gm, CArray<Steps*, Steps*&>& arrayAddTo )
{
for( int i=0; i<arraySteps.GetSize(); i++ ) // for each of the Song's Steps
{
Steps* pCurrentSteps = &arraySteps[i];
Steps::StepsMode sm = pCurrentSteps->m_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<Steps*, Steps*&> arrayMatchingSteps;
GetStepsThatMatchGameMode( gm, arrayMatchingSteps );
//bool bFoundEasy, bFoundMedium, bFoundHard;
//bFoundEasy = bFoundMedium = bFoundHard = false;
for( int i=0; i<arrayMatchingSteps.GetSize(); i++ )
{
int iNumFeet = arrayMatchingSteps[i]->m_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;
}
}
}
+1 -1
View File
@@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # 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 BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD BASE RSC /l 0x409 /d "NDEBUG"
+7 -2
View File
@@ -15,6 +15,10 @@
#include "Steps.h" #include "Steps.h"
class Steps; // why is this needed? class Steps; // why is this needed?
#include "GameInfo.h" // for definition of GameMode
enum GameMode; // why is this needed?
class Song class Song
{ {
@@ -62,8 +66,6 @@ public:
}; };
void GetBeatAndBPSFromElapsedTime( float fElapsedTime, float &fBeatOut, float &fBPSOut ) void GetBeatAndBPSFromElapsedTime( float fElapsedTime, float &fBeatOut, float &fBPSOut )
{ {
if( fElapsedTime > 50 )
fElapsedTime = fElapsedTime;
fElapsedTime += m_fOffsetInSeconds; fElapsedTime += m_fOffsetInSeconds;
for( int i=0; i<m_BPMSegments.GetSize(); i++ ) { for( int i=0; i<m_BPMSegments.GetSize(); i++ ) {
@@ -84,6 +86,9 @@ public:
} }
}; };
void GetStepsThatMatchGameMode( GameMode gm, CArray<Steps*, Steps*&>& arrayAddTo );
void GetNumFeet( GameMode gm, int& iDiffEasy, int& iDiffMedium, int& iDiffHard );
public: public: