From b83bf351ce570647d0a90dfcf8d86e426c88c724 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 27 Mar 2003 02:10:20 +0000 Subject: [PATCH] make assist tick a boolean, since it's not mutually exclusive with other assist types --- stepmania/src/ScreenEdit.cpp | 2 +- stepmania/src/ScreenGameplay.cpp | 9 +++------ stepmania/src/ScreenSongOptions.cpp | 8 ++++---- stepmania/src/SongOptions.h | 6 ++---- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index 399cf311b7..088b68d3fc 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -320,7 +320,7 @@ bool ScreenEdit::PlayTicks() const // will start coming out the speaker. Compensate for this by boosting // fPositionSeconds ahead - if( GAMESTATE->m_SongOptions.m_AssistType != SongOptions::ASSIST_TICK ) + if( !GAMESTATE->m_SongOptions.m_bAssistTick ) return false; float fPositionSeconds = GAMESTATE->m_fMusicSeconds; diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 75d1bc4da3..244dae1361 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -900,7 +900,7 @@ void ScreenGameplay::Update( float fDeltaTime ) m_iRowLastCrossed = iRowNow; } - if( GAMESTATE->m_SongOptions.m_AssistType == SongOptions::ASSIST_TICK ) + if( GAMESTATE->m_SongOptions.m_bAssistTick ) if( IsTimeToPlayTicks() ) m_soundAssistTick.Play(); } @@ -978,12 +978,9 @@ void ScreenGameplay::Input( const DeviceInput& DeviceI, const InputEventType typ UpdateAutoPlayText(); break; case SDLK_F7: - if( GAMESTATE->m_SongOptions.m_AssistType == SongOptions::ASSIST_NONE ) - GAMESTATE->m_SongOptions.m_AssistType = SongOptions::ASSIST_TICK; - else - GAMESTATE->m_SongOptions.m_AssistType = SongOptions::ASSIST_NONE; + GAMESTATE->m_SongOptions.m_bAssistTick ^= 1; - m_textDebug.SetText( ssprintf("Assist Tick is %s", GAMESTATE->m_SongOptions.m_AssistType==SongOptions::ASSIST_TICK?"ON":"OFF") ); + m_textDebug.SetText( ssprintf("Assist Tick is %s", GAMESTATE->m_SongOptions.m_bAssistTick?"ON":"OFF") ); m_textDebug.SetDiffuse( RageColor(1,1,1,1) ); m_textDebug.StopTweening(); m_textDebug.BeginTweening( 3 ); // sleep diff --git a/stepmania/src/ScreenSongOptions.cpp b/stepmania/src/ScreenSongOptions.cpp index 95525a486f..fcba818aee 100644 --- a/stepmania/src/ScreenSongOptions.cpp +++ b/stepmania/src/ScreenSongOptions.cpp @@ -36,7 +36,7 @@ OptionRow g_SongOptionsLines[NUM_SONG_OPTIONS_LINES] = { OptionRow( "Bar\nDrain", "NORMAL","NO RECOVER","SUDDEN DEATH" ), OptionRow( "Bat\nLives", "1","2","3","4","5","6","7","8","9","10" ), OptionRow( "Fail", "ARCADE","END OF SONG","OFF" ), - OptionRow( "Assist", "OFF","TICK" ), + OptionRow( "Assist\nTick", "OFF", "ON" ), OptionRow( "Rate", "x0.7","x0.8","x0.9","x1.0","x1.1","x1.2","x1.3","x1.4","x1.5" ), OptionRow( "Auto\nAdjust", "OFF", "ON" ), }; @@ -60,7 +60,7 @@ void ScreenSongOptions::ImportOptions() m_iSelectedOption[0][SO_LIFE] = so.m_LifeType; m_iSelectedOption[0][SO_BAT_LIVES] = so.m_iBatteryLives-1; m_iSelectedOption[0][SO_FAIL] = so.m_FailType; - m_iSelectedOption[0][SO_ASSIST] = so.m_AssistType; + m_iSelectedOption[0][SO_ASSIST] = so.m_bAssistTick; m_iSelectedOption[0][SO_AUTOSYNC] = so.m_bAutoSync; if( so.m_fMusicRate == 0.7f ) m_iSelectedOption[0][SO_RATE] = 0; @@ -83,8 +83,8 @@ void ScreenSongOptions::ExportOptions() so.m_DrainType = (SongOptions::DrainType)m_iSelectedOption[0][SO_DRAIN]; so.m_iBatteryLives = m_iSelectedOption[0][SO_BAT_LIVES]+1; so.m_FailType = (SongOptions::FailType)m_iSelectedOption[0][SO_FAIL]; - so.m_AssistType = (SongOptions::AssistType)m_iSelectedOption[0][SO_ASSIST]; - so.m_bAutoSync = m_iSelectedOption[0][SO_AUTOSYNC] != 0; + so.m_bAssistTick = !!m_iSelectedOption[0][SO_ASSIST]; + so.m_bAutoSync = !!m_iSelectedOption[0][SO_AUTOSYNC]; switch( m_iSelectedOption[0][SO_RATE] ) { diff --git a/stepmania/src/SongOptions.h b/stepmania/src/SongOptions.h index 1bde170a69..df449f896c 100644 --- a/stepmania/src/SongOptions.h +++ b/stepmania/src/SongOptions.h @@ -22,10 +22,8 @@ struct SongOptions int m_iBatteryLives; enum FailType { FAIL_ARCADE=0, FAIL_END_OF_SONG, FAIL_OFF }; FailType m_FailType; - enum AssistType { ASSIST_NONE=0, ASSIST_TICK }; - AssistType m_AssistType; float m_fMusicRate; - bool m_bAutoSync; + bool m_bAssistTick, m_bAutoSync; SongOptions() { Init(); }; void Init() @@ -34,7 +32,7 @@ struct SongOptions m_DrainType = DRAIN_NORMAL; m_iBatteryLives = 4; m_FailType = FAIL_ARCADE; - m_AssistType = ASSIST_NONE; + m_bAssistTick = false; m_fMusicRate = 1.0f; m_bAutoSync = false; };