From b84aba68faf38af7ca998539bb48e800a5efdcc9 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Wed, 7 Jun 2023 04:07:53 +0300 Subject: [PATCH] engine: platform: implement generic GetNativeObject for POSIX systems without SDL2 --- engine/platform/linux/vid_fbdev.c | 5 ----- engine/platform/posix/sys_posix.c | 14 +++++++++++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/engine/platform/linux/vid_fbdev.c b/engine/platform/linux/vid_fbdev.c index c616cc09..045f16cb 100644 --- a/engine/platform/linux/vid_fbdev.c +++ b/engine/platform/linux/vid_fbdev.c @@ -272,11 +272,6 @@ void Platform_RunEvents( void ) } -void *Platform_GetNativeObject( const char *name ) -{ - return NULL; -} - void GAME_EXPORT Platform_GetMousePos( int *x, int *y ) { *x = *y = 0; diff --git a/engine/platform/posix/sys_posix.c b/engine/platform/posix/sys_posix.c index 364263e6..08533c5c 100644 --- a/engine/platform/posix/sys_posix.c +++ b/engine/platform/posix/sys_posix.c @@ -147,12 +147,20 @@ void Posix_Daemonize( void ) } #if !XASH_SDL && !XASH_ANDROID - void Platform_Init( void ) { Posix_Daemonize(); } -void Platform_Shutdown( void ) {} + +void Platform_Shutdown( void ) +{ + +} + +void *Platform_GetNativeObject( const char *name ) +{ + return NULL; +} #endif #if XASH_TIMER == TIMER_POSIX @@ -161,7 +169,7 @@ double Platform_DoubleTime( void ) struct timespec ts; #if XASH_IRIX clock_gettime( CLOCK_SGI_CYCLE, &ts ); -#else +#else clock_gettime( CLOCK_MONOTONIC, &ts ); #endif return (double) ts.tv_sec + (double) ts.tv_nsec/1000000000.0;