mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-09 05:41:46 +08:00
engine: make Host_ExitInMain used everywhere, as we depend on sjlj functions on all platforms anyway
This commit is contained in:
@@ -262,15 +262,6 @@ static qboolean FS_DetermineRootDirectory( char *out, size_t size )
|
||||
#if TARGET_OS_IOS
|
||||
Q_strncpy( out, IOS_GetDocsDir(), size );
|
||||
return true;
|
||||
#elif XASH_ANDROID && XASH_SDL
|
||||
path = SDL_AndroidGetExternalStoragePath();
|
||||
if( path != NULL )
|
||||
{
|
||||
Q_strncpy( out, path, size );
|
||||
return true;
|
||||
}
|
||||
Sys_Error( "couldn't determine Android external storage path: %s", SDL_GetError( ));
|
||||
return false;
|
||||
#elif XASH_PSVITA
|
||||
if( PSVita_GetBasePath( out, size ))
|
||||
return true;
|
||||
|
||||
@@ -39,8 +39,6 @@ GNU General Public License for more details.
|
||||
|
||||
static pfnChangeGame pChangeGame = NULL;
|
||||
host_parm_t host; // host parms
|
||||
|
||||
#if XASH_ANDROID
|
||||
static jmp_buf return_from_main_buf;
|
||||
|
||||
/*
|
||||
@@ -59,7 +57,6 @@ void Host_ExitInMain( void )
|
||||
{
|
||||
longjmp( return_from_main_buf, 1 );
|
||||
}
|
||||
#endif // XASH_ANDROID
|
||||
|
||||
#ifdef XASH_ENGINE_TESTS
|
||||
struct tests_stats_s tests_stats;
|
||||
@@ -203,12 +200,9 @@ static void Sys_PrintUsage( const char *exename )
|
||||
#if XASH_SDL == 2
|
||||
O("-sdl_renderer <n> ","use alternative SDL_Renderer for software")
|
||||
#endif // XASH_SDL
|
||||
#if XASH_ANDROID && !XASH_SDL
|
||||
O("-nativeegl ","use native egl implementation. Use if screen does not update or black")
|
||||
#endif // XASH_ANDROID
|
||||
#if XASH_DOS
|
||||
#if XASH_VIDEO == VIDEO_DOS
|
||||
O("-novesa ","disable vesa")
|
||||
#endif // XASH_DOS
|
||||
#endif // XASH_VIDEO == VIDEO_DOS
|
||||
#if XASH_VIDEO == VIDEO_FBDEV
|
||||
O("-fbdev <path> ","open selected framebuffer")
|
||||
O("-ttygfx ","set graphics mode in tty")
|
||||
@@ -1347,18 +1341,16 @@ int EXPORT Host_Main( int argc, char **argv, const char *progname, int bChangeGa
|
||||
// check after all configs were executed
|
||||
HPAK_CheckIntegrity( hpk_custom_file.string );
|
||||
|
||||
#if XASH_ANDROID
|
||||
if( setjmp( return_from_main_buf ))
|
||||
return error_on_exit;
|
||||
#endif // XASH_ANDROID
|
||||
|
||||
#if !XASH_EMSCRIPTEN
|
||||
// main window message loop
|
||||
while( host.status != HOST_CRASHED )
|
||||
Host_MainLoop( &oldtime );
|
||||
#else // XASH_EMSCRIPTEN
|
||||
emscripten_set_main_loop_arg( Host_MainLoop, &oldtime, 0, false );
|
||||
#endif // XASH_EMSCRIPTEN
|
||||
{
|
||||
double newtime = Sys_DoubleTime();
|
||||
COM_Frame( newtime - oldtime );
|
||||
oldtime = newtime;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -425,16 +425,6 @@ void Sys_Error( const char *error, ... )
|
||||
Sys_Quit( "caught an error" );
|
||||
}
|
||||
|
||||
#if XASH_EMSCRIPTEN
|
||||
#include <emscripten.h>
|
||||
#define exit my_exit
|
||||
void my_exit( int ret )
|
||||
{
|
||||
emscripten_cancel_main_loop();
|
||||
emscripten_force_exit( ret );
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
================
|
||||
Sys_Quit
|
||||
@@ -443,11 +433,7 @@ Sys_Quit
|
||||
void Sys_Quit( const char *reason )
|
||||
{
|
||||
Host_ShutdownWithReason( reason );
|
||||
#if XASH_ANDROID
|
||||
Host_ExitInMain();
|
||||
#else
|
||||
exit( error_on_exit );
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user