diff options
author | Torbjörn Andersson | 2003-09-09 12:14:08 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2003-09-09 12:14:08 +0000 |
commit | bb5f479a8c11d1189b004f20009508777060e56f (patch) | |
tree | c6946ec295a5803c621cf8e162bf9943e9e654fc /sword2/build_display.cpp | |
parent | 29607a17efcfcd88c76b69c0295e10dc152b0ee1 (diff) | |
download | scummvm-rg350-bb5f479a8c11d1189b004f20009508777060e56f.tar.gz scummvm-rg350-bb5f479a8c11d1189b004f20009508777060e56f.tar.bz2 scummvm-rg350-bb5f479a8c11d1189b004f20009508777060e56f.zip |
Added a WaitForFade() function, to replace numerous while-loops scattered
througout the code.
svn-id: r10127
Diffstat (limited to 'sword2/build_display.cpp')
-rw-r--r-- | sword2/build_display.cpp | 59 |
1 files changed, 5 insertions, 54 deletions
diff --git a/sword2/build_display.cpp b/sword2/build_display.cpp index 6a262c127a..c71deb0829 100644 --- a/sword2/build_display.cpp +++ b/sword2/build_display.cpp @@ -349,22 +349,7 @@ void DisplayMsg(uint8 *text, int time) { // Chris 15May97 if (GetFadeStatus() != RDFADE_BLACK) { FadeDown((float) 0.75); - - do { - //-------------------------------------------------- - // Service windows - while (!gotTheFocus) - if (ServiceWindows() == RDERR_APPCLOSED) - break; - - // if we pressed Ctrl-Q - if (ServiceWindows() == RDERR_APPCLOSED) { - Close_game(); //close engine systems down - CloseAppWindow(); - exit(0); //quit the game - } - //-------------------------------------------------- - } while (GetFadeStatus() == RDFADE_DOWN); + WaitForFade(); } Set_mouse(0); @@ -416,21 +401,7 @@ void DisplayMsg(uint8 *text, int time) { // Chris 15May97 Free_mem(text_spr); - do { - //-------------------------------------------------- - // Service windows - while (!gotTheFocus) - if (ServiceWindows() == RDERR_APPCLOSED) - break; - - // if we pressed Ctrl-Q - if (ServiceWindows() == RDERR_APPCLOSED) { - Close_game(); //close engine systems down - CloseAppWindow(); - exit(0); //quit the game - } - //-------------------------------------------------- - } while (GetFadeStatus() == RDFADE_UP); + WaitForFade(); uint32 targetTime = SVM_timeGetTime() + (time * 1000); @@ -473,22 +444,7 @@ void DisplayMsg(uint8 *text, int time) { // Chris 15May97 void RemoveMsg(void) { // Chris 15May97 FadeDown((float) 0.75); - do { - //-------------------------------------------------- - // Service windows - while (!gotTheFocus) - if (ServiceWindows() == RDERR_APPCLOSED) - break; - - // if we pressed Ctrl-Q - if (ServiceWindows() == RDERR_APPCLOSED) - { - Close_game(); //close engine systems down - CloseAppWindow(); - exit(0); //quit the game - } - //-------------------------------------------------- - } while (GetFadeStatus() == RDFADE_DOWN); + WaitForFade(); EraseBackBuffer(); // for hardware rendering EraseSoftwareScreenBuffer(); // for software rendering @@ -1054,10 +1010,7 @@ void Start_new_palette(void) { //Tony25Sept96 // if the screen is still fading down then wait for black - could // happen when everythings cached into a large memory model - - do { - ServiceWindows(); - } while (GetFadeStatus() == RDFADE_DOWN); + WaitForFade(); // open the screen file screenFile = res_man.Res_open(this_screen.background_layer_id); @@ -1111,9 +1064,7 @@ int32 FN_fade_down(int32 *params) { //Tony5Dec96 } int32 FN_fade_up(int32 *params) { //Chris 15May97 - do { - ServiceWindows(); - } while (GetFadeStatus() == RDFADE_DOWN); + WaitForFade(); if (GetFadeStatus() == RDFADE_BLACK) FadeUp((float) 0.75); |