mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-16 05:03:47 +00:00
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:
parent
e99eadd61f
commit
08d4f6ebc0
58 changed files with 733 additions and 690 deletions
|
|
@ -439,7 +439,7 @@ ConsoleMethod( LightBase, playAnimation, void, 2, 3, "( [LightAnimData anim] )\t
|
|||
LightAnimData *animData;
|
||||
if ( !Sim::findObject( argv[2], animData ) )
|
||||
{
|
||||
Con::errorf( "LightBase::playAnimation() - Invalid LightAnimData '%s'.", argv[2] );
|
||||
Con::errorf( "LightBase::playAnimation() - Invalid LightAnimData '%s'.", (const char*)argv[2] );
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -481,4 +481,4 @@ void LightBase::pauseAnimation( void )
|
|||
mAnimState.active = false;
|
||||
setMaskBits( UpdateMask );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -554,7 +554,7 @@ ConsoleMethod(SpawnSphere, spawnObject, S32, 2, 3,
|
|||
String additionalProps;
|
||||
|
||||
if (argc == 3)
|
||||
additionalProps = String(argv[2]);
|
||||
additionalProps = (const char*)argv[2];
|
||||
|
||||
SimObject* obj = object->spawnObject(additionalProps);
|
||||
|
||||
|
|
|
|||
|
|
@ -147,13 +147,13 @@ ConsoleFunction( physicsDestroy, void, 1, 1, "physicsDestroy()" )
|
|||
|
||||
ConsoleFunction( physicsInitWorld, bool, 2, 2, "physicsInitWorld( String worldName )" )
|
||||
{
|
||||
return PHYSICSMGR && PHYSICSMGR->createWorld( String( argv[1] ) );
|
||||
return PHYSICSMGR && PHYSICSMGR->createWorld( (const char*)argv[1] );
|
||||
}
|
||||
|
||||
ConsoleFunction( physicsDestroyWorld, void, 2, 2, "physicsDestroyWorld( String worldName )" )
|
||||
{
|
||||
if ( PHYSICSMGR )
|
||||
PHYSICSMGR->destroyWorld( String( argv[1] ) );
|
||||
PHYSICSMGR->destroyWorld( (const char*)argv[1] );
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -162,13 +162,13 @@ ConsoleFunction( physicsDestroyWorld, void, 2, 2, "physicsDestroyWorld( String w
|
|||
ConsoleFunction( physicsStartSimulation, void, 2, 2, "physicsStartSimulation( String worldName )" )
|
||||
{
|
||||
if ( PHYSICSMGR )
|
||||
PHYSICSMGR->enableSimulation( String( argv[1] ), true );
|
||||
PHYSICSMGR->enableSimulation( (const char*)argv[1], true );
|
||||
}
|
||||
|
||||
ConsoleFunction( physicsStopSimulation, void, 2, 2, "physicsStopSimulation( String worldName )" )
|
||||
{
|
||||
if ( PHYSICSMGR )
|
||||
PHYSICSMGR->enableSimulation( String( argv[1] ), false );
|
||||
PHYSICSMGR->enableSimulation( (const char*)argv[1], false );
|
||||
}
|
||||
|
||||
ConsoleFunction( physicsSimulationEnabled, bool, 1, 1, "physicsSimulationEnabled()" )
|
||||
|
|
@ -182,7 +182,7 @@ ConsoleFunction( physicsSimulationEnabled, bool, 1, 1, "physicsSimulationEnabled
|
|||
ConsoleFunction( physicsSetTimeScale, void, 2, 2, "physicsSetTimeScale( F32 scale )" )
|
||||
{
|
||||
if ( PHYSICSMGR )
|
||||
PHYSICSMGR->setTimeScale( dAtof( argv[1] ) );
|
||||
PHYSICSMGR->setTimeScale( argv[1] );
|
||||
}
|
||||
|
||||
// Get the currently set time scale.
|
||||
|
|
@ -212,5 +212,5 @@ ConsoleFunction( physicsRestoreState, void, 1, 1, "physicsRestoreState()" )
|
|||
ConsoleFunction( physicsDebugDraw, void, 2, 2, "physicsDebugDraw( bool enable )" )
|
||||
{
|
||||
if ( PHYSICSMGR )
|
||||
PHYSICSMGR->enableDebugDraw( dAtoi( argv[1] ) );
|
||||
}
|
||||
PHYSICSMGR->enableDebugDraw( (S32)argv[1] );
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue