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

Function init

Engine/source/console/console.cpp:309–378  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

307void postConsoleInput( RawData data );
308
309void init()
310{
311 AssertFatal(active == false, "Con::init should only be called once.");
312
313 // Set up general init values.
314 active = true;
315 logFileName = NULL;
316 newLogFile = true;
317 gWarnUndefinedScriptVariables = false;
318
319 // Initialize subsystems.
320 Namespace::init();
321 ConsoleConstructor::setup();
322
323 // Set up the parser(s)
324 CON_ADD_PARSER(CMD, "cs", true); // TorqueScript
325
326 // Setup the console types.
327 ConsoleBaseType::initialize();
328
329 // And finally, the ACR...
330 AbstractClassRep::initialize();
331
332 // Variables
333 setVariable("Con::prompt", "% ");
334 addVariable("Con::logBufferEnabled", TypeBool, &logBufferEnabled, "If true, the log buffer will be enabled.\n"
335 "@ingroup Console\n");
336 addVariable("Con::printLevel", TypeS32, &printLevel,
337 "@brief This is deprecated.\n\n"
338 "It is no longer in use and does nothing.\n"
339 "@ingroup Console\n");
340 addVariable("Con::warnUndefinedVariables", TypeBool, &gWarnUndefinedScriptVariables, "If true, a warning will be displayed in the console whenever a undefined variable is used in script.\n"
341 "@ingroup Console\n");
342 addVariable( "instantGroup", TypeRealString, &gInstantGroup, "The group that objects will be added to when they are created.\n"
343 "@ingroup Console\n");
344
345 addVariable("Con::objectCopyFailures", TypeS32, &gObjectCopyFailures, "If greater than zero then it counts the number of object creation "
346 "failures based on a missing copy object and does not report an error..\n"
347 "@ingroup Console\n");
348
349 // Current script file name and root
350 addVariable( "Con::File", TypeString, &gCurrentFile, "The currently executing script file.\n"
351 "@ingroup FileSystem\n");
352 addVariable( "Con::Root", TypeString, &gCurrentRoot, "The mod folder for the currently executing script file.\n"
353 "@ingroup FileSystem\n" );
354
355 // alwaysUseDebugOutput determines whether to send output to the platform's
356 // "debug" system. see winConsole for an example.
357 // in ship builds we don't expose this variable to script
358 // and we set it to false by default (don't want to provide more information
359 // to potential hackers). platform code should also ifdef out the code that
360 // pays attention to this in ship builds (see winConsole.cpp)
361 // note that enabling this can slow down your game
362 // if you are running from the debugger and printing a lot of console messages.
363#ifndef TORQUE_SHIPPING
364 addVariable("Con::alwaysUseDebugOutput", TypeBool, &alwaysUseDebugOutput,
365 "@brief Determines whether to send output to the platform's \"debug\" system.\n\n"
366 "@note This is disabled in shipping builds.\n"

Callers 15

consoleRegisterMethod · 0.70
initMethod · 0.70
ConsoleConstructorMethod · 0.70
ConsoleLoggerMethod · 0.70
processArgumentsMethod · 0.70
attachMethod · 0.70
detachMethod · 0.70
logMethod · 0.70
sim.cppFile · 0.70
ConsoleValueMethod · 0.70
importSequencesMethod · 0.50
TSPartInstanceMethod · 0.50

Calls 3

setVariableFunction · 0.85
addVariableFunction · 0.85
notifyMethod · 0.45

Tested by

no test coverage detected