mirror of
https://github.com/dhewm/dhewm3.git
synced 2025-01-19 07:51:54 +00:00
Get rid of Posix_EarlyInit() and Posix_LateInit()
Since we don't have our own signal handler anymore, those two init functions can be merged into the existing Sys_Init(), which is already called by common->Init().
This commit is contained in:
parent
0bc457063f
commit
5a9c2006ff
4 changed files with 7 additions and 37 deletions
|
@ -272,8 +272,6 @@ int main(int argc, char **argv) {
|
||||||
|
|
||||||
setlocale(LC_ALL, "C");
|
setlocale(LC_ALL, "C");
|
||||||
|
|
||||||
Posix_EarlyInit( );
|
|
||||||
|
|
||||||
// some ladspa-plugins (that may be indirectly loaded by doom3 if they're
|
// some ladspa-plugins (that may be indirectly loaded by doom3 if they're
|
||||||
// used by alsa) call setlocale(LC_ALL, ""); This sets LC_ALL to $LANG or
|
// used by alsa) call setlocale(LC_ALL, ""); This sets LC_ALL to $LANG or
|
||||||
// $LC_ALL which usually is not "C" and will fuck up scanf, strtod
|
// $LC_ALL which usually is not "C" and will fuck up scanf, strtod
|
||||||
|
@ -287,8 +285,6 @@ int main(int argc, char **argv) {
|
||||||
common->Init( 0, NULL );
|
common->Init( 0, NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
Posix_LateInit( );
|
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
common->Frame();
|
common->Frame();
|
||||||
}
|
}
|
||||||
|
|
|
@ -180,15 +180,11 @@ int main( int argc, char *argv[] ) {
|
||||||
if (![[NSFileManager defaultManager] changeCurrentDirectoryPath:[[NSBundle mainBundle] resourcePath]])
|
if (![[NSFileManager defaultManager] changeCurrentDirectoryPath:[[NSBundle mainBundle] resourcePath]])
|
||||||
Sys_Error("Could not access application resources");
|
Sys_Error("Could not access application resources");
|
||||||
|
|
||||||
Posix_EarlyInit();
|
|
||||||
|
|
||||||
if (argc > 1)
|
if (argc > 1)
|
||||||
common->Init(argc - 1, &argv[1]);
|
common->Init(argc - 1, &argv[1]);
|
||||||
else
|
else
|
||||||
common->Init(0, NULL);
|
common->Init(0, NULL);
|
||||||
|
|
||||||
Posix_LateInit();
|
|
||||||
|
|
||||||
[NSApp activateIgnoringOtherApps:YES];
|
[NSApp activateIgnoringOtherApps:YES];
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
|
|
@ -73,7 +73,7 @@ idCVar com_pid( "com_pid", "0", CVAR_INTEGER | CVAR_INIT | CVAR_SYSTEM, "process
|
||||||
// exit - quit - error --------------------------------------------------------
|
// exit - quit - error --------------------------------------------------------
|
||||||
|
|
||||||
static int set_exit = 0;
|
static int set_exit = 0;
|
||||||
static char exit_spawn[ 1024 ];
|
static char exit_spawn[ 1024 ] = { 0 };
|
||||||
|
|
||||||
/*
|
/*
|
||||||
================
|
================
|
||||||
|
@ -240,10 +240,14 @@ const char *Posix_Cwd( void ) {
|
||||||
/*
|
/*
|
||||||
=================
|
=================
|
||||||
Sys_Init
|
Sys_Init
|
||||||
Posix_EarlyInit/Posix_LateInit is better
|
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void Sys_Init( void ) { }
|
void Sys_Init( void ) {
|
||||||
|
Posix_InitConsoleInput();
|
||||||
|
com_pid.SetInteger( getpid() );
|
||||||
|
common->Printf( "pid: %d\n", com_pid.GetInteger() );
|
||||||
|
common->Printf( "%d MB System Memory\n", Sys_GetSystemRam() );
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
=================
|
=================
|
||||||
|
@ -351,27 +355,6 @@ int Sys_GetDriveFreeSpace( const char *path ) {
|
||||||
return 1000 * 1024;
|
return 1000 * 1024;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
===============
|
|
||||||
Posix_EarlyInit
|
|
||||||
===============
|
|
||||||
*/
|
|
||||||
void Posix_EarlyInit( void ) {
|
|
||||||
exit_spawn[0] = '\0';
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
===============
|
|
||||||
Posix_LateInit
|
|
||||||
===============
|
|
||||||
*/
|
|
||||||
void Posix_LateInit( void ) {
|
|
||||||
Posix_InitConsoleInput();
|
|
||||||
com_pid.SetInteger( getpid() );
|
|
||||||
common->Printf( "pid: %d\n", com_pid.GetInteger() );
|
|
||||||
common->Printf( "%d MB System Memory\n", Sys_GetSystemRam() );
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
===============
|
===============
|
||||||
Posix_InitConsoleInput
|
Posix_InitConsoleInput
|
||||||
|
|
|
@ -35,11 +35,6 @@ If you have questions concerning this license or the applicable additional terms
|
||||||
|
|
||||||
const char* Posix_Cwd( void );
|
const char* Posix_Cwd( void );
|
||||||
|
|
||||||
// called first thing. does InitSigs and various things
|
|
||||||
void Posix_EarlyInit( );
|
|
||||||
// called after common has been initialized
|
|
||||||
void Posix_LateInit( );
|
|
||||||
|
|
||||||
void Posix_Exit( int ret );
|
void Posix_Exit( int ret );
|
||||||
void Posix_SetExit(int ret); // override the exit code
|
void Posix_SetExit(int ret); // override the exit code
|
||||||
void Posix_SetExitSpawn( const char *exeName ); // set the process to be spawned when we quit
|
void Posix_SetExitSpawn( const char *exeName ); // set the process to be spawned when we quit
|
||||||
|
|
Loading…
Reference in a new issue