diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index bf3669d431..8facb4d0a9 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -24,7 +24,7 @@ Background::Background() m_sprDanger.SetZoom( 2 ); m_sprDanger.SetEffectWagging(); - m_sprDanger.Load( THEME->GetPathTo(GRAPHIC_DANGER) ); + m_sprDanger.Load( THEME->GetPathTo(GRAPHIC_DANGER_TEXT) ); m_sprDanger.SetXY( CENTER_X, CENTER_Y ); m_sprDangerBackground.Load( THEME->GetPathTo(GRAPHIC_DANGER_BACKGROUND) ); diff --git a/stepmania/src/Banner.cpp b/stepmania/src/Banner.cpp index e02668d7ad..49f1b9e2b4 100644 --- a/stepmania/src/Banner.cpp +++ b/stepmania/src/Banner.cpp @@ -21,7 +21,7 @@ bool Banner::LoadFromSong( Song* pSong ) // NULL means no song { if( pSong == NULL ) Sprite::Load( THEME->GetPathTo(GRAPHIC_FALLBACK_BANNER) ); - if( pSong->HasBanner() ) + else if( pSong->HasBanner() ) Sprite::Load( pSong->GetBannerPath() ); else if( pSong->HasBackground() ) Sprite::Load( pSong->GetBackgroundPath() ); diff --git a/stepmania/src/BitmapText.cpp b/stepmania/src/BitmapText.cpp index 4488bb892d..8890de1a98 100644 --- a/stepmania/src/BitmapText.cpp +++ b/stepmania/src/BitmapText.cpp @@ -29,7 +29,19 @@ BitmapText::BitmapText() m_HorizAlign = align_center; m_VertAlign = align_middle; -// m_bHasShadow = false; + // allocate a vertex buffer + HRESULT hr; + if( FAILED( hr = SCREEN->GetDevice()->CreateVertexBuffer( + MAX_NUM_VERTICIES * sizeof(CUSTOMVERTEX), + D3DUSAGE_WRITEONLY, D3DFVF_CUSTOMVERTEX, + D3DPOOL_MANAGED, &m_pVB ) ) ) + RageErrorHr( "Vertex Buffer Could Not Be Created", hr ); + +} + +BitmapText::~BitmapText() +{ + SAFE_RELEASE( m_pVB ); } bool BitmapText::Load( CString sFontFilePath ) @@ -230,16 +242,20 @@ void BitmapText::RenderPrimitives() break; } + pd3dDevice->SetRenderState( D3DRS_SRCBLEND, m_bBlendAdd ? D3DBLEND_ONE : D3DBLEND_SRCALPHA ); + pd3dDevice->SetRenderState( D3DRS_DESTBLEND, m_bBlendAdd ? D3DBLEND_ONE : D3DBLEND_INVSRCALPHA ); + // make the object in logical units centered at the origin - LPDIRECT3DVERTEXBUFFER8 pVB = SCREEN->GetVertexBuffer(); CUSTOMVERTEX* v; - pVB->Lock( 0, 0, (BYTE**)&v, 0 ); + m_pVB->Lock( 0, 0, (BYTE**)&v, 0 ); - int iVNum = 0; // the current vertex number + int &iVNum = m_iNumVerticies; // the current vertex number + iVNum = 0; + float fHeight = GetUnzoomedHeight(); float fY; @@ -450,3 +466,96 @@ CString BitmapText::GetText() { return join( "\n", m_sTextLines ); } + +void BitmapText::RebuildVertexBuffer() +{ + // make the object in logical units centered at the origin + CUSTOMVERTEX* v; + m_pVB->Lock( 0, 0, (BYTE**)&v, 0 ); + + + int &iVNum = m_iNumVerticies; // the current vertex number + iVNum = 0; + + + float fHeight = GetUnzoomedHeight(); + float fY; + switch( m_VertAlign ) + { + case align_top: fY = -(m_sTextLines.GetSize()) * fHeight / 2; break; break; + case align_middle: fY = 0; break; + case align_bottom: fY = (m_sTextLines.GetSize()) * fHeight / 2; break; + default: ASSERT( true ); + } + + + for( i=0; i 1-fPercentageOfFrame ) + fPercentExtra = 1-fPercentageOfFrame; + + + // set vertex positions + + v[iVNum++].p = D3DXVECTOR3( fX, fY+fHeight/2, 0 ); // bottom left + v[iVNum++].p = D3DXVECTOR3( fX, fY-fHeight/2, 0 ); // top left + + fX += fCharWidth; + + float fExtraPixels = fPercentExtra * GetUnzoomedWidth(); + + v[iVNum++].p = D3DXVECTOR3( fX+fExtraPixels, fY+fHeight/2, 0 ); // bottom right + v[iVNum++].p = D3DXVECTOR3( fX+fExtraPixels, fY-fHeight/2, 0 ); // top right + + + // set texture coordinates + iVNum -= 4; + + FRECT* pTexCoordRect = m_pTexture->GetTextureCoordRect( iFrameNo ); + + float fExtraTexCoords = fPercentExtra * m_pTexture->GetTextureFrameWidth() / m_pTexture->GetTextureWidth(); + + v[iVNum].tu = pTexCoordRect->left; v[iVNum++].tv = pTexCoordRect->bottom; // bottom left + v[iVNum].tu = pTexCoordRect->left; v[iVNum++].tv = pTexCoordRect->top; // top left + v[iVNum].tu = pTexCoordRect->right + fExtraTexCoords; v[iVNum++].tv = pTexCoordRect->bottom; // bottom right + v[iVNum].tu = pTexCoordRect->right + fExtraTexCoords; v[iVNum++].tv = pTexCoordRect->top; // top right + + + } + + fY += fHeight; + } + + + + m_pVB->Unlock(); + +} \ No newline at end of file diff --git a/stepmania/src/BitmapText.h b/stepmania/src/BitmapText.h index 78ab5935ba..d21f635e20 100644 --- a/stepmania/src/BitmapText.h +++ b/stepmania/src/BitmapText.h @@ -39,11 +39,17 @@ public: protected: bool LoadCharWidths( CString sWidthFilePath ); + // a vertex buffer for all to share CString m_sFontFilePath; int m_iCharToFrameNo[NUM_CHARS]; float m_fFrameNoToWidth[NUM_CHARS]; // in soure coordinate space + + LPDIRECT3DVERTEXBUFFER8 m_pVB; // our vertex buffer only needs to be rebuilt when the text changes + int m_iNumVerticies; + RebuildVertexBuffer(); // this should be called when the + CStringArray m_sTextLines; }; diff --git a/stepmania/src/DifficultyIcon.h b/stepmania/src/DifficultyIcon.h index 0aba21006a..9edd91585f 100644 --- a/stepmania/src/DifficultyIcon.h +++ b/stepmania/src/DifficultyIcon.h @@ -30,9 +30,18 @@ public: SetFromDescription( "" ); }; - void SetFromSteps( Steps &steps ) + void SetFromSteps( Steps* pSteps ) { - SetFromDescription( steps.m_sDescription ); + if( pSteps != NULL ) + { + SetDiffuseColor( D3DXCOLOR(1,1,1,1) ); + SetFromDescription( pSteps->m_sDescription ); + } + else + { + SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); + SetFromDescription( "" ); + } }; private: diff --git a/stepmania/src/FootMeter.h b/stepmania/src/FootMeter.h index 24718e8f0b..a023db52a3 100644 --- a/stepmania/src/FootMeter.h +++ b/stepmania/src/FootMeter.h @@ -29,9 +29,18 @@ public: SetNumFeet( 0, "" ); }; - void SetFromSteps( Steps &steps ) + void SetFromSteps( Steps* pSteps ) { - SetNumFeet( steps.m_iNumFeet, steps.m_sDescription ); + if( pSteps != NULL ) + { + SetDiffuseColor( D3DXCOLOR(1,1,1,1) ); + SetNumFeet( pSteps->m_iNumFeet, pSteps->m_sDescription ); + } + else + { + SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); + SetNumFeet( 0, "" ); + } }; private: diff --git a/stepmania/src/Grade.cpp b/stepmania/src/Grade.cpp index f6f547729b..b5542e9765 100644 --- a/stepmania/src/Grade.cpp +++ b/stepmania/src/Grade.cpp @@ -9,13 +9,34 @@ ----------------------------------------------------------------------------- */ - - #include "Grade.h" -#include "RageUtil.h" -#include "ScreenDimensions.h" -#include "ThemeManager.h" - - +CString GradeToString( Grade g ) +{ + switch( g ) + { + case GRADE_AAA: return "AAA"; + case GRADE_AA: return "AA"; + case GRADE_A: return "A"; + case GRADE_B: return "B"; + case GRADE_C: return "C"; + case GRADE_D: return "D"; + case GRADE_E: return "E"; + case GRADE_NO_DATA: return "N"; + default: ASSERT(true); return "N"; + } +}; +Grade StringToGrade( CString s ) +{ + s.MakeUpper(); + if ( s == "AAA" ) return GRADE_AAA; + else if( s == "AA" ) return GRADE_AA; + else if( s == "A" ) return GRADE_A; + else if( s == "B" ) return GRADE_B; + else if( s == "C" ) return GRADE_C; + else if( s == "D" ) return GRADE_D; + else if( s == "E" ) return GRADE_E; + else if( s == "N" ) return GRADE_NO_DATA; + else ASSERT(true); return GRADE_NO_DATA; // invalid grade string +}; diff --git a/stepmania/src/Grade.h b/stepmania/src/Grade.h index 2ecce7c100..0d773df9df 100644 --- a/stepmania/src/Grade.h +++ b/stepmania/src/Grade.h @@ -13,49 +13,13 @@ #define _Grade_H_ -#include "Sprite.h" -#include "ThemeManager.h" -struct Grade -{ - Grade() - { - m_GradeType = GRADE_NO_DATA; - }; +enum Grade { GRADE_NO_DATA=0, GRADE_E, GRADE_D, GRADE_C, GRADE_B, GRADE_A, GRADE_AA, GRADE_AAA }; + +CString GradeToString( Grade g ); +Grade StringToGrade( CString s ); - CString ToString() - { - switch( m_GradeType ) - { - case GRADE_AAA: return "AAA"; - case GRADE_AA: return "AA"; - case GRADE_A: return "A"; - case GRADE_B: return "B"; - case GRADE_C: return "C"; - case GRADE_D: return "D"; - case GRADE_E: return "E"; - case GRADE_NO_DATA: return "N"; - default: ASSERT(true); return "N"; - } - }; - void FromString( CString sGrade ) - { - sGrade.MakeUpper(); - if ( sGrade == "AAA" ) m_GradeType = GRADE_AAA; - else if( sGrade == "AA" ) m_GradeType = GRADE_AA; - else if( sGrade == "A" ) m_GradeType = GRADE_A; - else if( sGrade == "B" ) m_GradeType = GRADE_B; - else if( sGrade == "C" ) m_GradeType = GRADE_C; - else if( sGrade == "D" ) m_GradeType = GRADE_D; - else if( sGrade == "E" ) m_GradeType = GRADE_E; - else if( sGrade == "N" ) m_GradeType = GRADE_NO_DATA; - else ASSERT(true); // invalid grade string - }; - - enum GradeType { GRADE_NO_DATA=0, GRADE_E, GRADE_D, GRADE_C, GRADE_B, GRADE_A, GRADE_AA, GRADE_AAA }; - GradeType m_GradeType; -}; #endif diff --git a/stepmania/src/GradeDisplay.h b/stepmania/src/GradeDisplay.h index 10ed8452d0..ed98807f69 100644 --- a/stepmania/src/GradeDisplay.h +++ b/stepmania/src/GradeDisplay.h @@ -26,22 +26,21 @@ public: { Load( THEME->GetPathTo(GRAPHIC_GRADES) ); StopAnimating(); - Grade grade; - grade.m_GradeType = Grade::GRADE_NO_DATA; - SetGrade( grade ); + SetGrade( GRADE_NO_DATA ); }; - void SetGrade( Grade grade ) + void SetGrade( Grade g ) { - switch( grade.m_GradeType ) + switch( g ) { - case Grade::GRADE_NO_DATA: SetState(7); break; - case Grade::GRADE_E: SetState(6); break; - case Grade::GRADE_D: SetState(5); break; - case Grade::GRADE_C: SetState(4); break; - case Grade::GRADE_A: SetState(3); break; - case Grade::GRADE_AA: SetState(2); break; - case Grade::GRADE_AAA: SetState(1); break; + case GRADE_AAA: SetState(0); break; + case GRADE_AA: SetState(1); break; + case GRADE_A: SetState(2); break; + case GRADE_B: SetState(3); break; + case GRADE_C: SetState(4); break; + case GRADE_D: SetState(5); break; + case GRADE_E: SetState(6); break; + case GRADE_NO_DATA: SetState(7); break; default: ASSERT( true ); } }; diff --git a/stepmania/src/MotionBlurSprite.h b/stepmania/src/MotionBlurSprite.h index afa11976f9..22c2b3f438 100644 --- a/stepmania/src/MotionBlurSprite.h +++ b/stepmania/src/MotionBlurSprite.h @@ -16,7 +16,7 @@ #include "ActorFrame.h" -const int NUM_BLUR_GHOSTS = 4; +const int NUM_BLUR_GHOSTS = 1; class MotionBlurSprite : public Actor { diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index 7b9fe1592c..0bad71b5ed 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -59,27 +59,17 @@ void WheelItem::LoadFromSong( Song &song ) { m_WheelItemType = TYPE_MUSIC; - m_MusicStatusDisplay.SetXY( -140, 0 ); + m_MusicStatusDisplay.SetXY( -132, 0 ); this->AddActor( &m_MusicStatusDisplay ); m_Banner.SetHorizAlign( align_left ); - m_Banner.SetXY( -30, 0 ); + m_Banner.SetXY( 15, 0 ); this->AddActor( &m_Banner ); - m_GradeP1.SetZoom( 0.4f ); - m_GradeP1.SetXY( 105, 0 ); - this->AddActor( &m_GradeP1 ); - - m_GradeP2.SetZoom( 0.4f ); - m_GradeP2.SetXY( 145, 0 ); - this->AddActor( &m_GradeP2 ); - m_pSong = &song; m_Banner.LoadFromSong( song ); - m_MusicStatusDisplay.SetNew( m_pSong->m_iNumTimesPlayed == 0 ); - //m_GradeP1.SetGrade( song.m_TopGrade[PLAYER_1] ); - //m_GradeP2.SetGrade( song.m_TopGrade[PLAYER_2] ); + m_MusicStatusDisplay.SetNew( m_pSong->GetNumTimesPlayed() == 0 ); }; @@ -440,7 +430,7 @@ void MusicWheel::Update( float fDeltaTime ) { case STATE_SWITCHING_MUSIC: m_WheelState = STATE_IDLE; // now, wait for input - WM->SendMessageToTopWindow( SM_PlayMusicSample, 0 ); + WM->SendMessageToTopWindow( SM_PlaySongSample, 0 ); break; case STATE_FLYING_OFF_BEFORE_NEXT_SORT: { @@ -470,11 +460,11 @@ void MusicWheel::Update( float fDeltaTime ) } break; case STATE_FLYING_ON_AFTER_NEXT_SORT: - WM->SendMessageToTopWindow( SM_PlayMusicSample, 0 ); + WM->SendMessageToTopWindow( SM_PlaySongSample, 0 ); m_WheelState = STATE_IDLE; // now, wait for input break; case STATE_TWEENING_ON_SCREEN: - WM->SendMessageToTopWindow( SM_PlayMusicSample, 0 ); + WM->SendMessageToTopWindow( SM_PlaySongSample, 0 ); m_WheelState = STATE_IDLE; m_fTimeLeftInState = 0; break; diff --git a/stepmania/src/MusicWheel.h b/stepmania/src/MusicWheel.h index 080a844954..9e360e0b75 100644 --- a/stepmania/src/MusicWheel.h +++ b/stepmania/src/MusicWheel.h @@ -30,8 +30,8 @@ const int NUM_WHEEL_ITEMS_TO_DRAW = 13; const float FADE_TIME = 0.5f; - -const WindowMessage SM_PlayMusicSample = WindowMessage(SM_User+47); // this should be unique! +const WindowMessage SM_SongChanged = WindowMessage(SM_User+47); // this should be unique! +const WindowMessage SM_PlaySongSample = WindowMessage(SM_User+48); @@ -69,8 +69,6 @@ public: Song* m_pSong; MusicStatusDisplay m_MusicStatusDisplay; TextBanner m_Banner; - GradeDisplay m_GradeP1; - GradeDisplay m_GradeP2; }; diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index 26a65bb584..926708b458 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -61,11 +61,8 @@ const float PILL_OFFSET_Y[LIEFMETER_NUM_PILLS] = { const float SCORE_Y = SCREEN_HEIGHT - 40; -Player::Player( PlayerOptions po, PlayerNumber pn ) +Player::Player() { - m_PlayerOptions = po; - m_PlayerNumber = pn; - m_iCurCombo = 0; m_iMaxCombo = 0; m_fLifePercentage = 0.50f; @@ -232,6 +229,13 @@ Player::Player( PlayerOptions po, PlayerNumber pn ) } +void Player::SetPlayerOptions( PlayerOptions po, PlayerNumber pn ) +{ + m_PlayerOptions = po; + m_PlayerNumber = pn; +} + + void Player::SetX( float fX ) { m_fArrowsCenterX = fX; diff --git a/stepmania/src/Player.h b/stepmania/src/Player.h index 2ad0d65d00..a70bc60352 100644 --- a/stepmania/src/Player.h +++ b/stepmania/src/Player.h @@ -36,7 +36,8 @@ const int MAX_NUM_COLUMNS = 8; class Player : public ActorFrame { public: - Player( PlayerOptions po, PlayerNumber pn ); + Player(); + void SetPlayerOptions( PlayerOptions po, PlayerNumber pn ); virtual void Update( float fDeltaTime, float fSongBeat, float fMaxBeatDifference ); virtual void RenderPrimitives(); diff --git a/stepmania/src/RageUtil.cpp b/stepmania/src/RageUtil.cpp index c62bac708a..f2fe68227b 100644 --- a/stepmania/src/RageUtil.cpp +++ b/stepmania/src/RageUtil.cpp @@ -68,11 +68,12 @@ void RageLogStart() { #if defined(DEBUG) | defined(_DEBUG) - // create a new log file, overwriting the old one DeleteFile( g_sLogFileName ); + DeleteFile( g_sErrorFileName ); + + // Open log file and leave it open. Let the OS close it when the app exits g_fileLog = fopen( g_sLogFileName, "w" ); - // let the OS close the file when the app exits SYSTEMTIME st; GetLocalTime( &st ); diff --git a/stepmania/src/ScoreDisplayRolling.cpp b/stepmania/src/ScoreDisplayRolling.cpp index d178c27a7b..20d4e6b131 100644 --- a/stepmania/src/ScoreDisplayRolling.cpp +++ b/stepmania/src/ScoreDisplayRolling.cpp @@ -14,35 +14,21 @@ #include "ThemeManager.h" -const float TIME_BETWEEN_TICKS = 0.05f; - ScoreDisplayRolling::ScoreDisplayRolling() { RageLog( "ScoreDisplayRolling::ScoreDisplayRolling()" ); - for( int i=0; iGetPathTo(FONT_SCORE_NUMBERS) ); + TurnShadowOff(); + + // init the digits + for( int i=0; iGetPathTo(FONT_SCORE_NUMBERS) ); - m_textDigits[i].TurnShadowOff(); - - // get the width of the numbers - m_textDigits[i].SetText( "0" ); - float fCharWidth = m_textDigits[i].GetWidestLineWidthInSourcePixels(); - - m_textDigits[i].SetText( " " ); - - float fCharOffsetsFromCenter = i - float(MAX_SCORE_DIGITS-1)/2; - - m_textDigits[i].SetXY( fCharOffsetsFromCenter * fCharWidth, 0 ); - - iCurrentScoreDigits[i] = 0; - iDestinationScoreDigits[i] = 0; - - this->AddActor( &m_textDigits[i] ); + m_iCurrentScoreDigits[i] = 0; + m_iDestinationScoreDigits[i] = 0; } - m_fTimeUntilNextTick = 0; - SetScore( 0 ); } @@ -50,12 +36,12 @@ ScoreDisplayRolling::ScoreDisplayRolling() void ScoreDisplayRolling::SetScore( float fNewScore ) { // super inefficient (but isn't called very often) - CString sFormatString = ssprintf( "%%%d.0f", MAX_SCORE_DIGITS ); + CString sFormatString = ssprintf( "%%%d.0f", NUM_SCORE_DIGITS ); CString sScore = ssprintf( sFormatString, fNewScore ); - for( int i=0; i 9 ) - iCurrentScoreDigits[i] = 0; - - m_textDigits[i].SetText( ssprintf("%d", iCurrentScoreDigits[i]) ); - } - } - } + BitmapText::Update( fDeltaTime ); } +void ScoreDisplayRolling::Draw() +{ + // find the leftmost current digit that doesn't match the destination digit + for( int i=0; i 9 ) + m_iCurrentScoreDigits[i] = 0; + } + + int iCurScore = 0; + int iMultiplier = 1; + for( int d=NUM_SCORE_DIGITS-1; d>=0; d-- ) // foreach digit + { + iCurScore += m_iCurrentScoreDigits[d] * iMultiplier; + iMultiplier *= 10; + } + + CString sFormat = ssprintf( "%%%d.0d", NUM_SCORE_DIGITS ); + SetText( ssprintf(sFormat, iCurScore) ); + + BitmapText::Draw(); +} \ No newline at end of file diff --git a/stepmania/src/ScoreDisplayRolling.h b/stepmania/src/ScoreDisplayRolling.h index 0599c643fc..5d33b1e6d6 100644 --- a/stepmania/src/ScoreDisplayRolling.h +++ b/stepmania/src/ScoreDisplayRolling.h @@ -19,23 +19,21 @@ #include "BitmapText.h" -const int MAX_SCORE_DIGITS = 9; +const int NUM_SCORE_DIGITS = 9; -class ScoreDisplayRolling : public ActorFrame +class ScoreDisplayRolling : public BitmapText { public: ScoreDisplayRolling(); void SetScore( float fNewScore ); virtual void Update( float fDeltaTime ); + virtual void Draw(); protected: - BitmapText m_textDigits[MAX_SCORE_DIGITS]; - int iCurrentScoreDigits[MAX_SCORE_DIGITS]; - int iDestinationScoreDigits[MAX_SCORE_DIGITS]; - - float m_fTimeUntilNextTick; + int m_iCurrentScoreDigits[NUM_SCORE_DIGITS]; + int m_iDestinationScoreDigits[NUM_SCORE_DIGITS]; }; #endif \ No newline at end of file diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index 52b43dff6e..7c12da8558 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -72,14 +72,6 @@ Song::Song() { m_bChangedSinceSave = false; 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" ); - } } @@ -641,7 +633,7 @@ void Song::TidyUpData() } -void Song::GetStepsThatMatchGameMode( GameMode gm, CArray& arrayAddTo ) +void Song::GetStepsThatMatchGameMode( GameMode gm, CArray& arrayAddTo ) { for( int i=0; i& arra void Song::GetNumFeet( GameMode gm, int& iDiffEasyOut, int& iDiffMediumOut, int& iDiffHardOut ) { iDiffEasyOut = iDiffMediumOut = iDiffHardOut = -1; // -1 means not found - CArray arrayMatchingSteps; + CArray arrayMatchingSteps; GetStepsThatMatchGameMode( gm, arrayMatchingSteps ); for( int i=0; im_iNumFeet; - switch( arrayMatchingSteps[i]->m_difficulty ) + switch( arrayMatchingSteps[i]->m_DifficultyClass ) { - case Steps::easy: + case Steps::CLASS_EASY: iDiffEasyOut = iNumFeet; break; - case Steps::medium: + case Steps::CLASS_MEDIUM: iDiffMediumOut = iNumFeet; break; - case Steps::hard: + case Steps::CLASS_HARD: iDiffHardOut = iNumFeet; break; - case Steps::other: + case Steps::CLASS_OTHER: // should do something intelligent to fill in the missing spots... if( iDiffEasyOut < 0 && iNumFeet <= 4 ) iDiffEasyOut = iNumFeet; @@ -790,8 +782,8 @@ int CompareSongPointersByMostPlayed(const void *arg1, const void *arg2) Song* pSong1 = *(Song**)arg1; Song* pSong2 = *(Song**)arg2; - int iNumTimesPlayed1 = pSong1->m_iNumTimesPlayed; - int iNumTimesPlayed2 = pSong2->m_iNumTimesPlayed; + int iNumTimesPlayed1 = pSong1->GetNumTimesPlayed(); + int iNumTimesPlayed2 = pSong2->GetNumTimesPlayed(); CString sFilePath1 = pSong1->GetSongFilePath(); // this is unique among songs CString sFilePath2 = pSong2->GetSongFilePath(); diff --git a/stepmania/src/Sprite.cpp b/stepmania/src/Sprite.cpp index c4ab603988..e58605554f 100644 --- a/stepmania/src/Sprite.cpp +++ b/stepmania/src/Sprite.cpp @@ -306,10 +306,6 @@ void Sprite::RenderPrimitives() LPDIRECT3DDEVICE8 pd3dDevice = SCREEN->GetDevice(); pd3dDevice->SetTexture( 0, m_pTexture->GetD3DTexture() ); - pd3dDevice->SetTextureStageState( 0, D3DTSS_MINFILTER, D3DTEXF_LINEAR ); - pd3dDevice->SetTextureStageState( 0, D3DTSS_MAGFILTER, D3DTEXF_LINEAR ); - //pd3dDevice->SetRenderState( D3DRS_SRCBLEND, bBlendAdd ? D3DBLEND_ONE : D3DBLEND_SRCALPHA ); - //pd3dDevice->SetRenderState( D3DRS_DESTBLEND, bBlendAdd ? D3DBLEND_ONE : D3DBLEND_INVSRCALPHA ); pd3dDevice->SetRenderState( D3DRS_SRCBLEND, m_bBlendAdd ? D3DBLEND_ONE : D3DBLEND_SRCALPHA ); pd3dDevice->SetRenderState( D3DRS_DESTBLEND, m_bBlendAdd ? D3DBLEND_ONE : D3DBLEND_INVSRCALPHA ); diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 2f301a9252..dca0c3b517 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -527,7 +527,6 @@ void Render() LPDIRECT3DDEVICE8 pd3dDevice = SCREEN->GetDevice(); // calculate view and projection transforms - D3DXMATRIX matProj; D3DXMatrixOrthoOffCenterLH( &matProj, 0, 640, 480, 0, -100, 100 ); pd3dDevice->SetTransform( D3DTS_PROJECTION, &matProj ); @@ -536,10 +535,7 @@ void Render() D3DXMatrixIdentity( &matView ); pd3dDevice->SetTransform( D3DTS_VIEW, &matView ); - D3DXMATRIX matWorld; - D3DXMatrixIdentity( &matWorld ); - SCREEN->ResetMatrixStack( matWorld ); - + SCREEN->ResetMatrixStack(); // draw the game WM->Draw(); diff --git a/stepmania/src/StepMania.dsp b/stepmania/src/StepMania.dsp index 1a2f530fba..72556bc2f6 100644 --- a/stepmania/src/StepMania.dsp +++ b/stepmania/src/StepMania.dsp @@ -64,7 +64,7 @@ LINK32=link.exe # PROP BASE Target_Dir "" # PROP Use_MFC 1 # PROP Use_Debug_Libraries 1 -# PROP Output_Dir "../Debug" +# PROP Output_Dir "../" # PROP Intermediate_Dir "../Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" @@ -288,6 +288,10 @@ SOURCE=.\WindowMenuSelectStyle.h # End Source File # Begin Source File +SOURCE=.\WindowMessage.h +# End Source File +# Begin Source File + SOURCE=.\WindowOptions.cpp # End Source File # Begin Source File @@ -604,6 +608,14 @@ SOURCE=.\FocusingSprite.h # End Source File # Begin Source File +SOURCE=.\FootMeter.cpp +# End Source File +# Begin Source File + +SOURCE=.\FootMeter.h +# End Source File +# Begin Source File + SOURCE=.\GhostArrow.cpp # End Source File # Begin Source File @@ -684,14 +696,6 @@ SOURCE=.\Rectangle.h # End Source File # Begin Source File -SOURCE=.\ScoreDisplayFlipping.cpp -# End Source File -# Begin Source File - -SOURCE=.\ScoreDisplayFlipping.h -# End Source File -# Begin Source File - SOURCE=.\ScoreDisplayRolling.cpp # End Source File # Begin Source File diff --git a/stepmania/src/TextBanner.h b/stepmania/src/TextBanner.h index 4c0bb830c8..c3520b215c 100644 --- a/stepmania/src/TextBanner.h +++ b/stepmania/src/TextBanner.h @@ -18,7 +18,7 @@ #include "Rectangle.h" -const float TEXT_BANNER_WIDTH = 192; // from the source art of DDR +const float TEXT_BANNER_WIDTH = 250; const float TEXT_BANNER_HEIGHT = 40; diff --git a/stepmania/src/ThemeManager.cpp b/stepmania/src/ThemeManager.cpp index b90618d237..d2e273d02b 100644 --- a/stepmania/src/ThemeManager.cpp +++ b/stepmania/src/ThemeManager.cpp @@ -71,7 +71,7 @@ CString ThemeManager::GetPathTo( ThemeElement te, CString sThemeName ) case GRAPHIC_SECTION_BACKGROUND: sAssetPath = "Graphics\\section background"; break; case GRAPHIC_MUSIC_SORT_ICONS: sAssetPath = "Graphics\\music sort icons 1x5"; break; case GRAPHIC_MUSIC_STATUS_ICONS: sAssetPath = "Graphics\\music status icons 1x4"; break; - case GRAPHIC_DANGER: sAssetPath = "Graphics\\danger"; break; + case GRAPHIC_DANGER_TEXT: sAssetPath = "Graphics\\danger text"; break; case GRAPHIC_DANGER_BACKGROUND: sAssetPath = "Graphics\\danger background"; break; case SOUND_FAILED: sAssetPath = "Sounds\\failed"; break; diff --git a/stepmania/src/ThemeManager.h b/stepmania/src/ThemeManager.h index adb1c267a2..16981f6260 100644 --- a/stepmania/src/ThemeManager.h +++ b/stepmania/src/ThemeManager.h @@ -61,7 +61,7 @@ enum ThemeElement { GRAPHIC_SECTION_BACKGROUND, GRAPHIC_MUSIC_SORT_ICONS, GRAPHIC_MUSIC_STATUS_ICONS, - GRAPHIC_DANGER, + GRAPHIC_DANGER_TEXT, GRAPHIC_DANGER_BACKGROUND, SOUND_FAILED, diff --git a/stepmania/src/song.h b/stepmania/src/song.h index 811b5d3527..2bbd71ee55 100644 --- a/stepmania/src/song.h +++ b/stepmania/src/song.h @@ -18,9 +18,6 @@ class Steps; // why is this needed? #include "GameInfo.h" // for definition of GameMode enum GameMode; // why is this needed? -#include "Grade.h" - - struct BPMSegment @@ -83,18 +80,18 @@ public: } }; void GetBeatAndBPSFromElapsedTime( float fElapsedTime, float &fBeatOut, float &fBPSOut ); - void GetStepsThatMatchGameMode( GameMode gm, CArray& arrayAddTo ); + void GetStepsThatMatchGameMode( GameMode gm, CArray& arrayAddTo ); void GetNumFeet( GameMode gm, int& iDiffEasy, int& iDiffMedium, int& iDiffHard ); - - -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]; + int GetNumTimesPlayed() + { + int iTotalNumTimesPlayed = 0; + for( int i=0; i