mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
engine: move setjmp for exit-in-main to the beginning of Host_Main function
This commit is contained in:
@@ -577,7 +577,7 @@ void Host_Error( const char *error, ... ) FORMAT_CHECK( 1 );
|
||||
void Host_ValidateEngineFeatures( uint32_t mask, uint32_t features );
|
||||
void Host_Frame( double time );
|
||||
void Host_Credits( void );
|
||||
void Host_ExitInMain( void );
|
||||
void Host_ExitInMain( void ) NORETURN;
|
||||
|
||||
//
|
||||
// host_state.c
|
||||
|
||||
@@ -37,8 +37,8 @@ GNU General Public License for more details.
|
||||
#include "render_api.h" // decallist_t
|
||||
#include "tests.h"
|
||||
|
||||
static pfnChangeGame pChangeGame = NULL;
|
||||
host_parm_t host; // host parms
|
||||
host_parm_t host; // host parms
|
||||
static pfnChangeGame pChangeGame = NULL;
|
||||
static jmp_buf return_from_main_buf;
|
||||
|
||||
/*
|
||||
@@ -1177,14 +1177,6 @@ static void Sys_Quit_f( void )
|
||||
Sys_Quit( "command" );
|
||||
}
|
||||
|
||||
static void Host_MainLoop( void *userdata )
|
||||
{
|
||||
double *poldtime = (double *)userdata;
|
||||
double newtime = Sys_DoubleTime();
|
||||
COM_Frame( newtime - *poldtime );
|
||||
*poldtime = newtime;
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
Host_Main
|
||||
@@ -1195,6 +1187,9 @@ int EXPORT Host_Main( int argc, char **argv, const char *progname, int bChangeGa
|
||||
static double oldtime;
|
||||
string demoname, exename;
|
||||
|
||||
if( setjmp( return_from_main_buf ))
|
||||
return error_on_exit;
|
||||
|
||||
host.starttime = Sys_DoubleTime();
|
||||
|
||||
pChangeGame = func; // may be NULL
|
||||
@@ -1338,9 +1333,6 @@ 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( setjmp( return_from_main_buf ))
|
||||
return error_on_exit;
|
||||
|
||||
// main window message loop
|
||||
while( host.status != HOST_CRASHED )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user