Skip to content
Permalink
Browse files

Some more minor changes

  • Loading branch information...
Amanieu committed Dec 29, 2014
1 parent 5c86c93 commit fbb8dce96db662b802da7bec52de30fae9f7d566
Showing with 17 additions and 25 deletions.
  1. +16 −5 src/engine/framework/System.cpp
  2. +1 −20 src/engine/qcommon/common.cpp
@@ -397,6 +397,12 @@ struct cmdlineArgs_t {
#endif
static void ParseCmdline(int argc, char** argv, cmdlineArgs_t& cmdlineArgs)
{
#ifdef __APPLE__
// Ignore the -psn parameter added by OSX
if (!strncmp(argv[argc - 1], "-psn", 4)
argc--;
#endif

bool foundCommands = false;
for (int i = 1; i < argc; i++) {
// A + indicate the start of a command that should be run on startup
@@ -429,16 +435,12 @@ static void ParseCmdline(int argc, char** argv, cmdlineArgs_t& cmdlineArgs)

if (!strcmp(argv[i], "--help")) {
fprintf(stderr, PRODUCT_NAME " " PRODUCT_VERSION "\n"
"Usage: %s" HELP_URL " [OPTION] [+COMMAND]...\n",
"Usage: %s [-OPTION]..." HELP_URL " [+COMMAND]...\n",
argv[0]);
exit(0);
} else if (!strcmp(argv[i], "--version")) {
fprintf(stderr, PRODUCT_NAME " " PRODUCT_VERSION "\n");
exit(0);
#ifdef __APPLE__
} else if (!strncmp(argv[i], "-psn", 4) {
// Ignore -psn parameters added by OSX
#endif
} else if (!strcmp(argv[i], "-set")) {
if (i >= argc - 2) {
Log::Warn("Missing argument for -set");
@@ -495,6 +497,15 @@ static void Init(int argc, char** argv)
{
cmdlineArgs_t cmdlineArgs;

// Print a banner and a copy of the command-line arguments
Log::Notice(Q3_VERSION " " PLATFORM_STRING " " ARCH_STRING " " __DATE__);
std::string argsString = "cmdline:";
for (int i = 1; i < argc; i++) {
argsString.push_back(' ');
argsString.append(argv[i]);
}
Log::Notice(argsString);

Sys::SetupCrashHandler();
Sys::ParseCmdline(argc, argv, cmdlineArgs);

@@ -65,8 +65,6 @@ Maryland 20850 USA.
// JPW NERVE changed this for multiplayer back to 42, 56 for depot/mp_cpdepot, 42 for everything else
#define DEF_COMHUNKMEGS_S XSTRING(DEF_COMHUNKMEGS)

jmp_buf abortframe; // an ERR_DROP has occurred, exit the entire frame

static fileHandle_t logfile;

cvar_t *com_crashed = NULL; // ydnar: set in case of a crash, prevents CVAR_UNSAFE variables from being set from a cfg
@@ -1673,16 +1671,7 @@ Com_Init
void Com_Init( char *commandLine )
{
char *s;
int pid, qport;

pid = Sys_GetPID();

Com_Printf( "%s %s %s %s\n%s\n", Q3_VERSION, PLATFORM_STRING, ARCH_STRING, __DATE__, commandLine );

if ( setjmp( abortframe ) )
{
Sys_Error( "Error during initialization" );
}
int qport;

// prepare enough of the subsystems to handle
// cvar and command buffer management
@@ -1700,9 +1689,6 @@ void Com_Init( char *commandLine )
// ydnar: init crashed variable as early as possible
com_crashed = Cvar_Get( "com_crashed", "0", CVAR_TEMP );

s = va( "%d", pid );
com_pid = Cvar_Get( "com_pid", s, CVAR_ROM );

Trans_Init();

#ifdef BUILD_SERVER
@@ -2022,11 +2008,6 @@ void Com_Frame( void (*GetInput)( void ), void (*DoneInput)( void ) )
static int watchdogTime = 0;
static qboolean watchWarn = qfalse;

if ( setjmp( abortframe ) )
{
return; // an ERR_DROP was thrown
}

// bk001204 - init to zero.
// also: might be clobbered by `longjmp' or `vfork'
timeBeforeFirstEvents = 0;

0 comments on commit fbb8dce

Please sign in to comment.
You can’t perform that action at this time.