From 769dac616f0a4e8d18356fe7e8cd6efeab7de4b2 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 9 Mar 2003 01:31:15 +0000 Subject: [PATCH] fix compile errors --- stepmania/src/LyricsLoader.cpp | 4 +- stepmania/src/ScreenGameplay.h | 3 +- stepmania/src/ScreenSelectDifficultyEX.cpp | 42 +- stepmania/src/ScreenSelectMaxType2EX.cpp | 475 --------------------- stepmania/src/ScreenSelectMaxType2EX.h | 84 ---- stepmania/src/StepMania.vcproj | 36 +- 6 files changed, 51 insertions(+), 593 deletions(-) delete mode 100644 stepmania/src/ScreenSelectMaxType2EX.cpp delete mode 100644 stepmania/src/ScreenSelectMaxType2EX.h diff --git a/stepmania/src/LyricsLoader.cpp b/stepmania/src/LyricsLoader.cpp index adca5c2548..091458e30e 100644 --- a/stepmania/src/LyricsLoader.cpp +++ b/stepmania/src/LyricsLoader.cpp @@ -23,7 +23,7 @@ bool LyricsLoader::LoadFromLRCFile( CString sPath, Song &out ) if( !bResult ) RageException::Throw( "Error opening file '%s' for reading.", sPath.GetString() ); - unsigned iLineCount = 0; + // unsigned iLineCount = 0; // hush "variable not referenced" for( unsigned i=0; iGetMetricF("ScreenSelectDifficultyEX",ssprintf("CursorOffsetP%dX",p+1)) #define CURSOR_OFFSET_EX_Y( i ) THEME->GetMetricF("ScreenSelectDifficultyEX",ssprintf("CursorOffsetP%dY",i+1)) #define INITIAL_CHOICE THEME->GetMetricI("ScreenSelectDifficultyEX","InitialChoice") -#define HELP_TEXT THEME->GetMetric ("ScreenSelectDifficultyEX","HelpText") +#define HELP_TEXT THEME->GetMetric("ScreenSelectDifficultyEX","HelpText") #define TIMER_SECONDS THEME->GetMetricI("ScreenSelectDifficultyEX","TimerSeconds") -#define NEXT_SCREEN_ARCADE THEME->GetMetric ("ScreenSelectDifficultyEX","NextScreenArcade") -#define NEXT_SCREEN_ONI THEME->GetMetric ("ScreenSelectDifficultyEX","NextScreenOni") -#define NEXT_SCREEN_BATTLE THEME->GetMetric ("ScreenSelectDifficultyEX","NextScreenBattle") +#define NEXT_SCREEN_ARCADE THEME->GetMetric("ScreenSelectDifficultyEX","NextScreenArcade") +#define NEXT_SCREEN_ONI THEME->GetMetric("ScreenSelectDifficultyEX","NextScreenOni") +#define NEXT_SCREEN_BATTLE THEME->GetMetric("ScreenSelectDifficultyEX","NextScreenBattle") const CString CHOICE_TEXT[ScreenSelectDifficultyEX::NUM_CHOICES_EX] = @@ -54,6 +54,8 @@ float CURSOR_EX_X( int p ) { return DIFFICULTY_X(p) + CURSOR_OFFSET_EX_X(p); } float CURSOR_EX_Y( int p ) { return DIFFICULTY_Y(p) + CURSOR_OFFSET_EX_Y(p); } +const ScreenMessage SM_StartTweeningOffScreen = ScreenMessage(SM_User + 3); +const ScreenMessage SM_StartFadingOut = ScreenMessage(SM_User + 4); ScreenSelectDifficultyEX::ScreenSelectDifficultyEX() @@ -64,15 +66,15 @@ ScreenSelectDifficultyEX::ScreenSelectDifficultyEX() GAMESTATE->m_PlayMode = PLAY_MODE_INVALID; - m_Menu.Load( "SelectDifficultyEx" ); + m_Menu.Load("ScreenSelectDifficultyEx"); this->AddChild( &m_Menu ); for( unsigned c=0; cIsPlayerEnabled(c) == true ) { - CString sHeaderFile = ssprintf( "SelectDifficultyEx header %s", CHOICE_TEXT[INITIAL_CHOICE].c_str() ); - CString sPictureFile = ssprintf( "SelectDifficultyEx picture %s", CHOICE_TEXT[INITIAL_CHOICE].c_str() ); + CString sHeaderFile = ssprintf( "select difficulty ex header %s", CHOICE_TEXT[INITIAL_CHOICE].c_str() ); + CString sPictureFile = ssprintf( "select difficulty ex picture %s", CHOICE_TEXT[INITIAL_CHOICE].c_str() ); m_sprPicture[c].Load( THEME->GetPathTo("Graphics",sPictureFile) ); m_sprPicture[c].SetVertAlign( align_top ); @@ -95,14 +97,14 @@ ScreenSelectDifficultyEX::ScreenSelectDifficultyEX() if( !GAMESTATE->IsPlayerEnabled((PlayerNumber)p) ) continue; - m_sprCursor[p].Load( THEME->GetPathTo("Graphics", "SelectDifficultyEx cursor 2x1") ); + m_sprCursor[p].Load( THEME->GetPathTo("Graphics", "select difficulty ex cursor 2x1") ); m_sprCursor[p].SetXY( -1600, -1600 ); m_sprCursor[p].StopAnimating(); m_sprCursor[p].SetState( p ); m_sprCursor[p].EnableShadow( false ); m_framePages.AddChild( &m_sprCursor[p] ); - m_sprOK[p].Load( THEME->GetPathTo("Graphics", "SelectDifficultyEx ok 2x1") ); + m_sprOK[p].Load( THEME->GetPathTo("Graphics", "select difficulty ex ok 2x1") ); m_sprOK[p].SetState( p ); m_sprOK[p].StopAnimating(); m_sprOK[p].SetDiffuse( RageColor(1,1,1,0) ); @@ -111,15 +113,15 @@ ScreenSelectDifficultyEX::ScreenSelectDifficultyEX() this->AddChild( &m_framePages ); - m_soundChange.Load( THEME->GetPathTo("Sounds", "SelectDifficultyEx change") ); - m_soundSelect.Load( THEME->GetPathTo("Sounds", "Common start") ); + m_soundChange.Load( THEME->GetPathTo("Sounds", "select difficulty change") ); + m_soundSelect.Load( THEME->GetPathTo("Sounds", "menu start") ); m_soundDifficult.Load( ANNOUNCER->GetPathTo("select difficulty challenge") ); SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("select difficulty intro") ); TweenOnScreen(); - SOUNDMAN->PlayMusic( THEME->GetPathTo("Sounds","SelectDifficultyEx music") ); + SOUNDMAN->PlayMusic( THEME->GetPathTo("Sounds","select difficulty music") ); m_fLockInputTime = LOCK_INPUT_TIME; } @@ -211,6 +213,13 @@ void ScreenSelectDifficultyEX::HandleScreenMessage( const ScreenMessage SM ) default: ASSERT(0); } + break; + case SM_StartTweeningOffScreen: + TweenOffScreen(); + this->SendScreenMessage( SM_StartFadingOut, 0.8f ); + break; + case SM_StartFadingOut: + m_Menu.StartTransitioning( SM_GoToNextScreen ); break; } } @@ -396,15 +405,12 @@ void ScreenSelectDifficultyEX::MenuStart( PlayerNumber pn ) // check to see if everyone has chosen - bool bAllChosen = true; for( int p=0; pIsPlayerEnabled((PlayerNumber)p) ) - bAllChosen &= m_bChosen[p]; + if( GAMESTATE->IsPlayerEnabled((PlayerNumber)p) && m_bChosen[p] == false ) + return; } - - if( bAllChosen ) - m_Menu.StartTransitioning( SM_GoToNextScreen ); + this->SendScreenMessage( SM_StartTweeningOffScreen, 0.7f ); } void ScreenSelectDifficultyEX::ShowSelected( PlayerNumber pv ) diff --git a/stepmania/src/ScreenSelectMaxType2EX.cpp b/stepmania/src/ScreenSelectMaxType2EX.cpp deleted file mode 100644 index c301f35e2a..0000000000 --- a/stepmania/src/ScreenSelectMaxType2EX.cpp +++ /dev/null @@ -1,475 +0,0 @@ -#include "global.h" -/* ------------------------------------------------------------------------------ - Class: ScreenSelectMaxType2EX - - Desc: Difficulty select style from DDR Extreme - - Copyright (c) 2001-2003 by the person(s) listed below. All rights reserved. - Chris Danford - Kevin Slaughter ------------------------------------------------------------------------------ -*/ - -#include "ScreenSelectMaxType2EX.h" -#include "ScreenManager.h" -#include "PrefsManager.h" -#include "GameManager.h" -#include "RageLog.h" -#include "GameConstantsAndTypes.h" -#include "AnnouncerManager.h" -#include "GameState.h" -#include "RageSoundManager.h" -#include "ThemeManager.h" - - -const float LOCK_INPUT_TIME = 0.30f; // lock input while waiting for tweening to complete - -#define DIFFICULTY_X( d ) THEME->GetMetricF("ScreenSelectMaxType2EX",ssprintf("DifficultyP%dX",d+1)) -#define DIFFICULTY_Y( e ) THEME->GetMetricF("ScreenSelectMaxType2EX",ssprintf("DifficultyP%dY",e+1)) -#define CURSOR_OFFSET_EX_X( p ) THEME->GetMetricF("ScreenSelectMaxType2EX",ssprintf("CursorOffsetP%dX",p+1)) -#define CURSOR_OFFSET_EX_Y( i ) THEME->GetMetricF("ScreenSelectMaxType2EX",ssprintf("CursorOffsetP%dY",i+1)) -#define INITIAL_CHOICE THEME->GetMetricI("ScreenSelectMaxType2EX","InitialChoice") -#define HELP_TEXT THEME->GetMetric("ScreenSelectMaxType2EX","HelpText") -#define TIMER_SECONDS THEME->GetMetricI("ScreenSelectMaxType2EX","TimerSeconds") -#define NEXT_SCREEN_ARCADE THEME->GetMetric("ScreenSelectMaxType2EX","NextScreenArcade") -#define NEXT_SCREEN_ONI THEME->GetMetric("ScreenSelectMaxType2EX","NextScreenOni") -#define NEXT_SCREEN_BATTLE THEME->GetMetric("ScreenSelectMaxType2EX","NextScreenBattle") - - -const CString CHOICE_TEXT[ScreenSelectMaxType2EX::NUM_CHOICES_EX] = -{ - "beginner", - "easy", - "medium", - "hard", - "nonstop", - "oni", - "endless"/*, - "battle"*/ -}; - - -float CURSOR_EX_X( int p ) { return DIFFICULTY_X(p) + CURSOR_OFFSET_EX_X(p); } -float CURSOR_EX_Y( int p ) { return DIFFICULTY_Y(p) + CURSOR_OFFSET_EX_Y(p); } - - -const ScreenMessage SM_StartTweeningOffScreen = ScreenMessage(SM_User + 3); -const ScreenMessage SM_StartFadingOut = ScreenMessage(SM_User + 4); - - -ScreenSelectMaxType2EX::ScreenSelectMaxType2EX() -{ - LOG->Trace( "ScreenSelectMaxType2EX::ScreenSelectMaxType2EX()" ); - - // Reset the current PlayMode - GAMESTATE->m_PlayMode = PLAY_MODE_INVALID; - - - m_Menu.Load( - THEME->GetPathTo("BGAnimations","select difficulty ex"), - THEME->GetPathTo("Graphics","select difficulty ex top edge"), - HELP_TEXT, true, true, TIMER_SECONDS - ); - this->AddChild( &m_Menu ); - - for( unsigned c=0; cIsPlayerEnabled(c) == true ) - { - CString sHeaderFile = ssprintf( "select difficulty ex header %s", CHOICE_TEXT[INITIAL_CHOICE].c_str() ); - CString sPictureFile = ssprintf( "select difficulty ex picture %s", CHOICE_TEXT[INITIAL_CHOICE].c_str() ); - - m_sprPicture[c].Load( THEME->GetPathTo("Graphics",sPictureFile) ); - m_sprPicture[c].SetVertAlign( align_top ); - m_framePages.AddChild( &m_sprPicture[c] ); - - - m_sprHeader[c].Load( THEME->GetPathTo("Graphics",sHeaderFile) ); - m_sprHeader[c].SetXY( DIFFICULTY_X(c), DIFFICULTY_Y(c) ); - m_sprHeader[c].SetVertAlign( align_bottom ); - m_framePages.AddChild( &m_sprHeader[c] ); - } - } - - for( unsigned p=0; pIsPlayerEnabled((PlayerNumber)p) ) - continue; - - m_sprCursor[p].Load( THEME->GetPathTo("Graphics", "select difficulty ex cursor 2x1") ); - m_sprCursor[p].SetXY( -1600, -1600 ); - m_sprCursor[p].StopAnimating(); - m_sprCursor[p].SetState( p ); - m_sprCursor[p].EnableShadow( false ); - m_framePages.AddChild( &m_sprCursor[p] ); - - m_sprOK[p].Load( THEME->GetPathTo("Graphics", "select difficulty ex ok 2x1") ); - m_sprOK[p].SetState( p ); - m_sprOK[p].StopAnimating(); - m_sprOK[p].SetDiffuse( RageColor(1,1,1,0) ); - m_framePages.AddChild( &m_sprOK[p] ); - } - - this->AddChild( &m_framePages ); - - m_soundChange.Load( THEME->GetPathTo("Sounds", "select difficulty change") ); - m_soundSelect.Load( THEME->GetPathTo("Sounds", "menu start") ); - m_soundDifficult.Load( ANNOUNCER->GetPathTo("select difficulty challenge") ); - - SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("select difficulty intro") ); - - m_Menu.TweenOnScreenFromMenu( SM_None ); - TweenOnScreen(); - - SOUNDMAN->PlayMusic( THEME->GetPathTo("Sounds","select difficulty music") ); - - m_fLockInputTime = LOCK_INPUT_TIME; -} - - -ScreenSelectMaxType2EX::~ScreenSelectMaxType2EX() -{ - LOG->Trace( "ScreenSelectMaxType2EX::~ScreenSelectMaxType2EX()" ); -} - - -void ScreenSelectMaxType2EX::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI ) -{ - LOG->Trace( "ScreenSelectMaxType2EX::Input()" ); - - if( m_Menu.IsClosing() ) - return; - - if( m_fLockInputTime > 0 ) - return; - - Screen::Input( DeviceI, type, GameI, MenuI, StyleI ); // default input handler -} - -void ScreenSelectMaxType2EX::Update( float fDeltaTime ) -{ - Screen::Update( fDeltaTime ); - m_fLockInputTime = max( m_fLockInputTime-fDeltaTime, 0 ); -} - -void ScreenSelectMaxType2EX::DrawPrimitives() -{ - m_Menu.DrawBottomLayer(); - Screen::DrawPrimitives(); - m_Menu.DrawTopLayer(); -} - -void ScreenSelectMaxType2EX::HandleScreenMessage( const ScreenMessage SM ) -{ - int p; - - switch( SM ) - { - case SM_MenuTimer: - for( p=0; pIsPlayerEnabled(p) ) - MenuStart( (PlayerNumber)p ); - break; - case SM_GoToPrevScreen: - SCREENMAN->SetNewScreen( "ScreenTitleMenu" ); - break; - case SM_GoToNextScreen: - for( p=0; pm_PreferredDifficulty[p] = DIFFICULTY_BEGINNER; break; - case CHOICE_EX_EASY: GAMESTATE->m_PreferredDifficulty[p] = DIFFICULTY_EASY; break; - case CHOICE_EX_NONSTOP: // need to set preferred difficulty even for courses - //case CHOICE_EX_BATTLE: - case CHOICE_EX_ONI: - case CHOICE_EX_ENDLESS: - case CHOICE_EX_MEDIUM: GAMESTATE->m_PreferredDifficulty[p] = DIFFICULTY_MEDIUM; break; - case CHOICE_EX_HARD: GAMESTATE->m_PreferredDifficulty[p] = DIFFICULTY_HARD; break; - default: ASSERT(0); - } - } - - switch( m_Choice[GAMESTATE->m_MasterPlayerNumber] ) - { - case CHOICE_EX_BEGINNER: - case CHOICE_EX_EASY: - case CHOICE_EX_MEDIUM: - case CHOICE_EX_HARD: GAMESTATE->m_PlayMode = PLAY_MODE_ARCADE; break; - case CHOICE_EX_NONSTOP: GAMESTATE->m_PlayMode = PLAY_MODE_NONSTOP; break; - case CHOICE_EX_ONI: GAMESTATE->m_PlayMode = PLAY_MODE_ONI; break; - case CHOICE_EX_ENDLESS: GAMESTATE->m_PlayMode = PLAY_MODE_ENDLESS; break; - //case CHOICE_EX_BATTLE: GAMESTATE->m_PlayMode = PLAY_MODE_BATTLE; break; - default: ASSERT(0); // bad selection - } - - switch( GAMESTATE->m_PlayMode ) - { - case PLAY_MODE_ARCADE: SCREENMAN->SetNewScreen( NEXT_SCREEN_ARCADE ); break; - case PLAY_MODE_NONSTOP: - case PLAY_MODE_ONI: - case PLAY_MODE_ENDLESS: SCREENMAN->SetNewScreen( NEXT_SCREEN_ONI ); break; - case PLAY_MODE_BATTLE: SCREENMAN->SetNewScreen( NEXT_SCREEN_BATTLE); break; - default: ASSERT(0); - } - - break; - case SM_StartTweeningOffScreen: - TweenOffScreen(); - this->SendScreenMessage( SM_StartFadingOut, 0.8f ); - break; - case SM_StartFadingOut: - m_Menu.TweenOffScreenToMenu( SM_GoToNextScreen ); - break; - } -} - -void ScreenSelectMaxType2EX::MenuLeft( PlayerNumber pn ) -{ - if( m_Choice[pn] == 0 ) // can't go left any more - return; - if( m_bChosen[pn] ) - return; - - ChangeTo( pn, m_Choice[pn], m_Choice[pn]-1 ); -} - - -void ScreenSelectMaxType2EX::MenuRight( PlayerNumber pn ) -{ - if( m_Choice[pn] == NUM_CHOICES_EX-1 ) // can't go right any more - return; - if( m_bChosen[pn] ) - return; - - ChangeTo( pn, m_Choice[pn], m_Choice[pn]+1 ); -} - -bool ScreenSelectMaxType2EX::AnyPlayerIsOnCourse() -{ - int pl; - for( pl=0; plIsPlayerEnabled(p) && m_bChosen[p] ) - { - bSomeoneMadeAChoice = true; - } - } - - // change only the player who pressed the button - m_Choice[pn] = (ChoiceEx)iNewChoice; - - if( bSomeoneMadeAChoice && AnyPlayerIsOnCourse() ) - { - m_Choice[pn] = (ChoiceEx)iOldChoice; // Put it back on the old difficulty - return; // don't allow changing to courses after one player has chosen - } - - if( PlayerIsOnCourse(pn) ) // If one player is on a course, all are on the same one - { - for( unsigned f=0; fGetPathTo("Graphics",sPictureFile) ); - - sPictureFile = ssprintf( "select difficulty ex header %s", CHOICE_TEXT[m_Choice[p]].c_str() ); - m_sprHeader[p].Load( THEME->GetPathTo("Graphics",sPictureFile) ); - - - if( AnyPlayerIsOnCourse() == true || bOtherWasOnCourse == true ) - { - if( m_Choice[p] == CHOICE_EX_NONSTOP && iOldChoice != CHOICE_EX_ONI || m_Choice[p] == CHOICE_EX_HARD && iOldChoice != CHOICE_EX_MEDIUM ) - { - /* See above.. This executes on the same conditions. Those conditions - should --NOT-- have changed by this time */ - m_sprPicture[p].BeginTweening( 0.3f, TWEEN_BOUNCE_END ); - m_sprPicture[p].SetTweenZoomY( 1 ); - - m_sprHeader[p].BeginTweening( 0.3f, TWEEN_BOUNCE_END ); - m_sprHeader[p].SetTweenZoomY( 1 ); - } - } - } - - m_soundChange.Play(); -} - -void ScreenSelectMaxType2EX::MenuStart( PlayerNumber pn ) -{ - bool bOKAllPlayers = false; // This keeps OK from being displayed again, if the player has already chosen - if( m_bChosen[pn] == true ) - return; - - if( AnyPlayerIsOnCourse() == true ) // If a course is selected, all players get the same thing - { - for( int p=0; pPlayOnceFromDir( ANNOUNCER->GetPathTo("select difficulty comment beginner") ); break; - case 1: SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("select difficulty comment easy") ); break; - case 2: SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("select difficulty comment medium") ); break; - case 3: SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("select difficulty comment hard") ); break; - case 4: SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("select difficulty comment nonstop") ); break; - case 5: SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("select difficulty comment oni") ); break; - case 6: SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("select difficulty comment endless") ); break; - } - if( bOKAllPlayers == true ) // Show OK Icon - { - for( unsigned pk=0; pkIsPlayerEnabled((PlayerNumber)p) && m_bChosen[p] == false ) - return; - } - m_Menu.StopTimer(); - this->SendScreenMessage( SM_StartTweeningOffScreen, 0.7f ); -} - -void ScreenSelectMaxType2EX::ShowSelected( PlayerNumber pv ) -{ - //Roll up in pic corner - m_sprCursor[pv].SetXY( CURSOR_EX_X(pv), CURSOR_EX_Y(pv) ); - m_sprCursor[pv].BeginTweening( 0.2f ); - m_sprCursor[pv].BeginTweening( 0.2f ); - - m_sprOK[pv].SetXY( CURSOR_EX_X(pv), CURSOR_EX_Y(pv) ); - m_sprCursor[pv].FadeOn( 0, "foldy bounce", 0.3f ); - - m_sprOK[pv].SetDiffuse( RageColor(1,1,1,1) ); - m_sprOK[pv].SetZoom( 1 ); - m_sprOK[pv].FadeOn( 0, "foldy bounce", 0.3f ); -} - -void ScreenSelectMaxType2EX::MenuBack( PlayerNumber pn ) -{ - m_Menu.TweenOffScreenToBlack( SM_GoToPrevScreen, true ); -} - -void ScreenSelectMaxType2EX::TweenOffScreen() -{ - unsigned p; - - for( p=0; p < m_SubActors.size(); p++ ) - m_SubActors[p]->StopTweening(); - - for( p=0; pIsPlayerEnabled((PlayerNumber)p) ) - continue; - - m_sprCursor[p].FadeOff( 0, "fade", 0.3f ); - m_sprOK[p].FadeOff( 0, "fade", 0.3f ); - } - - for( unsigned c=0; c + + + + + + + + @@ -1046,6 +1058,12 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ + + + + @@ -1064,12 +1082,6 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ - - - - @@ -1124,12 +1136,6 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ - - - - @@ -1208,6 +1214,12 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ + + + +