29 #include "../idlib/precompiled.h"
32 #include "../renderer/Image.h"
34 #define MAX_PRINT_MSG_SIZE 4096
35 #define MAX_WARNING_LIST 256
45 #define BUILD_DEBUG "-debug"
47 #define BUILD_DEBUG ""
62 #define ASYNCSOUND_INFO "0: mix sound inline, 1: memory mapped async mix, 2: callback mixing, 3: write async mix"
63 #if defined( MACOS_X )
65 #elif defined( __linux__ )
101 HWND com_hwndMsg =
NULL;
102 bool com_outputMsg =
false;
103 unsigned int com_msgID = -1;
118 virtual void Init(
int argc,
const char **argv,
const char *cmdline );
120 virtual void Quit(
void );
122 virtual void Frame(
void );
123 virtual void GUIFrame(
bool execCmd,
bool network );
124 virtual void Async(
void );
134 virtual void VPrintf(
const char *fmt, va_list arg );
200 #ifdef ID_WRITE_VERSION
230 #ifdef ID_WRITE_VERSION
231 config_compressor =
NULL;
241 if ( !buffer || !buffersize || !flush ) {
273 BOOL CALLBACK EnumWindowsProc( HWND hwnd,
LPARAM lParam ) {
276 ::GetWindowText( hwnd, buff,
sizeof( buff ) );
289 bool FindEditor(
void ) {
291 EnumWindows( EnumWindowsProc, 0 );
292 return !( com_hwndMsg ==
NULL );
329 static bool logFileFailed =
false;
344 timeLength = strlen( msg );
351 msg[
sizeof(msg)-2] =
'\n'; msg[
sizeof(msg)-1] =
'\0';
352 Sys_Printf(
"idCommon::VPrintf: truncated to %d characters\n", strlen(msg)-1 );
377 #if defined(_DEBUG) && defined(WIN32)
378 if ( strlen( msg ) < 512 ) {
386 static bool recursing;
388 if ( !
logFile && !recursing ) {
398 logFileFailed =
true;
399 FatalError(
"failed to open log file '%s'\n", fileName );
412 Printf(
"log file '%s' opened on %s\n", fileName, asctime( newtime ) );
433 if ( com_outputMsg ) {
434 if ( com_msgID == -1 ) {
435 com_msgID = ::RegisterWindowMessage( DMAP_MSGID );
436 if ( !FindEditor() ) {
437 com_outputMsg =
false;
443 ATOM atom = ::GlobalAddAtom( msg );
444 ::PostMessage( com_hwndMsg, com_msgID, 0, static_cast<LPARAM>(atom) );
462 va_start( argptr, fmt );
482 va_start( argptr, fmt );
485 msg[
sizeof(msg)-1] =
'\0';
511 va_start( argptr, fmt );
514 msg[
sizeof(msg)-1] =
'\0';
530 va_start( argptr, fmt );
533 msg[
sizeof(msg)-1] = 0;
556 Printf(
"------------- Warnings ---------------\n" );
597 warningFile->
Printf(
"------------- Warnings ---------------\n\n" );
610 warningFile->
Printf(
"\n\n-------------- Errors ---------------\n\n" );
621 #if defined(_WIN32) && !defined(_DEBUG)
624 WinExec(
va(
"Notepad.exe %s", osPath.
c_str() ), SW_SHOW );
636 static int lastErrorTime;
637 static int errorCount;
671 if ( currentTime - lastErrorTime < 100 ) {
672 if ( ++errorCount > 3 ) {
678 lastErrorTime = currentTime;
682 va_start (argptr,fmt);
742 va_start( argptr, fmt );
754 va_start( argptr, fmt );
777 #ifdef ID_ALLOW_TOOLS
810 #define MAX_CONSOLE_LINES 32
820 int i, current_count;
822 com_numConsoleLines = 0;
825 for ( i = 0; i < argc; i++ ) {
826 if ( argv[ i ][ 0 ] ==
'+' ) {
827 com_numConsoleLines++;
828 com_consoleLines[ com_numConsoleLines-1 ].
AppendArg( argv[ i ] + 1 );
830 if ( !com_numConsoleLines ) {
831 com_numConsoleLines++;
833 com_consoleLines[ com_numConsoleLines-1 ].
AppendArg( argv[ i ] );
844 com_numConsoleLines = 0;
859 if ( !
idStr::Icmp( com_consoleLines[ i ].Argv(0),
"safe" )
860 || !
idStr::Icmp( com_consoleLines[ i ].Argv(0),
"cvar_restart" ) ) {
861 com_consoleLines[
i ].
Clear();
880 if ( !
idStr::Icmp( com_consoleLines[ i ].Argv(0),
"guieditor" ) ) {
883 else if ( !
idStr::Icmp( com_consoleLines[ i ].Argv(0),
"debugger" ) ) {
886 else if ( !
idStr::Icmp( com_consoleLines[ i ].Argv(0),
"editor" ) ) {
890 else if ( !
idStr::Icmp( com_consoleLines[ i ].Argv(0),
"materialEditor" ) ) {
894 if ( !
idStr::Icmp( com_consoleLines[ i ].Argv(0),
"renderbump" )
895 || !
idStr::Icmp( com_consoleLines[ i ].Argv(0),
"editor" )
896 || !
idStr::Icmp( com_consoleLines[ i ].Argv(0),
"guieditor" )
897 || !
idStr::Icmp( com_consoleLines[ i ].Argv(0),
"debugger" )
898 || !
idStr::Icmp( com_consoleLines[ i ].Argv(0),
"dmap" )
899 || !
idStr::Icmp( com_consoleLines[ i ].Argv(0),
"materialEditor" )
923 while ( i < com_numConsoleLines ) {
924 if (
strcmp( com_consoleLines[ i ].Argv( 0 ),
"set" ) ) {
929 s = com_consoleLines[
i ].
Argv(1);
936 while ( j < com_numConsoleLines ) {
937 com_consoleLines[ j - 1 ] = com_consoleLines[
j ];
940 com_numConsoleLines--;
966 if ( !com_consoleLines[i].Argc() ) {
971 if (
idStr::Icmpn( com_consoleLines[i].Argv(0),
"set", 3 ) ) {
987 #ifdef ID_ALLOW_TOOLS
1022 Printf(
"Couldn't write %s.\n", filename );
1036 #ifdef ID_WRITE_VERSION
1046 Printf (
"Couldn't write %s.\n", filename );
1050 #ifdef ID_WRITE_VERSION
1051 assert( config_compressor );
1053 curtime = ctime( &t );
1055 config_compressor->Init( &compressed,
true, 8 );
1056 config_compressor->Write( runtag.
c_str(), runtag.
Length() );
1057 config_compressor->FinishCompress( );
1139 #ifdef ID_ALLOW_TOOLS
1147 static void Com_Editor_f(
const idCmdArgs &args ) {
1156 static void Com_ScriptDebugger_f(
const idCmdArgs &args ) {
1159 common->
Printf(
"Script debugger is currently disabled\n" );
1169 static void Com_EditGUIs_f(
const idCmdArgs &args ) {
1178 static void Com_MaterialEditor_f(
const idCmdArgs &args ) {
1183 #endif // ID_ALLOW_TOOLS
1192 static void PrintMemInfo_f(
const idCmdArgs &args ) {
1195 memset( &mi, 0,
sizeof( mi ) );
1226 #ifdef ID_ALLOW_TOOLS
1232 static void Com_EditLights_f(
const idCmdArgs &args ) {
1242 static void Com_EditSounds_f(
const idCmdArgs &args ) {
1252 static void Com_EditDecls_f(
const idCmdArgs &args ) {
1261 static void Com_EditAFs_f(
const idCmdArgs &args ) {
1270 static void Com_EditParticles_f(
const idCmdArgs &args ) {
1279 static void Com_EditScripts_f(
const idCmdArgs &args ) {
1288 static void Com_EditPDAs_f(
const idCmdArgs &args ) {
1291 #endif // ID_ALLOW_TOOLS
1300 static void Com_Error_f(
const idCmdArgs &args ) {
1302 commonLocal.
Printf(
"error may only be used in developer mode\n" );
1306 if ( args.
Argc() > 1 ) {
1307 commonLocal.
FatalError(
"Testing fatal error" );
1309 commonLocal.
Error(
"Testing drop error" );
1320 static void Com_Freeze_f(
const idCmdArgs &args ) {
1324 if ( args.
Argc() != 2 ) {
1325 commonLocal.
Printf(
"freeze <seconds>\n" );
1330 commonLocal.
Printf(
"freeze may only be used in developer mode\n" );
1334 s = atof( args.
Argv(1) );
1340 if ( ( now - start ) * 0.001f > s ) {
1353 static void Com_Crash_f(
const idCmdArgs &args ) {
1355 commonLocal.
Printf(
"crash may only be used in developer mode\n" );
1359 * (
int * ) 0 = 0x12345678;
1367 static void Com_Quit_f(
const idCmdArgs &args ) {
1381 if ( args.
Argc() != 2 ) {
1382 commonLocal.
Printf(
"Usage: writeconfig <filename>\n" );
1386 filename = args.
Argv(1);
1388 commonLocal.
Printf(
"Writing %s.\n", filename.
c_str() );
1517 bool oldCard =
false;
1518 bool nv10or20 =
false;
1538 int vendorId, deviceId, cpuId;
1541 bool isFX5200 = vendorId == 0x10DE && ( deviceId & 0x0FF0 ) == 0x0320;
1566 common->
Printf(
"============= ReloadEngine start =============\n" );
1575 common->
Printf(
"============= ReloadEngine end ===============\n" );
1601 for(
int i = 0;
i < list->
Num();
i++ ) {
1603 temp = temp.
Right(temp.
Length()-strlen(
"strings/"));
1637 if ( currentLangList.
Num() == 0 ) {
1641 currentLangList = langList;
1645 for(
int i = 0;
i < currentLangList.
Num();
i++ ) {
1661 idStr out, ws, work;
1664 if ( map.
Parse( fileName,
false,
false ) ) {
1666 for (
int i = 0;
i <
count;
i++ ) {
1672 if ( temp && *temp ) {
1674 if ( val == temp ) {
1681 map.
Write( fileName,
".map" );
1691 const char *buffer =
NULL;
1697 src.
LoadMemory( buffer, strlen(buffer), fileName );
1699 common->
Printf(
"Processing %s\n", fileName );
1704 mapFileName = token;
1705 replaceArgs.
Clear();
1708 if ( token ==
"}" ) {
1712 if ( token2 ==
"}" ) {
1718 common->
Printf(
" localizing map %s...\n", mapFileName.
c_str() );
1734 idStr out, ws, work;
1735 const char *buffer =
NULL;
1744 src.
LoadMemory( buffer, strlen(buffer), fileName );
1747 common->
Printf(
"Processing %s\n", fileName );
1754 out +=
va(
"\"%s\"", token.
c_str() );
1758 if ( out.
Length() > 200000 ) {
1762 work = token.
Right( 6 );
1763 if ( token.
Icmp(
"text" ) == 0 || work.
Icmp(
"::text" ) == 0 || token.
Icmp(
"choices" ) == 0 ) {
1771 for ( k = 0; k < token.
Length(); k++ ) {
1776 }
else if ( ch ==
'\n' || ch ==
'\r' ) {
1785 }
else if ( token.
Icmp(
"comment" ) == 0 ) {
1793 for ( k = 0; k < token.
Length(); k++ ) {
1798 }
else if ( ch ==
'\n' || ch ==
'\r' ) {
1828 idStr fileName =
"map_localize.cfg";
1829 const char *buffer =
NULL;
1833 src.
LoadMemory( buffer, strlen(buffer), fileName );
1846 if ( token ==
"}" ) {
1852 listHash.
Set(classname, list);
1862 idStr fileName =
"guiparm_exclude.cfg";
1863 const char *buffer =
NULL;
1867 src.
LoadMemory( buffer, strlen(buffer), fileName );
1884 if(str.
Find(
"#str_") != -1) {
1896 if(testVal.
Find(
"#str_") != -1) {
1906 if(testVal.
Find(
"::") != -1) {
1911 if(testVal.
Find(
"/") != -1) {
1915 if(excludeList.
Find(testVal)) {
1927 for(
int i = 0;
i < dirList.
Num();
i++) {
1928 if(dirList[
i] ==
"." || dirList[
i] ==
"..") {
1931 idStr fullName =
va(
"%s/%s", dir, dirList[
i].c_str());
1937 for(
int i = 0;
i < fileList.
Num();
i++) {
1938 idStr fullName =
va(
"%s/%s", dir, fileList[
i].c_str());
1945 common->
Printf(
"Localizing Map '%s'\n", mapName);
1950 if ( map.
Parse(mapName,
false,
false ) ) {
1952 for (
int j = 0;
j <
count;
j++ ) {
1959 bool hasLocation =
false;
1962 listHash.
Get(classname, &list);
1965 for(
int k = 0; k < list->
Num(); k++) {
1969 if(val.
Length() && classname ==
"info_location" && (*list)[k] ==
"location") {
1975 if(!hasLocation || (*list)[k] ==
"location") {
1984 listHash.
Get(
"all", &list);
1986 for(
int k = 0; k < list->
Num(); k++) {
2008 if(writeFile && strCount > 0) {
2015 map.
Write( mapName,
".map" );
2019 common->
Printf(
"Count: %d\n", strCount);
2029 if ( args.
Argc() < 2 ) {
2030 common->
Printf(
"Usage: localizeMaps <count | dictupdate | all> <map>\n" );
2037 bool dictUpdate =
false;
2050 common->
Printf(
"Invalid Command\n" );
2051 common->
Printf(
"Usage: localizeMaps <count | dictupdate | all>\n" );
2058 if(strTable.
Load( filename ) ==
false) {
2071 if(args.
Argc() == 3) {
2072 strCount +=
LocalizeMap(args.
Argv(2), strTable, listHash, excludeList, write);
2075 GetFileList(
"z:/d3xp/d3xp/maps/game",
"*.map", files);
2076 for (
int i = 0;
i < files.
Num();
i++ ) {
2078 strCount +=
LocalizeMap(file, strTable, listHash, excludeList, write);
2083 common->
Printf(
"Localize String Count: %d\n", strCount);
2089 strTable.
Save( filename );
2100 if ( args.
Argc() != 2 ) {
2101 common->
Printf(
"Usage: localizeGuis <all | gui>\n" );
2108 if(strTable.
Load( filename ) ==
false) {
2140 strTable.
Save( filename );
2154 GetFileList(
"z:/d3xp/d3xp/maps/game",
"*.map", files);
2156 for (
int i = 0;
i < files.
Num();
i++ ) {
2158 common->
Printf(
"Testing Map '%s'\n", files[
i].c_str());
2162 if ( map.
Parse(file,
false,
false ) ) {
2164 for (
int j = 0;
j <
count;
j++ ) {
2201 GetFileList(
"z:/d3xp/d3xp/maps/game",
"*.map", files);
2203 for (
int i = 0;
i < files.
Num();
i++ ) {
2205 common->
Printf(
"Testing Map '%s'\n", files[
i].c_str());
2209 if ( map.
Parse(file,
false,
false ) ) {
2211 for (
int j = 0;
j <
count;
j++ ) {
2229 bool hasLocation =
false;
2232 listHash.
Get(classname, &list);
2235 for(
int k = 0; k < list->
Num(); k++) {
2239 if(classname ==
"info_location" && (*list)[k] ==
"location") {
2245 if(!hasLocation || (*list)[k] ==
"location") {
2253 listHash.
Get(
"all", &list);
2255 for(
int k = 0; k < list->
Num(); k++) {
2300 common->
Printf(
"\nCommonly used commands:\n" );
2301 common->
Printf(
" spawnServer - start the server.\n" );
2302 common->
Printf(
" disconnect - shut down the server.\n" );
2303 common->
Printf(
" listCmds - list all console commands.\n" );
2304 common->
Printf(
" listCVars - list all console variables.\n" );
2305 common->
Printf(
" kick - kick a client by number.\n" );
2306 common->
Printf(
" gameKick - kick a client by name.\n" );
2307 common->
Printf(
" serverNextMap - immediately load next map.\n" );
2308 common->
Printf(
" serverMapRestart - restart the current map.\n" );
2309 common->
Printf(
" serverForceReady - force all players to ready status.\n" );
2310 common->
Printf(
"\nCommonly used variables:\n" );
2311 common->
Printf(
" si_name - server name (change requires a restart to see)\n" );
2312 common->
Printf(
" si_gametype - type of game.\n" );
2313 common->
Printf(
" si_fragLimit - max kills to win (or lives in Last Man Standing).\n" );
2314 common->
Printf(
" si_timeLimit - maximum time a game will last.\n" );
2315 common->
Printf(
" si_warmup - do pre-game warmup.\n" );
2316 common->
Printf(
" si_pure - pure server.\n" );
2317 common->
Printf(
" g_mapCycle - name of .scriptcfg file for cycling maps.\n" );
2318 common->
Printf(
"See mapcycle.scriptcfg for an example of a mapcyle script.\n\n" );
2337 #if !defined( ID_DEMO_BUILD ) && !defined( ID_DEDICATED )
2348 #ifdef ID_ALLOW_TOOLS
2414 if ( !( msg && *msg ) ) {
2419 int len = strlen( msg );
2473 static int lastTime;
2475 int com_frameMsec = nowTime - lastTime;
2490 FatalError(
"idCommon::Frame: the FPU stack is not empty at the end of the frame\n" );
2542 static const int MAX_ASYNC_STATS = 1024;
2553 memset( stat, 0,
sizeof( *stat ) );
2590 if ( !lastTicMsec ) {
2604 if ( timescale != 1.0f ) {
2605 ticMsec /= timescale;
2606 if ( ticMsec < 1 ) {
2612 if ( timescale == 1.0f ) {
2618 while ( lastTicMsec + ticMsec <= msec ) {
2620 lastTicMsec += ticMsec;
2639 if ( !dllPath[ 0 ] ) {
2640 common->
FatalError(
"couldn't find game dynamic library" );
2643 common->
DPrintf(
"Loading game DLL: '%s'\n", dllPath );
2646 common->
FatalError(
"couldn't load game dynamic library" );
2651 if ( !GetGameAPI ) {
2654 common->
FatalError(
"couldn't find game DLL API" );
2678 common->
FatalError(
"wrong game DLL API version" );
2682 game = gameExport.
game;
2688 if ( game !=
NULL ) {
2701 if ( game !=
NULL ) {
2736 bool oldCard =
false;
2737 bool nv10or20 =
false;
2741 Printf(
"Detected\n \t%.2f GHz CPU\n\t%i MB of System memory\n\t%i MB of Video memory on %s\n\n", ghz, sysRam, vidRam, ( oldCard ) ?
"a less than optimal video architecture" :
"an optimal video architecture" );
2743 if ( ghz >= 2.75f && vidRam >= 512 && sysRam >= 1024 && !oldCard ) {
2744 Printf(
"This system qualifies for Ultra quality!\n" );
2746 }
else if ( ghz >= ( ( cpu &
CPUID_AMD ) ? 1.9f : 2.19f ) && vidRam >= 256 && sysRam >= 512 && !oldCard ) {
2747 Printf(
"This system qualifies for High quality!\n" );
2749 }
else if ( ghz >= ( ( cpu & CPUID_AMD ) ? 1.1f : 1.25f ) && vidRam >= 128 && sysRam >= 384 ) {
2750 Printf(
"This system qualifies for Medium quality.\n" );
2753 Printf(
"This system qualifies for Low quality.\n" );
2828 #ifdef ID_WRITE_VERSION
2845 Printf(
"--- Common Initialization Complete ---\n" );
2851 Printf(
"\nType 'help' for dedicated server info.\n\n" );
2863 Sys_Error(
"Error during initialization" );
2898 #ifdef ID_WRITE_VERSION
2899 delete config_compressor;
2900 config_compressor =
NULL;
2934 bool sysDetect = ( file ==
NULL );
void Mem_EnableLeakTest(const char *name)
bool TestMapVal(idStr &str)
virtual bool IsOpenGLRunning(void) const =0
idNetworkSystem * networkSystem
void Com_WriteConfig_f(const idCmdArgs &args)
virtual void SetCVarInteger(const char *name, const int value, int flags=0)=0
virtual const char * KeysFromBinding(const char *bind)
idCVar com_logFileName("logFileName","qconsole.log", CVAR_SYSTEM|CVAR_NOCHEAT,"name of log file, if empty, qconsole.log will be used")
static void ArgCompletion_MapName(const idCmdArgs &args, void(*callback)(const char *s))
idMapEntity * GetEntity(int i) const
GLsizei const GLfloat * value
virtual void EndFrame(int *frontEndMsec, int *backEndMsec)=0
static void Shutdown(void)
void GetFileList(const char *dir, const char *ext, idStrList &list)
double Sys_ClockTicksPerSecond(void)
idCVar com_logFile("logFile","0", CVAR_SYSTEM|CVAR_NOCHEAT,"1 = buffer log, 2 = flush after each print", 0, 2, idCmdSystem::ArgCompletion_Integer< 0, 2 >)
virtual void Shutdown(void)
assert(prefInfo.fullscreenBtn)
idCVar com_showSoundDecoders("com_showSoundDecoders","0", CVAR_BOOL|CVAR_SYSTEM|CVAR_NOCHEAT,"show sound decoders")
idCVar com_skipRenderer("com_skipRenderer","0", CVAR_BOOL|CVAR_SYSTEM,"skip the renderer completely")
idCVarSystem * cvarSystem
idNetworkSystem * networkSystem
static void ShutDown(void)
virtual void ClearBuffer(void)=0
void Com_ExecMachineSpec_f(const idCmdArgs &args)
idRenderSystem * renderSystem
void OSX_GetVideoCard(int &outVendorId, int &outDeviceId)
virtual void virtual void virtual const idLangDict * GetLanguageDict(void)=0
virtual void GuiFrameEvents()=0
int RunEventLoop(bool commandExecution=true)
virtual bool IsInitialized(void) const =0
#define MAX_CONSOLE_LINES
idCVar com_timescale("timescale","1", CVAR_SYSTEM|CVAR_FLOAT,"scales the time", 0.1f, 10.0f)
GLenum GLsizei GLenum format
void Sys_InitNetworking(void)
float GetFloat(void) const
void SetMachineSpec(void)
void ParticleEditorInit(const idDict *spawnArgs)
virtual void ForceFlush(void)
const idStr & GetKey(void) const
static void ListKeys_f(const idCmdArgs &args)
virtual void CacheDictionaryMedia(const idDict *dict)=0
virtual void Shutdown(void)=0
void PrintLoadingMessage(const char *msg)
virtual void UsercmdInterrupt(void)=0
idDeclManager * declManager
static void Test_f(const class idCmdArgs &args)
idCVar com_showMemoryUsage("com_showMemoryUsage","0", CVAR_BOOL|CVAR_SYSTEM|CVAR_NOCHEAT,"show total and per frame memory usage")
idCVar com_preciseTic("com_preciseTic","1", CVAR_BOOL|CVAR_SYSTEM,"run one game tick every async thread update")
virtual int ReadFile(const char *relativePath, void **buffer, ID_TIME_T *timestamp=NULL)=0
int serverPacketsReceived
void Com_StartBuild_f(const idCmdArgs &args)
idCVar com_purgeAll("com_purgeAll","0", CVAR_BOOL|CVAR_ARCHIVE|CVAR_SYSTEM,"purge everything between level loads")
int GetNumFiles(void) const
bool com_fullyInitialized
virtual void WriteFlaggedVariables(int flags, const char *setCmd, idFile *f) const =0
virtual const char * BindingFromKey(const char *key)
const idStrList & GetList(void) const
void Sys_Printf(const char *msg,...)
void Dmap_f(const idCmdArgs &args)
void Com_LocalizeGuis_f(const idCmdArgs &args)
void Com_LocalizeMapsTest_f(const idCmdArgs &args)
idCVar com_showAsyncStats("com_showAsyncStats","0", CVAR_BOOL|CVAR_SYSTEM|CVAR_NOCHEAT,"show async network stats")
virtual int GetCVarInteger(const char *name) const =0
static idAsyncClient client
const char ** GetArgs(int *argc)
virtual int AsyncUpdate(int time)=0
idRenderSystem * renderSystem
void Sys_DLL_Unload(int handle)
void SoundEditorInit(const idDict *spawnArgs)
void LocalizeSpecificMapData(const char *fileName, idLangDict &langDict, const idLangDict &replaceArgs)
virtual void CopyFile(const char *fromOSPath, const char *toOSPath)=0
int Sys_Milliseconds(void)
const idKeyValue * MatchPrefix(const char *prefix, const idKeyValue *lastMatch=NULL) const
static void ArgCompletion_ModelName(const idCmdArgs &args, void(*callback)(const char *s))
virtual void Shutdown(void)=0
virtual void WriteConfigToFile(const char *filename)
idFileSystem * fileSystem
virtual idFile * OpenExplicitFileRead(const char *OSPath)=0
idCVar com_machineSpec("com_machineSpec","-1", CVAR_INTEGER|CVAR_ARCHIVE|CVAR_SYSTEM,"hardware classification, -1 = not detected, 0 = low quality, 1 = medium quality, 2 = high quality, 3 = ultra quality")
idCVar com_developer("developer","0", CVAR_BOOL|CVAR_SYSTEM|CVAR_NOCHEAT,"developer mode")
void InitRenderSystem(void)
idCVar com_showFPS("com_showFPS","0", CVAR_BOOL|CVAR_SYSTEM|CVAR_ARCHIVE|CVAR_NOCHEAT,"show frames rendered per second")
char errorMessage[MAX_PRINT_MSG_SIZE]
idCVar com_asyncInput("com_asyncInput","0", CVAR_BOOL|CVAR_SYSTEM,"sample input from the async thread")
void Com_Help_f(const idCmdArgs &args)
virtual void Init(void)=0
void RunAASDir_f(const idCmdArgs &args)
virtual void ExecuteCommandBuffer(void)=0
idSoundSystem * soundSystem
void AFEditorInit(const idDict *spawnArgs)
gameExport_t *(* GetGameAPI_t)(gameImport_t *import)
virtual idFile * OpenFileAppend(const char *filename, bool sync=false, const char *basePath="fs_basepath")=0
volatile int com_ticNumber
bool OSX_GetCPUIdentification(int &cpuId, bool &oldArchitecture)
virtual void InitTool(const toolFlag_t tool, const idDict *dict)
const char * Left(int len, idStr &result) const
idCVar com_forceGenericSIMD("com_forceGenericSIMD","0", CVAR_BOOL|CVAR_SYSTEM|CVAR_NOCHEAT,"force generic platform independent SIMD")
virtual void SetCVarString(const char *name, const char *value, int flags=0)=0
void LocalizeGui(const char *fileName, idLangDict &langDict)
void FinishBuild(bool removeDups=false)
virtual bool CDKeysAreValid(bool strict)=0
static void ShowMemoryUsage_f(const idCmdArgs &args)
virtual void Init(void)=0
virtual const idMaterial * FindMaterial(const char *name, bool makeDefault=true)=0
virtual void StartMenu(bool playIntro=false)=0
virtual void SetRefreshOnPrint(bool set)
idStr & DefaultFileExtension(const char *extension)
void Set(const char *key, const char *value)
void Sys_GenerateEvents(void)
virtual void ActivateTool(bool active)
virtual int ButtonState(int key)
virtual void Init(void)=0
idUserInterfaceManager * uiManager
virtual void BeginFrame(int windowWidth, int windowHeight)=0
idFileSystem * fileSystem
virtual void FreeFile(void *buffer)=0
idAASFileManager * AASFileManager
const char * Sys_FPU_GetState(void)
virtual void ClearWarnings(const char *reason)
const char * AddString(const char *str)
virtual int ButtonState(int key)=0
int Icmp(const char *text) const
virtual void Error(const char *fmt,...) id_attribute((format(printf
void ShutdownGame(bool reloading)
virtual void WriteCDKey(void)=0
idCVar developer("developer","0", CVAR_GAME|CVAR_BOOL,"")
void RoQFileEncode_f(const idCmdArgs &args)
static idCompressor * AllocArithmetic(void)
idCVar com_memoryMarker("com_memoryMarker","-1", CVAR_INTEGER|CVAR_SYSTEM|CVAR_INIT,"used as a marker for memory stats")
int Icmpn(const char *text, int n) const
virtual void Init(void)=0
virtual idSoundWorld * GetPlayingSoundWorld(void)=0
virtual void BufferCommandText(cmdExecution_t exec, const char *text)=0
void Set(const char *key, Type &value)
virtual void Init(void)=0
idCVar com_makingBuild("com_makingBuild","0", CVAR_BOOL|CVAR_SYSTEM,"1 when making a build")
void Sort(cmp_t *compare=(cmp_t *)&idListSortCompare< type >)
int Sys_ListFiles(const char *directory, const char *extension, idStrList &list)
const int SMALLCHAR_WIDTH
virtual void Printf(const char *fmt,...) id_attribute((format(printf
virtual void Init(void)=0
bool Sys_FPU_StackIsEmpty(void)
GLuint GLuint GLsizei count
static bool IsActive(void)
void Mem_Dump_f(const idCmdArgs &args)
virtual void BeginRedirect(char *buffer, int buffersize, void(*flush)(const char *))
virtual void Print(const char *text)=0
static class idFileSystem * fileSystem
static void ListValues_f(const idCmdArgs &args)
void LoadGuiParmExcludeList(idStrList &list)
void AppendArg(const char *text)
#define MAX_PRINT_MSG_SIZE
const char * GetString(const char *key, const char *defaultString="") const
void Sys_ShowConsole(int visLevel, bool quitOnClose)
static idAsyncServer server
virtual void Shutdown()=0
static idStr FormatNumber(int number)
idCVar com_asyncSound("com_asyncSound","1", CVAR_INTEGER|CVAR_SYSTEM, ASYNCSOUND_INFO, 0, 1)
virtual void Init(int argc, const char **argv, const char *cmdline)
int GetNumEntities(void) const
int LocalizeMap(const char *mapName, idLangDict &langDict, ListHash &listHash, idStrList &excludeList, bool writeFile)
bool Parse(const char *filename, bool ignoreRegion=false, bool osPath=false)
bool AddStartupCommands(void)
void ScriptEditorInit(const idDict *spawnArgs)
void Com_ReloadLanguage_f(const idCmdArgs &args)
const char * GetDataPtr(void) const
void(* rd_flush)(const char *buffer)
void WriteConfiguration(void)
virtual int DLL_Load(const char *dllName)=0
void PDAEditorInit(const idDict *spawnArgs)
virtual void DrawSmallStringExt(int x, int y, const char *string, const idVec4 &setColor, bool forceColor, const idMaterial *material)=0
void MaterialEditorInit(void)
Initializes the material editor tool.
const idLangKeyValue * GetKeyVal(int i) const
virtual const char * GetCVarString(const char *name) const =0
idCVar com_product_lang_ext("com_product_lang_ext","1", CVAR_INTEGER|CVAR_SYSTEM|CVAR_ARCHIVE,"Extension to use when creating language files.")
void LoadMapLocalizeData(ListHash &listHash)
virtual void PrintMemInfo(MemInfo_t *mi)=0
bool Write(const char *fileName, const char *ext, bool fromBasePath=true)
void SetInteger(const int value)
void * Sys_DLL_GetProcAddress(int handle, const char *sym)
virtual void Init(void)=0
virtual void SetCVarBool(const char *name, const bool value, int flags=0)=0
int GetInteger(void) const
int Sys_GetSystemRam(void)
idImageManager * globalImages
virtual void Shutdown(void)=0
virtual void virtual void FatalError(const char *fmt,...) id_attribute((format(printf
virtual void virtual void virtual void virtual void PrintWarnings(void)
virtual idFile * OpenFileWrite(const char *relativePath, const char *basePath="fs_savepath")=0
const char * GetFile(int index) const
virtual int AsyncUpdateWrite(int time)=0
virtual void virtual void virtual void DWarning(const char *fmt,...) id_attribute((format(printf
virtual int KeyState(int key)
const char * GetString(const char *str) const
idCVar com_speeds("com_speeds","0", CVAR_BOOL|CVAR_SYSTEM|CVAR_NOCHEAT,"show engine timings")
virtual bool IsInitialized(void) const
virtual int GetScreenWidth(void) const =0
virtual void virtual void virtual const idLangDict * GetLanguageDict(void)
type * Find(type const &obj) const
bool Load(const char *fileName, bool clear=true)
void LocalizeMapData(const char *fileName, idLangDict &langDict)
static void ShowMemoryUsage_f(const idCmdArgs &args)
const idStr & GetValue(void) const
static idCVar serverDedicated
void InitLanguageDict(void)
virtual void Shutdown(void)=0
static void InitProcessor(const char *module, bool forceGeneric)
void Com_FinishBuild_f(const idCmdArgs &args)
const char * Right(int len, idStr &result) const
virtual const char * GetCurrentMapName(void)=0
int Find(const char c, int start=0, int end=-1) const
virtual void FreeFileList(idFileList *fileList)=0
idUsercmdGen * usercmdGen
void Com_ReloadEngine_f(const idCmdArgs &args)
idStr & RemoveColors(void)
virtual void virtual void Warning(const char *fmt,...) id_attribute((format(printf
virtual int GetScreenHeight(void) const =0
idUserInterfaceManager * uiManager
virtual void InitOpenGL(void)=0
asyncStats_t com_asyncStats[MAX_ASYNC_STATS]
static void RegisterStaticVars(void)
virtual void UpdateScreen(bool outOfSequence=true)=0
virtual void Shutdown(void)=0
virtual void Printf(const char *fmt,...) id_attribute((format(printf
int LoadMemory(const char *ptr, int length, const char *name, int startLine=1)
virtual void DrawStretchPic(const idDrawVert *verts, const glIndex_t *indexes, int vertCount, int indexCount, const idMaterial *material, bool clip=true, float min_x=0.0f, float min_y=0.0f, float max_x=640.0f, float max_y=480.0f)=0
const char * c_str() const
virtual void GUIFrame(bool execCmd, bool network)
idDeclManager * declManager
virtual void virtual void FatalError(const char *fmt,...) id_attribute((format(printf
idCVar com_allowConsole("com_allowConsole","0", CVAR_BOOL|CVAR_SYSTEM|CVAR_NOCHEAT,"allow toggling console with the tilde key")
virtual const char * RelativePathToOSPath(const char *relativePath, const char *basePath="fs_devpath")=0
virtual void EndRedirect(void)
idAASFileManager * AASFileManager
void DeclBrowserInit(const idDict *spawnArgs)
void Com_SetMachineSpec_f(const idCmdArgs &args)
int mostRecentServerPacketSequence
void Mem_DumpCompressed_f(const idCmdArgs &args)
bool TestGuiParm(const char *parm, const char *value, idStrList &excludeList)
bool Get(const char *key, Type **value=NULL) const
void TokenizeString(const char *text, bool keepAsStrings)
const char * GetString(void) const
bool IsNumeric(void) const
int ExpectTokenString(const char *string)
gameExport_t * GetGameAPI(gameImport_t *import)
virtual void SetMute(bool mute)=0
virtual int GetModifiedFlags(void) const =0
int Append(const type &obj)
idCVar com_timestampPrints("com_timestampPrints","0", CVAR_SYSTEM,"print time with each console print, 1 = msec, 2 = sec", 0, 2, idCmdSystem::ArgCompletion_Integer< 0, 2 >)
virtual int KeyState(int key)=0
void Sys_ShowWindow(bool show)
idRenderModelManager * renderModelManager
idRenderModelManager * renderModelManager
void RunAAS_f(const idCmdArgs &args)
static int static int vsnPrintf(char *dest, int size, const char *fmt, va_list argptr)
virtual void PacifierUpdate()=0
int AddUnique(const type &obj)
int clientPacketsReceived
virtual bool IsInitialized(void) const =0
void Sys_SetClipboardData(const char *string)
void Append(const char a)
virtual void StartupVariable(const char *match, bool once)
virtual idFileList * ListFilesTree(const char *relativePath, const char *extension, bool sort=false, const char *gamedir=NULL)=0
bool RemoveIndex(int index)
virtual void Shutdown()=0
idCVar com_videoRam("com_videoRam","64", CVAR_INTEGER|CVAR_SYSTEM|CVAR_NOCHEAT|CVAR_ARCHIVE,"holds the last amount of detected video ram")
int GetLastWhiteSpace(idStr &whiteSpace) const
idSoundSystem * soundSystem
static void RunFrame(void)
virtual void ClearNotifyLines(void)=0
static class idCVarSystem * cvarSystem
virtual void LoadGraphics()=0
void AddKeyVal(const char *key, const char *val)
bool IsModified(void) const
virtual int Write(const void *buffer, int len)
idCmdArgs com_consoleLines[MAX_CONSOLE_LINES]
virtual void Shutdown(void)=0
virtual bool PostReloadEngine(void)=0
void RunReach_f(const idCmdArgs &args)
void Encode(const byte *from, int size)
virtual void PrintMemInfo(MemInfo_t *mi)=0
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
void Sys_SetFatalError(const char *error)
const char * c_str(void) const
void SingleAsyncTic(void)
bool Sys_AlreadyRunning(void)
void Sys_DoPreferences(void)
virtual void Shutdown(bool reloading)=0
void ParseCommandLine(int argc, const char **argv)
void RenderBump_f(const idCmdArgs &args)
virtual bool GetCVarBool(const char *name) const =0
void SetBool(const bool value)
void Sys_Error(const char *error,...)
const char * Argv(int arg) const
virtual void GetCardCaps(bool &oldCard, bool &nv10or20)=0
idCVarSystem * cvarSystem
#define EDITOR_WINDOWTEXT
virtual void DPrintf(const char *fmt,...) id_attribute((format(printf
virtual void Shutdown(void)=0
int Sys_GetVideoRam(void)
void Sys_InitScanTable(void)
virtual void SetRefreshOnPrint(bool set)=0
char * va(const char *fmt,...)
void Com_LocalizeMaps_f(const idCmdArgs &args)
struct tm * localtime(const time_t *)
idHashTable< idStrList > ListHash
const int GAME_API_VERSION
virtual void CloseFile(idFile *f)=0
virtual void DPrintf(const char *fmt,...) id_attribute((format(printf
virtual const char * OSPathToRelativePath(const char *OSPath)=0
void ClearCommandLine(void)
virtual void Shutdown(void)=0
virtual void FindDLL(const char *basename, char dllPath[MAX_OSPATH], bool updateChecksum)=0
idCommonLocal commonLocal
idCVar com_updateLoadSize("com_updateLoadSize","0", CVAR_BOOL|CVAR_SYSTEM|CVAR_NOCHEAT,"update the load size after loading a map")
void Com_LocalizeGuiParmsTest_f(const idCmdArgs &args)
void Sys_LeaveCriticalSection(int index)
virtual void Init(void)=0
void Sys_EnterCriticalSection(int index)
int ReadToken(idToken *token)
void RenderBumpFlat_f(const idCmdArgs &args)
int sprintf(idStr &string, const char *fmt,...)
virtual void ClearModifiedFlags(int flags)=0
virtual int Printf(const char *fmt,...) id_attribute((format(printf
idCVar com_version("si_version", version.string, CVAR_SYSTEM|CVAR_ROM|CVAR_SERVERINFO,"engine version")
idCollisionModelManager * collisionModelManager
void Save(const char *fileName)
void LightEditorInit(const idDict *spawnArgs)
virtual void AddCommand(const char *cmdName, cmdFunction_t function, int flags, const char *description, argCompletion_t argCompletion=NULL)=0
virtual void Init(void)=0
int GetNumKeyVals(void) const
cpuid_t Sys_GetProcessorId(void)
virtual void virtual void VPrintf(const char *fmt, va_list arg)
idCollisionModelManager * collisionModelManager
static class idCommon * common
void FilterLangList(idStrList *list, idStr lang)
virtual void WriteFlaggedCVarsToFile(const char *filename, int flags, const char *setCmd)
virtual void BufferCommandArgs(cmdExecution_t exec, const idCmdArgs &args)=0
void Sys_GrabMouseCursor(bool)
virtual void StopAllSounds(void)=0