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

Method pushFrame

Engine/source/console/consoleInternal.cpp:681–719  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

679}
680
681void ExprEvalState::pushFrame(StringTableEntry frameName, Namespace *ns, S32 registerCount)
682{
683#ifdef DEBUG_SPEW
684 validate();
685
686 Platform::outputDebugString("[ConsoleInternal] Pushing new frame for '%s' at %i",
687 frameName, mStackDepth);
688#endif
689
690 if (mStackDepth + 1 > stack.size())
691 {
692#ifdef DEBUG_SPEW
693 Platform::outputDebugString("[ConsoleInternal] Growing stack by one frame");
694#endif
695
696 stack.push_back(new Dictionary);
697 }
698
699 Dictionary& newFrame = *(stack[mStackDepth]);
700 newFrame.setState(this);
701
702 newFrame.scopeName = frameName;
703 newFrame.scopeNamespace = ns;
704
705 mStackDepth++;
706 currentVariable = NULL;
707
708 AssertFatal(!newFrame.getCount(), "ExprEvalState::pushFrame - Dictionary not empty!");
709
710 ConsoleValue* consoleValArray = new ConsoleValue[registerCount]();
711 localStack.push_back(ConsoleValueFrame(consoleValArray, false));
712 currentRegisterArray = &localStack.last();
713
714 AssertFatal(mStackDepth == localStack.size(), avar("Stack sizes do not match. mStackDepth = %d, localStack = %d", mStackDepth, localStack.size()));
715
716#ifdef DEBUG_SPEW
717 validate();
718#endif
719}
720
721void ExprEvalState::popFrame()
722{

Callers 3

execMethod · 0.45
saveMethod · 0.45
TESTFunction · 0.45

Calls 8

validateFunction · 0.85
ConsoleValueFrameClass · 0.85
avarFunction · 0.85
sizeMethod · 0.45
push_backMethod · 0.45
setStateMethod · 0.45
getCountMethod · 0.45
lastMethod · 0.45

Tested by 1

TESTFunction · 0.36