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

Function setFloatVariable

Engine/source/console/console.cpp:856–873  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

854}
855
856void setFloatVariable(const char *varName, F32 value)
857{
858 SimObject *obj = NULL;
859 const char *objField = NULL;
860
861 if (getVariableObjectField(varName, &obj, &objField))
862 {
863 char scratchBuffer[32];
864 dSprintf(scratchBuffer, sizeof(scratchBuffer), "%g", value);
865 obj->setDataField(StringTable->insert(objField), 0, scratchBuffer);
866 }
867 else
868 {
869 varName = prependDollar(varName);
870 Dictionary::Entry *entry = getAddVariableEntry(varName);
871 entry->setFloatValue(value);
872 }
873}
874
875//---------------------------------------------------------------------------
876void addConsumer(ConsumerCallback consumer)

Callers 4

_setupConstantsMethod · 0.85
processTimeEventFunction · 0.85
setFloatVariableMethod · 0.85
_updateThumbMethod · 0.85

Calls 7

getVariableObjectFieldFunction · 0.85
dSprintfFunction · 0.85
prependDollarFunction · 0.85
getAddVariableEntryFunction · 0.85
setDataFieldMethod · 0.45
insertMethod · 0.45
setFloatValueMethod · 0.45

Tested by

no test coverage detected