| 211 | } |
| 212 | |
| 213 | void 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. |
nothing calls this directly
no test coverage detected