From 1d9e4c4658791755248939bda12953bfa889119a Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 21 May 2004 03:31:26 +0000 Subject: [PATCH] SDL_Delay -> usleep --- stepmania/src/ScreenAttract.cpp | 3 +-- stepmania/src/arch/InputHandler/InputHandler_DirectInput.cpp | 4 ++-- stepmania/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/stepmania/src/ScreenAttract.cpp b/stepmania/src/ScreenAttract.cpp index d2454d4899..629b90d637 100644 --- a/stepmania/src/ScreenAttract.cpp +++ b/stepmania/src/ScreenAttract.cpp @@ -23,7 +23,6 @@ #include "GameManager.h" #include "InputMapper.h" #include "ThemeManager.h" -#include "SDL_utils.h" #include "RageSounds.h" #define NEXT_SCREEN THEME->GetMetric (m_sName,"NextScreen") @@ -115,7 +114,7 @@ void ScreenAttract::AttractInput( const DeviceInput& DeviceI, const InputEventTy /* We already played the coin sound. Don't play it again. */ if( MenuI.button != MENU_BUTTON_COIN ) SCREENMAN->PlayCoinSound(); - SDL_Delay( (int)(JOIN_PAUSE_SECONDS*1000) ); // do a little pause, like the arcade does + usleep( (int)(JOIN_PAUSE_SECONDS*1000000) ); // do a little pause, like the arcade does LOG->Trace("ScreenAttract::AttractInput: go to ScreenTitleMenu" ); SCREENMAN->SetNewScreen( "ScreenTitleMenu" ); break; diff --git a/stepmania/src/arch/InputHandler/InputHandler_DirectInput.cpp b/stepmania/src/arch/InputHandler/InputHandler_DirectInput.cpp index 90e997240e..09f6dc018e 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_DirectInput.cpp +++ b/stepmania/src/arch/InputHandler/InputHandler_DirectInput.cpp @@ -76,7 +76,7 @@ InputHandler_DInput::InputHandler_DInput() g_NumJoysticks = 0; AppInstance inst; - HRESULT hr = DirectInputCreate(/* SDL_Instance */inst.Get(), DIRECTINPUT_VERSION, &dinput, NULL); + HRESULT hr = DirectInputCreate(inst.Get(), DIRECTINPUT_VERSION, &dinput, NULL); if ( hr != DI_OK ) RageException::Throw( hr_ssprintf(hr, "InputHandler_DInput: DirectInputCreate") ); @@ -489,7 +489,7 @@ void InputHandler_DInput::InputThreadMain() /* If we have no buffered devices, we didn't delay at WaitForMultipleObjectsEx. */ if( BufferedDevices.size() == 0 ) - SDL_Delay( 50 ); + usleep( 50000 ); CHECKPOINT; } CHECKPOINT; diff --git a/stepmania/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp b/stepmania/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp index f9a84fac8a..434077dd73 100644 --- a/stepmania/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp +++ b/stepmania/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp @@ -864,7 +864,7 @@ void MovieTexture_FFMpeg::DecoderThread() if( m_State == PAUSE_DECODER ) { /* We aren't feeding frames, so we aren't waiting; don't chew CPU. */ - SDL_Delay( 10 ); + usleep( 10000 ); continue; } @@ -882,7 +882,7 @@ void MovieTexture_FFMpeg::DecoderThread() } if( fTime > 0 ) - SDL_Delay( int(1000*fTime) ); + usleep( int(1000000*fTime) ); { /* The only reason m_BufferFinished might be non-zero right now (before