From 2bf13a89f0db0bec7038e463a2f0f1f60e813ce4 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 6 May 2004 09:06:24 +0000 Subject: [PATCH] move exception dialog behavior to HandleException --- stepmania/src/StepMania.cpp | 14 +++++++++----- stepmania/src/StepMania.h | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 399d6190ba..508435b94c 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -178,6 +178,14 @@ void ApplyGraphicOptions() INPUTMAN->WindowReset(); } +void HandleException( CString error ) +{ + if( g_bAutoRestart ) + HOOKS->RestartProgram(); + + HOOKS->MessageBoxError( error ); // throw up a pretty error dialog +} + void ExitGame() { g_bQuitting = true; @@ -1170,11 +1178,7 @@ int main(int argc, char* argv[]) #endif if( g_sErrorString != "" ) - { - if( g_bAutoRestart ) - HOOKS->RestartProgram(); - HOOKS->MessageBoxError( g_sErrorString ); // throw up a pretty error dialog - } + HandleException( g_sErrorString ); SAFE_DELETE( HOOKS ); diff --git a/stepmania/src/StepMania.h b/stepmania/src/StepMania.h index 7dde4a4ea7..2cdde25fdb 100644 --- a/stepmania/src/StepMania.h +++ b/stepmania/src/StepMania.h @@ -15,6 +15,7 @@ int SMmain(int argc, char* argv[]); void ApplyGraphicOptions(); +void HandleException( CString error ); void ExitGame(); void ResetGame( bool ReturnToFirstScreen=true ); void ReadGamePrefsFromDisk( bool bSwitchToLastPlayedGame=true );