engine: reformat and reorder host_parm_s struct, remove now unused host.daemonize and host.enabledll
This commit is contained in:
parent
2c7bf49fc9
commit
4163d3655a
4 changed files with 73 additions and 78 deletions
|
@ -276,78 +276,70 @@ typedef enum bugcomp_e
|
||||||
|
|
||||||
typedef struct host_parm_s
|
typedef struct host_parm_s
|
||||||
{
|
{
|
||||||
host_status_t status; // global host state
|
// ==== shared through RefAPI's ref_host_t
|
||||||
game_status_t game; // game manager
|
double realtime; // host.curtime
|
||||||
uint type; // running at
|
double frametime; // time between engine frames
|
||||||
jmp_buf abortframe; // abort current frame
|
uint features; // custom features that enables by mod-maker request
|
||||||
dword errorframe; // to prevent multiple host error
|
// ==== shared through RefAPI's ref_host_t
|
||||||
poolhandle_t mempool; // static mempool for misc allocations
|
|
||||||
string finalmsg; // server shutdown final message
|
host_status_t status; // global host state
|
||||||
string downloadfile; // filename to be downloading
|
game_status_t game; // game manager
|
||||||
int downloadcount; // how many files remain to downloading
|
uint type; // running at
|
||||||
char deferred_cmd[128]; // deferred commands
|
poolhandle_t mempool; // static mempool for misc allocations
|
||||||
host_redirect_t rd; // remote console
|
poolhandle_t imagepool; // imagelib mempool
|
||||||
|
poolhandle_t soundpool; // soundlib mempool
|
||||||
|
string finalmsg; // server shutdown final message
|
||||||
|
string downloadfile; // filename to be downloading
|
||||||
|
int downloadcount; // how many files remain to downloading
|
||||||
|
char deferred_cmd[128];// deferred commands
|
||||||
|
|
||||||
|
host_redirect_t rd; // remote console
|
||||||
|
|
||||||
|
void *hWnd; // main window
|
||||||
|
|
||||||
// command line parms
|
// command line parms
|
||||||
int argc;
|
char **argv;
|
||||||
char **argv;
|
int argc;
|
||||||
|
|
||||||
// ==== shared through RefAPI's ref_host_t
|
uint framecount; // global framecount
|
||||||
double realtime; // host.curtime
|
uint errorframe; // to prevent multiple host error
|
||||||
double frametime; // time between engine frames
|
uint32_t bugcomp; // bug compatibility level, for very "special" games
|
||||||
uint features; // custom features that enables by mod-maker request
|
double realframetime; // for some system events, e.g. console animations
|
||||||
// ==== shared through RefAPI's ref_host_t
|
double starttime; // measure time to first frame
|
||||||
|
double pureframetime; // count of sleeps can be inserted between frames
|
||||||
|
double force_draw_version_time;
|
||||||
|
|
||||||
double realframetime; // for some system events, e.g. console animations
|
char draw_decals[MAX_DECALS][MAX_QPATH]; // list of unique decal indexes
|
||||||
|
vec3_t player_mins[MAX_MAP_HULLS]; // 4 hulls allowed
|
||||||
|
vec3_t player_maxs[MAX_MAP_HULLS]; // 4 hulls allowed
|
||||||
|
|
||||||
uint framecount; // global framecount
|
qboolean allow_console; // allow console in dev-mode or multiplayer game
|
||||||
|
qboolean allow_console_init; // initial value to allow the console
|
||||||
// list of unique decal indexes
|
qboolean key_overstrike; // key overstrike mode
|
||||||
char draw_decals[MAX_DECALS][MAX_QPATH];
|
qboolean stuffcmds_pending; // should execute stuff commands
|
||||||
|
qboolean allow_cheats; // this host will allow cheating
|
||||||
vec3_t player_mins[MAX_MAP_HULLS]; // 4 hulls allowed
|
qboolean change_game; // initialize when game is changed
|
||||||
vec3_t player_maxs[MAX_MAP_HULLS]; // 4 hulls allowed
|
qboolean mouse_visible; // vgui override cursor control (never change outside Platform_SetCursorType!)
|
||||||
|
qboolean shutdown_issued; // engine is shutting down
|
||||||
void* hWnd; // main window
|
qboolean apply_game_config; // when true apply only to game cvars and ignore all other commands
|
||||||
qboolean allow_console; // allow console in dev-mode or multiplayer game
|
qboolean apply_opengl_config; // when true apply only to opengl cvars and ignore all other commands
|
||||||
qboolean allow_console_init; // initial value to allow the console
|
qboolean config_executed; // a bit who indicated was config.cfg already executed e.g. from valve.rc
|
||||||
qboolean key_overstrike; // key overstrike mode
|
qboolean crashed; // set to true if crashed
|
||||||
qboolean stuffcmds_pending; // should execute stuff commands
|
#if XASH_DLL_LOADER
|
||||||
qboolean allow_cheats; // this host will allow cheating
|
qboolean enabledll;
|
||||||
qboolean change_game; // initialize when game is changed
|
#endif
|
||||||
qboolean mouse_visible; // vgui override cursor control (never change outside Platform_SetCursorType!)
|
qboolean textmode;
|
||||||
qboolean shutdown_issued; // engine is shutting down
|
|
||||||
double force_draw_version_time;
|
|
||||||
qboolean apply_game_config; // when true apply only to game cvars and ignore all other commands
|
|
||||||
qboolean apply_opengl_config;// when true apply only to opengl cvars and ignore all other commands
|
|
||||||
qboolean config_executed; // a bit who indicated was config.cfg already executed e.g. from valve.rc
|
|
||||||
qboolean crashed; // set to true if crashed
|
|
||||||
qboolean daemonized;
|
|
||||||
qboolean enabledll;
|
|
||||||
qboolean textmode;
|
|
||||||
|
|
||||||
// some settings were changed and needs to global update
|
// some settings were changed and needs to global update
|
||||||
qboolean userinfo_changed;
|
qboolean userinfo_changed;
|
||||||
qboolean movevars_changed;
|
qboolean movevars_changed;
|
||||||
qboolean renderinfo_changed;
|
qboolean renderinfo_changed;
|
||||||
|
|
||||||
poolhandle_t imagepool; // imagelib mempool
|
|
||||||
poolhandle_t soundpool; // soundlib mempool
|
|
||||||
|
|
||||||
// for IN_MouseMove() easy access
|
// for IN_MouseMove() easy access
|
||||||
int window_center_x;
|
int window_center_x;
|
||||||
int window_center_y;
|
int window_center_y;
|
||||||
|
string gamedll;
|
||||||
// bug compatibility level, for very "special" games
|
string clientlib;
|
||||||
uint32_t bugcomp;
|
|
||||||
|
|
||||||
// measure time to first frame
|
|
||||||
double starttime;
|
|
||||||
|
|
||||||
// count of sleeps can be inserted between frames
|
|
||||||
double pureframetime;
|
|
||||||
string gamedll;
|
|
||||||
string clientlib;
|
|
||||||
} host_parm_t;
|
} host_parm_t;
|
||||||
|
|
||||||
extern host_parm_t host;
|
extern host_parm_t host;
|
||||||
|
|
|
@ -318,18 +318,6 @@ void Host_EndGame( qboolean abort, const char *message, ... )
|
||||||
if( abort ) Host_AbortCurrentFrame ();
|
if( abort ) Host_AbortCurrentFrame ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
================
|
|
||||||
Host_AbortCurrentFrame
|
|
||||||
|
|
||||||
aborts the current host frame and goes on with the next one
|
|
||||||
================
|
|
||||||
*/
|
|
||||||
void Host_AbortCurrentFrame( void )
|
|
||||||
{
|
|
||||||
longjmp( host.abortframe, 1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
==================
|
==================
|
||||||
Host_CalcSleep
|
Host_CalcSleep
|
||||||
|
@ -1044,7 +1032,9 @@ static void Host_InitCommon( int argc, char **argv, const char *progname, qboole
|
||||||
if( !Sys_CheckParm( "-noch" ))
|
if( !Sys_CheckParm( "-noch" ))
|
||||||
Sys_SetupCrashHandler();
|
Sys_SetupCrashHandler();
|
||||||
|
|
||||||
|
#if XASH_DLL_LOADER
|
||||||
host.enabledll = !Sys_CheckParm( "-nodll" );
|
host.enabledll = !Sys_CheckParm( "-nodll" );
|
||||||
|
#endif
|
||||||
|
|
||||||
host.change_game = bChangeGame || Sys_CheckParm( "-changegame" );
|
host.change_game = bChangeGame || Sys_CheckParm( "-changegame" );
|
||||||
host.config_executed = false;
|
host.config_executed = false;
|
||||||
|
|
|
@ -16,6 +16,8 @@ GNU General Public License for more details.
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "platform/platform.h"
|
#include "platform/platform.h"
|
||||||
|
|
||||||
|
static jmp_buf g_abortframe;
|
||||||
|
|
||||||
void COM_InitHostState( void )
|
void COM_InitHostState( void )
|
||||||
{
|
{
|
||||||
memset( GameState, 0, sizeof( game_status_t ));
|
memset( GameState, 0, sizeof( game_status_t ));
|
||||||
|
@ -168,11 +170,23 @@ static void Host_RunFrame( double time )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
================
|
||||||
|
Host_AbortCurrentFrame
|
||||||
|
|
||||||
|
aborts the current host frame and goes on with the next one
|
||||||
|
================
|
||||||
|
*/
|
||||||
|
void Host_AbortCurrentFrame( void )
|
||||||
|
{
|
||||||
|
longjmp( g_abortframe, 1 );
|
||||||
|
}
|
||||||
|
|
||||||
void COM_Frame( double time )
|
void COM_Frame( double time )
|
||||||
{
|
{
|
||||||
int loopCount = 0;
|
int loopCount = 0;
|
||||||
|
|
||||||
if( setjmp( host.abortframe ))
|
if( setjmp( g_abortframe ))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
while( 1 )
|
while( 1 )
|
||||||
|
|
|
@ -96,8 +96,7 @@ void Platform_ShellExecute( const char *path, const char *parms )
|
||||||
|
|
||||||
void Posix_Daemonize( void )
|
void Posix_Daemonize( void )
|
||||||
{
|
{
|
||||||
// to be accessed later
|
if( Sys_CheckParm( "-daemonize" ))
|
||||||
if( ( host.daemonized = Sys_CheckParm( "-daemonize" ) ) )
|
|
||||||
{
|
{
|
||||||
#if XASH_POSIX && defined(_POSIX_VERSION) && !defined(XASH_MOBILE_PLATFORM)
|
#if XASH_POSIX && defined(_POSIX_VERSION) && !defined(XASH_MOBILE_PLATFORM)
|
||||||
pid_t daemon;
|
pid_t daemon;
|
||||||
|
|
Loading…
Add table
Reference in a new issue