Browse Source

* BugFix: Fix a missing <vector> include for GCC.
* BugFix: Correct some globally used local variables in the editor code.

Robert MacGregor 4 years ago
parent
commit
5cce344bb1
2 changed files with 6 additions and 3 deletions
  1. 1 0
      Engine/source/console/codeBlock.h
  2. 5 3
      Engine/source/gui/editor/inspector/field.cpp

+ 1 - 0
Engine/source/console/codeBlock.h

@@ -23,6 +23,7 @@
 #ifndef _CODEBLOCK_H_
 #define _CODEBLOCK_H_
 
+#include <vector>
 #include <unordered_map>
 
 struct CompilerLocalVariableToRegisterMappingTable

+ 5 - 3
Engine/source/gui/editor/inspector/field.cpp

@@ -318,7 +318,8 @@ void GuiInspectorField::setData( const char* data, bool callbacks )
          {
             char buffer[ 2048 ];
             expandEscape( buffer, newValue );
-            newValue = (const char*)Con::evaluatef( "%%f = \"%s\"; return ( %s );", oldValue.c_str(), buffer );
+            newValue = (const char*)Con::evaluatef( "$f = \"%s\"; return ( %s );", oldValue.c_str(), buffer );
+            Con::evaluatef("$f=0;");
          }
          else if(    type == TypeS32Vector
                   || type == TypeF32Vector
@@ -353,9 +354,10 @@ void GuiInspectorField::setData( const char* data, bool callbacks )
                char buffer[ 2048 ];
                expandEscape( buffer, newComponentExpr );
 
-               const char* newComponentVal = Con::evaluatef( "%%f = \"%s\"; %%v = \"%s\"; return ( %s );",
+               const char* newComponentVal = Con::evaluatef( "$f = \"%s\"; $v = \"%s\"; return ( %s );",
                   oldComponentVal, oldValue.c_str(), buffer );
-               
+               Con::evaluatef("$f=0;$v=0;");
+
                if( !isFirst )
                   strNew.append( ' ' );
                strNew.append( newComponentVal );