engine: turn Platform_Sleep into an inline function that directly calls platform-specific delay functions

This commit is contained in:
Alibek Omarov
2024-12-04 18:32:03 +03:00
parent de1361d99d
commit e14cd758ad
9 changed files with 30 additions and 35 deletions

View File

@@ -31,7 +31,6 @@ GNU General Public License for more details.
==============================================================================
*/
double Platform_DoubleTime( void );
void Platform_Sleep( int msec );
void Platform_ShellExecute( const char *path, const char *parms );
void Platform_MessageBox( const char *title, const char *message, qboolean parentMainWindow );
void Platform_SetStatus( const char *status );
@@ -52,11 +51,13 @@ void IOS_LaunchDialog( void );
#if XASH_POSIX
void Posix_Daemonize( void );
void Posix_SetupSigtermHandling( void );
void Posix_Sleep( int msec );
#endif
#if XASH_SDL
void SDLash_Init( void );
void SDLash_Shutdown( void );
void SDLash_Sleep( int msec );
#endif
#if XASH_ANDROID
@@ -77,6 +78,7 @@ void Wcon_ShowConsole( qboolean show );
void Wcon_DisableInput( void );
char *Wcon_Input( void );
void Wcon_WinPrint( const char *pMsg );
void Win32_Sleep( int msec );
#endif
#if XASH_NSWITCH
@@ -165,6 +167,19 @@ static inline void Platform_SetupSigtermHandling( void )
#endif
}
static inline void Platform_Sleep( int msec )
{
#if XASH_TIMER == TIMER_SDL
SDLash_Sleep( msec );
#elif XASH_TIMER == TIMER_POSIX
Posix_Sleep( msec );
#elif XASH_TIMER == TIMER_WIN32
Win32_Sleep( msec );
#else
// stub
#endif
}
/*
==============================================================================