use SDL_Delay to sleep
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user