Improvements to console refactor code

- Prevent stack corruption in a few places
- Use correct type in printfs
- Reduce type conversions in EngineApi & dAto*
- Fix compilation on GCC
- Tidy up code
This commit is contained in:
jamesu 2012-10-11 21:29:39 +01:00 committed by James Urquhart
parent e99eadd61f
commit 08d4f6ebc0
58 changed files with 733 additions and 690 deletions

View file

@ -1040,7 +1040,7 @@ void GuiMeshRoadEditorCtrl::setMode( String mode, bool sourceShortcut = false )
mMode = mode;
if( sourceShortcut )
Con::executef( this, "paletteSync", (const char*)mode );
Con::executef( this, "paletteSync", mode );
}
void GuiMeshRoadEditorCtrl::setSelectedRoad( MeshRoad *road )
@ -1240,7 +1240,7 @@ ConsoleMethod( GuiMeshRoadEditorCtrl, setNodePosition, void, 3, 3, "" )
if ( (count != 3) )
{
Con::printf("Failed to parse node information \"px py pz\" from '%s'", argv[3]);
Con::printf("Failed to parse node information \"px py pz\" from '%s'", (const char*)argv[3]);
return;
}
@ -1266,7 +1266,7 @@ ConsoleMethod( GuiMeshRoadEditorCtrl, setNodeNormal, void, 3, 3, "" )
if ( (count != 3) )
{
Con::printf("Failed to parse node information \"px py pz\" from '%s'", argv[3]);
Con::printf("Failed to parse node information \"px py pz\" from '%s'", (const char*)argv[3]);
return;
}
@ -1304,4 +1304,4 @@ ConsoleMethod( GuiMeshRoadEditorCtrl, regenerate, void, 2, 2, "" )
ConsoleMethod( GuiMeshRoadEditorCtrl, matchTerrainToRoad, void, 2, 2, "" )
{
object->matchTerrainToRoad();
}
}

View file

@ -1181,7 +1181,7 @@ void GuiRiverEditorCtrl::setMode( String mode, bool sourceShortcut = false )
mMode = mode;
if( sourceShortcut )
Con::executef( this, "paletteSync", mode.utf8() );
Con::executef( this, "paletteSync", mode );
}
void GuiRiverEditorCtrl::setSelectedRiver( River *river )
@ -1444,7 +1444,7 @@ ConsoleMethod( GuiRiverEditorCtrl, setNodePosition, void, 3, 3, "" )
if ( (count != 3) )
{
Con::printf("Failed to parse node information \"px py pz\" from '%s'", argv[3]);
Con::printf("Failed to parse node information \"px py pz\" from '%s'", (const char*)argv[3]);
return;
}
@ -1470,7 +1470,7 @@ ConsoleMethod( GuiRiverEditorCtrl, setNodeNormal, void, 3, 3, "" )
if ( (count != 3) )
{
Con::printf("Failed to parse node information \"px py pz\" from '%s'", argv[3]);
Con::printf("Failed to parse node information \"px py pz\" from '%s'", (const char*)argv[3]);
return;
}
@ -1503,4 +1503,4 @@ ConsoleMethod( GuiRiverEditorCtrl, regenerate, void, 2, 2, "" )
River *river = object->getSelectedRiver();
if ( river )
river->regenerate();
}
}

View file

@ -945,7 +945,7 @@ void GuiRoadEditorCtrl::setMode( String mode, bool sourceShortcut = false )
mMode = mode;
if( sourceShortcut )
Con::executef( this, "paletteSync", mode.utf8() );
Con::executef( this, "paletteSync", mode );
}
void GuiRoadEditorCtrl::setSelectedRoad( DecalRoad *road )
@ -1081,7 +1081,7 @@ ConsoleMethod( GuiRoadEditorCtrl, setNodePosition, void, 3, 3, "" )
if ( (count != 3) )
{
Con::printf("Failed to parse node information \"px py pz\" from '%s'", argv[3]);
Con::printf("Failed to parse node information \"px py pz\" from '%s'", (const char*)argv[3]);
return;
}