int Sys_Main(char* commandLine){ Q_strncpyz(cmdline, commandLine, sizeof(cmdline)); Sys_SetDefaultInstallPath( DEFAULT_BASEDIR ); Sys_TimerInit( ); Sys_PlatformInit( ); Sys_ThreadInit(); Sys_ThreadMain(); CON_Init(); /* Sys_ImageFindConstant(); */ Com_Init( commandLine ); while ( 1 ) { Com_Frame(); } }
int main(int argc, char* argv[]){ int len, i; char *cmdline; eventQue = (sysEvent_t*)evenQue_ADDR; // go back to real user for config loads Sys_LoadDifferentImage(argv); seteuid(getuid()); Sys_PlatformInit( ); Sys_ThreadInit(); Sys_ThreadMain(); Com_InitParse(); // Cvar_Init(); Sys_ParseArgs(argc, argv); // merge the command line, this is kinda silly for ( len = 1, i = 1; i < argc; i++ ) len += strlen( argv[i] ) + 1; cmdline = malloc( len ); *cmdline = 0; for ( i = 1; i < argc; i++ ){ if ( i > 1 ) { strcat( cmdline, " " ); } strcat( cmdline, argv[i] ); } // bk000306 - clear eventqueue memset( &eventQue[0], 0, MAX_QUED_EVENTS * sizeof( sysEvent_t ) ); Sys_Milliseconds(); // addrtest(); Com_Init( cmdline ); CON_Init(); signal( SIGILL, Sys_SigHandler ); // signal( SIGFPE, Sys_SigHandler ); // signal( SIGSEGV, Sys_SigHandler ); signal( SIGTERM, Sys_SigHandler ); signal( SIGINT, Sys_SigHandler ); fcntl( 0, F_SETFL, fcntl( 0, F_GETFL, 0 ) | FNDELAY ); if(!PbServerInitialize()){ Com_Printf("Unable to initialize PunkBuster. PunkBuster is disabled.\n"); } // GetVirtualFunctionArray(); // Com_Quit_f(); while ( 1 ) { static int fpu_word = _FPU_DEFAULT; _FPU_SETCW( fpu_word ); NET_Sleep(5); Com_Frame(); PbServerProcessEvents(); } }