MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / init

Method init

Engine/source/app/mainLoop.cpp:213–332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211}
212
213void StandardMainLoop::init()
214{
215 #ifdef TORQUE_DEBUG
216 gStartupTimer = PlatformTimer::create();
217 #endif
218
219 #ifdef TORQUE_DEBUG_GUARD
220 Memory::flagCurrentAllocs( Memory::FLAG_Global );
221 #endif
222
223 Platform::setMathControlStateKnown();
224
225 // Asserts should be created FIRST
226 PlatformAssert::create();
227
228 ManagedSingleton< ThreadManager >::createSingleton();
229 FrameAllocator::init(TORQUE_FRAME_SIZE); // See comments in torqueConfig.h
230
231 // Yell if we can't initialize the network.
232 if(!Net::init())
233 {
234 AssertISV(false, "StandardMainLoop::initCore - could not initialize networking!");
235 }
236
237 _StringTable::create();
238
239 // Set up the resource manager and get some basic file types in it.
240 Con::init();
241 Platform::initConsole();
242 NetStringTable::create();
243
244 // Use debug output logging on the Xbox and OSX builds
245#if defined( _XBOX ) || defined( TORQUE_OS_MAC )
246 DebugOutputConsumer::init();
247#endif
248
249 // init Filesystem first, so we can actually log errors for all components that follow
250 Platform::FS::InstallFileSystems(); // install all drives for now until we have everything using the volume stuff
251 Platform::FS::MountDefaults();
252
253 // Set our working directory.
254 Torque::FS::SetCwd( "game:/" );
255
256 // Set our working directory.
257 Platform::setCurrentDirectory( Platform::getMainDotCsDir() );
258
259 Processor::init();
260 Math::init();
261 Platform::init(); // platform specific initialization
262 RedBook::init();
263 Platform::initConsole();
264
265 ThreadPool::GlobalThreadPool::createSingleton();
266
267 // Set engineAPI initialized to true
268 engineAPI::gIsInitialized = true;
269
270 // Initialize modules.

Callers

nothing calls this directly

Calls 13

flagCurrentAllocsFunction · 0.85
MountDefaultsFunction · 0.85
SetCwdFunction · 0.85
openEmbeddedVFSArchiveFunction · 0.85
addVariableFunction · 0.85
setVariableFunction · 0.85
addListenerMethod · 0.80
pushObjectMethod · 0.80
initFunction · 0.50
insertMethod · 0.45
registerObjectMethod · 0.45
notifyMethod · 0.45

Tested by

no test coverage detected