case 4:
Con_ClearNotify();
+ if (COM_CheckParm("-profilegameonly"))
+ Sys_AllowProfiling(true);
break;
}
}
int i;
const char* os;
+ if (COM_CheckParm("-profilegameonly"))
+ Sys_AllowProfiling(false);
+
// LordHavoc: quake never seeded the random number generator before... heh
if (COM_CheckParm("-benchmark"))
srand(0); // predictable random sequence for -benchmark
void Sys_Shutdown (void); //INFO: This is only called by Host_Shutdown so we dont need testing for recursion
void Sys_Quit (int returnvalue);
+// on some build/platform combinations (such as Linux gcc with the -pg
+// profiling option) this can turn on/off profiling, used primarily to limit
+// profiling to certain areas of the code, such as ingame performance without
+// regard for loading/shutdown performance (-profilegameonly on commandline)
+void Sys_AllowProfiling (qboolean enable);
+
double Sys_DoubleTime (void);
char *Sys_ConsoleInput (void);
extern qboolean host_shuttingdown;
void Sys_Quit (int returnvalue)
{
+ if (COM_CheckParm("-profilegameonly"))
+ Sys_AllowProfiling(false);
host_shuttingdown = true;
Host_Shutdown();
exit(returnvalue);
}
+void Sys_AllowProfiling(qboolean enable)
+{
+#if defined(__linux__) || defined(__FreeBSD__)
+int moncontrol(int);
+ moncontrol(enable);
+#endif
+}
+
+
/*
===============================================================================