MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / PreInitD3Systems

Function PreInitD3Systems

Descent3/init.cpp:1045–1118  ·  view source on GitHub ↗

Initializes all the subsystems that need to be initialized BEFORE application creation. Returns 1 if all is good, 0 if something is wrong */

Source from the content-addressed store, hash-verified

1043 Returns 1 if all is good, 0 if something is wrong
1044*/
1045void PreInitD3Systems() {
1046 // initialize error system
1047 bool debugging = false;
1048
1049#ifndef RELEASE
1050
1051 debugging = (FindArg("-debug") != 0);
1052
1053 if (FindArg("-logfile"))
1054 Debug_Logfile("d3.log");
1055
1056#endif
1057
1058#ifdef DAJ_DEBUG
1059 debugging = true;
1060#endif
1061
1062 error_Init(debugging, PRODUCT_NAME);
1063
1064 if (FindArg("-lowmem"))
1065 Mem_low_memory_mode = true;
1066 if (FindArg("-superlowmem"))
1067 Mem_low_memory_mode = Mem_superlow_memory_mode = true;
1068 if (FindArg("-dedicated"))
1069 Mem_low_memory_mode = true;
1070 mem_Init();
1071 if (FindArg("-himem")) {
1072 Mem_low_memory_mode = false;
1073 Mem_superlow_memory_mode = false;
1074 }
1075 // For the client and the server, this turns off the bitmap exchange system.
1076 if (FindArg("-nomultibmp"))
1077 Use_file_xfer = 0;
1078
1079 int iframelmtarg = FindArg("-limitframe");
1080 if (iframelmtarg) {
1081 Min_allowed_frametime = atoi(GameArgs[iframelmtarg + 1]);
1082 mprintf(0, "Using %d as a minimum frametime\n", Min_allowed_frametime);
1083 } else {
1084 if (FindArg("-dedicated"))
1085 Min_allowed_frametime = 30;
1086 else
1087 Min_allowed_frametime = 0;
1088 }
1089 iframelmtarg = FindArg("-framecap");
1090 if (iframelmtarg) {
1091 Min_allowed_frametime = ((float)1.0 / (float)atoi(GameArgs[iframelmtarg + 1])) * 1000;
1092 mprintf(0, "Using %d as a minimum frametime\n", Min_allowed_frametime);
1093 } else {
1094 // Default to a framecap of 60
1095 Min_allowed_frametime = (1.0 / 60.0) * 1000;
1096 mprintf(0, "Using default framecap of 60\n");
1097 }
1098
1099 // Mouselook sensitivity!
1100 int msensearg = FindArg("-mlooksens");
1101 if (msensearg) {
1102 Mouselook_sensitivity = kAnglesPerDegree * atof(GameArgs[msensearg + 1]);

Callers 2

OnCreateClientMethod · 0.85
mainFunction · 0.85

Calls 6

Debug_LogfileFunction · 0.85
error_InitFunction · 0.85
mem_InitFunction · 0.85
grtext_InitFunction · 0.85
SetMessageBoxTitleFunction · 0.85
FindArgFunction · 0.70

Tested by

no test coverage detected