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

Function init

Engine/source/console/console.cpp:341–415  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

339void postConsoleInput( RawData data );
340
341void init()
342{
343 AssertFatal(active == false, "Con::init should only be called once.");
344
345 // Set up general init values.
346 active = true;
347 logFileName = NULL;
348 newLogFile = true;
349 gWarnUndefinedScriptVariables = false;
350
351 // Initialize subsystems.
352 Namespace::init();
353 ConsoleConstructor::setup();
354
355 // Set up the parser(s)
356 CON_ADD_PARSER(CMD, (char*)TORQUE_SCRIPT_EXTENSION, true); // TorqueScript
357
358 // Setup the console types.
359 ConsoleBaseType::initialize();
360 ConsoleValue::init();
361
362 // And finally, the ACR...
363 AbstractClassRep::initialize();
364
365 // Variables
366 setVariable("Con::prompt", "% ");
367 addVariable("Con::logBufferEnabled", TypeBool, &logBufferEnabled, "If true, the log buffer will be enabled.\n"
368 "@ingroup Console\n");
369 addVariable("Con::printLevel", TypeS32, &printLevel,
370 "@brief This is deprecated.\n\n"
371 "It is no longer in use and does nothing.\n"
372 "@ingroup Console\n");
373 addVariable("Con::warnUndefinedVariables", TypeBool, &gWarnUndefinedScriptVariables, "If true, a warning will be displayed in the console whenever a undefined variable is used in script.\n"
374 "@ingroup Console\n");
375 addVariable( "instantGroup", TypeRealString, &gInstantGroup, "The group that objects will be added to when they are created.\n"
376 "@ingroup Console\n");
377 addVariable("Con::objectCopyFailures", TypeS32, &gObjectCopyFailures, "If greater than zero then it counts the number of object creation "
378 "failures based on a missing copy object and does not report an error..\n"
379 "@ingroup Console\n");
380 addVariable("Con::scriptWarningsAsAsserts", TypeBool, &scriptWarningsAsAsserts, "If true, script warnings (outside of syntax errors) will be treated as fatal asserts.");
381
382 // Current script file name and root
383 addVariable( "Con::File", TypeString, &gCurrentFile, "The currently executing script file.\n"
384 "@ingroup FileSystem\n");
385 addVariable( "Con::Root", TypeString, &gCurrentRoot, "The mod folder for the currently executing script file.\n"
386 "@ingroup FileSystem\n" );
387
388 // alwaysUseDebugOutput determines whether to send output to the platform's
389 // "debug" system. see winConsole for an example.
390 // in ship builds we don't expose this variable to script
391 // and we set it to false by default (don't want to provide more information
392 // to potential hackers). platform code should also ifdef out the code that
393 // pays attention to this in ship builds (see winConsole.cpp)
394 // note that enabling this can slow down your game
395 // if you are running from the debugger and printing a lot of console messages.
396#ifndef TORQUE_SHIPPING
397 addVariable("Con::alwaysUseDebugOutput", TypeBool, &alwaysUseDebugOutput,
398 "@brief Determines whether to send output to the platform's \"debug\" system.\n\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
afxMagicSpellMethod · 0.50
afxEffectronMethod · 0.50
afxMagicMissileMethod · 0.50

Calls 4

setVariableFunction · 0.85
addVariableFunction · 0.85
setupFunction · 0.50
notifyMethod · 0.45

Tested by

no test coverage detected