mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 11:43:49 +00:00
Improvements based on experience from implementing Python runtime
This commit is contained in:
parent
e28e24a802
commit
83ea6cd0df
6 changed files with 67 additions and 188 deletions
|
|
@ -95,16 +95,12 @@ namespace TorqueScript
|
|||
//------------------------------------------------------------------------------
|
||||
Con::EvalResult TorqueScriptRuntime::evaluatef(const char* string, ...)
|
||||
{
|
||||
ConsoleStackFrameSaver stackSaver;
|
||||
stackSaver.save();
|
||||
|
||||
char buffer[4096];
|
||||
va_list args;
|
||||
va_start(args, string);
|
||||
dVsprintf(buffer, sizeof(buffer), string, args);
|
||||
va_end(args);
|
||||
CodeBlock* newCodeBlock = new CodeBlock();
|
||||
return newCodeBlock->compileExec(NULL, buffer, false, 0);
|
||||
return evaluate(buffer);
|
||||
}
|
||||
|
||||
bool TorqueScriptRuntime::executeFile(const char* fileName, bool noCalls, bool journalScript)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue