From 6ca905ef9d7dc8f7fb7789fd82bd03c87c6fb8bd Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 14 Feb 2003 06:31:09 +0000 Subject: [PATCH] use SDL_Delay to sleep --- stepmania/src/ScreenDemonstration.cpp | 5 +++-- stepmania/src/ScreenJukebox.cpp | 5 +++-- stepmania/src/Sprite.cpp | 3 ++- stepmania/src/StepMania.cpp | 7 +++---- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/stepmania/src/ScreenDemonstration.cpp b/stepmania/src/ScreenDemonstration.cpp index 6774d5ef8d..2c67fe9ff0 100644 --- a/stepmania/src/ScreenDemonstration.cpp +++ b/stepmania/src/ScreenDemonstration.cpp @@ -16,6 +16,7 @@ #include "GameState.h" #include "SongManager.h" #include "StepMania.h" +#include "SDL_utils.h" #define SECONDS_TO_SHOW THEME->GetMetricF("ScreenDemonstration","SecondsToShow") @@ -212,7 +213,7 @@ void ScreenDemonstration::Input( const DeviceInput& DeviceI, const InputEventTyp case MENU_BUTTON_COIN: Screen::MenuCoin( MenuI.player ); // increment coins, play sound m_soundMusic.Stop(); - ::Sleep( 800 ); // do a little pause, like the arcade does + SDL_Delay( 800 ); // do a little pause, like the arcade does SCREENMAN->SetNewScreen( "ScreenTitleMenu" ); break; case MENU_BUTTON_START: @@ -228,7 +229,7 @@ void ScreenDemonstration::Input( const DeviceInput& DeviceI, const InputEventTyp case PrefsManager::COIN_HOME: m_soundMusic.Stop(); SOUNDMAN->PlayOnce( THEME->GetPathTo("Sounds","insert coin") ); - ::Sleep( 800 ); // do a little pause, like the arcade does + SDL_Delay( 800 ); // do a little pause, like the arcade does SCREENMAN->SetNewScreen( "ScreenTitleMenu" ); break; default: diff --git a/stepmania/src/ScreenJukebox.cpp b/stepmania/src/ScreenJukebox.cpp index 2a4f4a9029..606b1d5f29 100644 --- a/stepmania/src/ScreenJukebox.cpp +++ b/stepmania/src/ScreenJukebox.cpp @@ -16,6 +16,7 @@ #include "GameState.h" #include "SongManager.h" #include "StepMania.h" +#include "SDL_utils.h" @@ -194,7 +195,7 @@ void ScreenJukebox::Input( const DeviceInput& DeviceI, const InputEventType type case MENU_BUTTON_COIN: Screen::MenuCoin( MenuI.player ); // increment coins, play sound m_soundMusic.Stop(); - ::Sleep( 800 ); // do a little pause, like the arcade does + SDL_Delay( 800 ); // do a little pause, like the arcade does SCREENMAN->SetNewScreen( "ScreenTitleMenu" ); break; case MENU_BUTTON_START: @@ -210,7 +211,7 @@ void ScreenJukebox::Input( const DeviceInput& DeviceI, const InputEventType type case PrefsManager::COIN_HOME: m_soundMusic.Stop(); SOUNDMAN->PlayOnce( THEME->GetPathTo("Sounds","insert coin") ); - ::Sleep( 800 ); // do a little pause, like the arcade does + SDL_Delay( 800 ); // do a little pause, like the arcade does SCREENMAN->SetNewScreen( "ScreenTitleMenu" ); break; default: diff --git a/stepmania/src/Sprite.cpp b/stepmania/src/Sprite.cpp index d1a73c37ee..2a3d5ec116 100644 --- a/stepmania/src/Sprite.cpp +++ b/stepmania/src/Sprite.cpp @@ -21,6 +21,7 @@ #include "PrefsManager.h" #include "RageDisplay.h" #include "GameConstantsAndTypes.h" +#include "SDL_utils.h" #include "RageDisplayInternal.h" @@ -190,7 +191,7 @@ void Sprite::DrawPrimitives() return; if( m_pTexture && m_pTexture->IsAMovie() && m_pTexture->IsPlaying() ) - ::Sleep( PREFSMAN->m_iMovieDecodeMS ); // let the movie decode a frame + SDL_Delay( PREFSMAN->m_iMovieDecodeMS ); // let the movie decode a frame // use m_temp_* variables to draw the object RectF quadVerticies; diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 0d2652c3c4..000b4e2eaa 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -29,8 +29,7 @@ #include "arch/ErrorDialog/ErrorDialog.h" #include "time.h" -#include "SDL.h" -#include "SDL_syswm.h" // for SDL_SysWMinfo +#include "SDL_utils.h" // // StepMania global classes @@ -591,8 +590,8 @@ static void GameLoop() DISPLAY->Flip(); if(g_bHasFocus) - ::Sleep( 0 ); // give some time to other processes and threads + SDL_Delay( 0 ); // give some time to other processes and threads else - ::Sleep( 2 ); // give more time to other processes and threads, but not so much that we skip sound + SDL_Delay( 2 ); // give more time to other processes and threads, but not so much that we skip sound } } \ No newline at end of file