diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index 4e7f7c72dc..191c4a7ff6 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -11,9 +11,6 @@ ________________________________________________________________________________ 2016/06/24 ---------- -* [Gameplay] Added UsePauseMenuInsteadOfGiveUp theme metric. If this metric - is true, Select, Back, and Start cannot be held to exit a song. This is - for themes that provide a pause menu for these choices. [kyzentun] * [SelectMusic] Added AllowHoldForOptions preference to disable holding start to go to the player options screen. [kyzentun] * [General] Back button will only back out of the screen on a press, not when diff --git a/Docs/Themerdocs/pause_menu.md b/Docs/Themerdocs/pause_menu.md index 8ced1c7b86..f1f54ad271 100644 --- a/Docs/Themerdocs/pause_menu.md +++ b/Docs/Themerdocs/pause_menu.md @@ -29,10 +29,21 @@ Pressing MenuLeft and MenuRight at the same time is another way to pause. # Theme Logic -### Metric -Set the ScreenGameplay::UsePauseMenuInsteadOfGiveUp theme metric to true to -disable the normal backing out logic. Then it won't interfere with using the -pause menu. +### Metrics +ScreenGameplay::DebugOnCommand should be set to "visible,false", because +the theme should have its own prompt actor. + +Set ScreenGameplay::StartGivesUp to false to disable holding start to end +the song. + +Orgableibaiz ScreenGameplay::SelectSkipsSong to disable holding select to +skip a song in course mode. +``` +DebugOnCommand=visible,false +StartGivesUp=false +UnpauseWithStart=false +SelectSkipsSong=false +``` ## Overview diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index 688f731aab..66bdb563a4 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -3465,7 +3465,6 @@ PlayerInitCommand=y,SCREEN_CENTER_Y;zoom,(THEME:GetMetric("Common","ScreenHeight StartGivesUp=true BackGivesUp=false GiveUpSeconds=2.5 -UsePauseMenuInsteadOfGiveUp=false # rage AllowCenter1Player=true # diff --git a/Themes/default/metrics.ini b/Themes/default/metrics.ini index 0a93b9cc94..054316f8f8 100644 --- a/Themes/default/metrics.ini +++ b/Themes/default/metrics.ini @@ -1610,8 +1610,10 @@ ActiveAttackListP2OffCommand= # # Disable the normal start and select button actions to enable a custom pause # menu -UsePauseMenuInsteadOfGiveUp=true +DebugOnCommand=visible,false +StartGivesUp=false UnpauseWithStart=false +SelectSkipsSong=false StopCourseEarly=check_stop_course_early() [ScreenGameplayShared] diff --git a/src/RageSurface_Load_PNG.cpp b/src/RageSurface_Load_PNG.cpp index 71f893b67a..aa4ab5f47f 100644 --- a/src/RageSurface_Load_PNG.cpp +++ b/src/RageSurface_Load_PNG.cpp @@ -50,10 +50,7 @@ void PNG_Error( png_struct *png, const char *error ) strncpy( info->err, error, 1024 ); info->err[1023] = 0; LOG->Trace( "loading \"%s\": err: %s", info->fn, info->err ); - // This exception is just thrown to go to the catch block for cleanup. The - // message has already been printed, so the exception value can be ignored. - // -Kyz - throw int(1); + longjmp( png_jmpbuf(png), 1 ); } void PNG_Warning( png_struct *png, const char *warning ) @@ -92,8 +89,20 @@ static RageSurface *RageSurface_Load_PNG( RageFile *f, const char *fn, char erro CHECKPOINT_M("Potential issue with png jump about to be analyzed."); png_byte** row_pointers= NULL; - try + + // Throwing an exception in the error callback would make the exception + // pass through C code, which is undefined behavior. Works fine on Linux, + // and on OS X with C++11, but does not work on OS X without C++11. -Kyz + if(setjmp(png_jmpbuf(png))) { + png_destroy_read_struct(&png, &info_ptr, NULL); + delete img; + if(row_pointers != NULL) + { + delete[] row_pointers; + } + return NULL; + } png_set_read_fn( png, f, RageFile_png_read ); @@ -241,17 +250,6 @@ static RageSurface *RageSurface_Load_PNG( RageFile *f, const char *fn, char erro png_read_end( png, info_ptr ); png_destroy_read_struct( &png, &info_ptr, NULL ); - } - catch(int e) - { - png_destroy_read_struct(&png, &info_ptr, NULL); - delete img; - if(row_pointers != NULL) - { - delete[] row_pointers; - } - return NULL; - } return img; } diff --git a/src/ScreenGameplay.cpp b/src/ScreenGameplay.cpp index 91adcc9aef..1801468b5f 100644 --- a/src/ScreenGameplay.cpp +++ b/src/ScreenGameplay.cpp @@ -67,7 +67,6 @@ #define SHOW_SCORE_IN_RAVE THEME->GetMetricB(m_sName,"ShowScoreInRave") #define SONG_POSITION_METER_WIDTH THEME->GetMetricF(m_sName,"SongPositionMeterWidth") #define STOP_COURSE_EARLY THEME->GetMetricB(m_sName,"StopCourseEarly") // evaluate this every time it's used -#define USE_PAUSE_MENU_INSTEAD_OF_GIVE_UP THEME->GetMetricB(m_sName, "UsePauseMenuInsteadOfGiveUp") static ThemeMetric INITIAL_BACKGROUND_BRIGHTNESS ("ScreenGameplay","InitialBackgroundBrightness"); static ThemeMetric SECONDS_BETWEEN_COMMENTS ("ScreenGameplay","SecondsBetweenComments"); @@ -1937,12 +1936,9 @@ void ScreenGameplay::Update( float fDeltaTime ) // update give up bool bGiveUpTimerFired = false; - if(!USE_PAUSE_MENU_INSTEAD_OF_GIVE_UP) - { - bGiveUpTimerFired= !m_GiveUpTimer.IsZero() && m_GiveUpTimer.Ago() > GIVE_UP_SECONDS; - m_gave_up= bGiveUpTimerFired; - m_skipped_song= !m_SkipSongTimer.IsZero() && m_SkipSongTimer.Ago() > GIVE_UP_SECONDS; - } + bGiveUpTimerFired= !m_GiveUpTimer.IsZero() && m_GiveUpTimer.Ago() > GIVE_UP_SECONDS; + m_gave_up= bGiveUpTimerFired; + m_skipped_song= !m_SkipSongTimer.IsZero() && m_SkipSongTimer.Ago() > GIVE_UP_SECONDS; bool bAllHumanHaveBigMissCombo = true; @@ -2451,7 +2447,7 @@ bool ScreenGameplay::Input( const InputEventPlus &input ) return false; } - if(!USE_PAUSE_MENU_INSTEAD_OF_GIVE_UP && m_DancingState != STATE_OUTRO && + if(m_DancingState != STATE_OUTRO && GAMESTATE->IsHumanPlayer(input.pn) && !m_Cancel.IsTransitioning() ) {