Merge branch 'development' into style-cleanup

Conflicts:
	Engine/source/console/astNodes.cpp
	Engine/source/console/codeBlock.cpp
	Engine/source/console/compiledEval.cpp
	Engine/source/ts/collada/colladaAppMesh.cpp
	Engine/source/ts/tsShape.cpp
	Engine/source/ts/tsShapeConstruct.cpp
This commit is contained in:
Daniel Buckmaster 2014-12-15 12:15:55 +11:00
commit 33ff180593
2053 changed files with 172002 additions and 69530 deletions

View file

@ -78,8 +78,9 @@ ConsoleMethod(DbgFileView, getCurrentLine, const char *, 2, 2, "()"
{
S32 lineNum;
const char *file = object->getCurrentLine(lineNum);
char* ret = Con::getReturnBuffer(256);
dSprintf(ret, sizeof(ret), "%s\t%d", file, lineNum);
static const U32 bufSize = 256;
char* ret = Con::getReturnBuffer(bufSize);
dSprintf(ret, bufSize, "%s\t%d", file, lineNum);
return ret;
}

View file

@ -2540,7 +2540,7 @@ ConsoleMethod( GuiEditCtrl, setCurrentAddSet, void, 3, 3, "(GuiControl ctrl)")
if (!Sim::findObject(argv[2], addSet))
{
Con::printf("%s(): Invalid control: %s", argv[0], argv[2]);
Con::printf("%s(): Invalid control: %s", (const char*)argv[0], (const char*)argv[2]);
return;
}
object->setCurrentAddSet(addSet);
@ -2700,7 +2700,7 @@ ConsoleMethod( GuiEditCtrl, readGuides, void, 3, 4, "( GuiControl ctrl [, int ax
GuiControl* ctrl;
if( !Sim::findObject( argv[ 2 ], ctrl ) )
{
Con::errorf( "GuiEditCtrl::readGuides - no control '%s'", argv[ 2 ] );
Con::errorf( "GuiEditCtrl::readGuides - no control '%s'", (const char*)argv[ 2 ] );
return;
}
@ -2711,7 +2711,7 @@ ConsoleMethod( GuiEditCtrl, readGuides, void, 3, 4, "( GuiControl ctrl [, int ax
S32 axis = dAtoi( argv[ 3 ] );
if( axis < 0 || axis > 1 )
{
Con::errorf( "GuiEditCtrl::readGuides - invalid axis '%s'", argv[ 3 ] );
Con::errorf( "GuiEditCtrl::readGuides - invalid axis '%s'", (const char*)argv[ 3 ] );
return;
}
@ -2733,7 +2733,7 @@ ConsoleMethod( GuiEditCtrl, writeGuides, void, 3, 4, "( GuiControl ctrl [, int a
GuiControl* ctrl;
if( !Sim::findObject( argv[ 2 ], ctrl ) )
{
Con::errorf( "GuiEditCtrl::writeGuides - no control '%i'", argv[ 2 ] );
Con::errorf( "GuiEditCtrl::writeGuides - no control '%i'", (const char*)argv[ 2 ] );
return;
}
@ -2744,7 +2744,7 @@ ConsoleMethod( GuiEditCtrl, writeGuides, void, 3, 4, "( GuiControl ctrl [, int a
S32 axis = dAtoi( argv[ 3 ] );
if( axis < 0 || axis > 1 )
{
Con::errorf( "GuiEditCtrl::writeGuides - invalid axis '%s'", argv[ 3 ] );
Con::errorf( "GuiEditCtrl::writeGuides - invalid axis '%s'", (const char*)argv[ 3 ] );
return;
}

View file

@ -83,10 +83,9 @@ ConsoleMethod( GuiFilterCtrl, setValue, void, 3, 20, "(f1, f2, ...)"
{
Filter filter;
argc -= 2;
argv += 2;
StringStackWrapper args(argc - 2, argv + 2);
filter.set(argc, argv);
filter.set(args.count(), args);
object->set(filter);
}

View file

@ -777,7 +777,7 @@ ConsoleMethod( GuiInspector, inspect, void, 3, 3, "Inspect(Object)")
if(!target)
{
if(dAtoi(argv[2]) > 0)
Con::warnf("%s::inspect(): invalid object: %s", argv[0], argv[2]);
Con::warnf("%s::inspect(): invalid object: %s", (const char*)argv[0], (const char*)argv[2]);
object->clearInspectObjects();
return;
@ -793,7 +793,7 @@ ConsoleMethod( GuiInspector, addInspect, void, 3, 4, "( id object, (bool autoSyn
SimObject* obj;
if( !Sim::findObject( argv[ 2 ], obj ) )
{
Con::errorf( "%s::addInspect(): invalid object: %s", argv[ 0 ], argv[ 2 ] );
Con::errorf( "%s::addInspect(): invalid object: %s", (const char*)argv[ 0 ], (const char*)argv[ 2 ] );
return;
}
@ -810,7 +810,7 @@ ConsoleMethod( GuiInspector, removeInspect, void, 3, 3, "( id object ) - Remove
SimObject* obj;
if( !Sim::findObject( argv[ 2 ], obj ) )
{
Con::errorf( "%s::removeInspect(): invalid object: %s", argv[ 0 ], argv[ 2 ] );
Con::errorf( "%s::removeInspect(): invalid object: %s", (const char*)argv[ 0 ], (const char*)argv[ 2 ] );
return;
}

View file

@ -571,7 +571,7 @@ void GuiInspectorTypeFileName::updateValue()
ConsoleMethod( GuiInspectorTypeFileName, apply, void, 3,3, "apply(newValue);" )
{
String path( argv[2] );
String path( (const char*)argv[2] );
if ( path.isNotEmpty() )
path = Platform::makeRelativePathName( path, Platform::getMainDotCsDir() );
@ -764,8 +764,7 @@ GuiControl* GuiInspectorTypeShapeFilename::constructEditControl()
// Change filespec
char szBuffer[512];
dSprintf( szBuffer, sizeof(szBuffer), "getLoadFilename(\"%s\", \"%d.apply\", %d.getData());",
"DTS Files (*.dts)|*.dts|COLLADA Files (*.dae)|*.dae|(All Files (*.*)|*.*|", getId(), getId() );
dSprintf( szBuffer, sizeof(szBuffer), "getLoadFormatFilename(\"%d.apply\", %d.getData());", getId(), getId() );
mBrowseButton->setField( "Command", szBuffer );
// Create "Open in ShapeEditor" button

View file

@ -1060,12 +1060,13 @@ ConsoleMethod(GuiParticleGraphCtrl, addPlotPoint, const char*, 5, 6, "(int plotI
{
S32 plotID = dAtoi(argv[2]);
S32 pointAdded = 0;
char *retBuffer = Con::getReturnBuffer(32);
static const U32 bufSize = 32;
char *retBuffer = Con::getReturnBuffer(bufSize);
if(plotID > object->MaxPlots)
{
Con::errorf("Invalid plotID.");
dSprintf(retBuffer, 32, "%d", -2);
dSprintf(retBuffer, bufSize, "%d", -2);
return retBuffer;
}
@ -1078,7 +1079,7 @@ ConsoleMethod(GuiParticleGraphCtrl, addPlotPoint, const char*, 5, 6, "(int plotI
}
dSprintf(retBuffer, 32, "%d", pointAdded);
dSprintf(retBuffer, bufSize, "%d", pointAdded);
return retBuffer;
}
@ -1107,19 +1108,20 @@ ConsoleMethod(GuiParticleGraphCtrl, changePlotPoint, const char*, 6, 6, "(int pl
"@return No return value.")
{
S32 plotID = dAtoi(argv[2]);
static const U32 bufSize = 64;
if(plotID > object->MaxPlots)
{
Con::errorf("Invalid plotID.");
char *retBuffer = Con::getReturnBuffer(64);
char *retBuffer = Con::getReturnBuffer(bufSize);
const S32 index = -1;
dSprintf(retBuffer, 64, "%d", index);
dSprintf(retBuffer, bufSize, "%d", index);
return retBuffer;
}
char *retBuffer = Con::getReturnBuffer(64);
char *retBuffer = Con::getReturnBuffer(bufSize);
const S32 index = object->changePlotPoint( plotID, dAtoi(argv[3]), Point2F(dAtof(argv[4]), dAtof(argv[5])));
dSprintf(retBuffer, 64, "%d", index);
dSprintf(retBuffer, bufSize, "%d", index);
return retBuffer;
}
@ -1127,9 +1129,10 @@ ConsoleMethod(GuiParticleGraphCtrl, getSelectedPlot, const char*, 2, 2, "() "
"Gets the selected Plot (a.k.a. graph).\n"
"@return The plot's ID.")
{
char *retBuffer = Con::getReturnBuffer(32);
static const U32 bufSize = 32;
char *retBuffer = Con::getReturnBuffer(bufSize);
const S32 plot = object->getSelectedPlot();
dSprintf(retBuffer, 32, "%d", plot);
dSprintf(retBuffer, bufSize, "%d", plot);
return retBuffer;
}
@ -1137,9 +1140,10 @@ ConsoleMethod(GuiParticleGraphCtrl, getSelectedPoint, const char*, 2, 2, "()"
"Gets the selected Point on the Plot (a.k.a. graph)."
"@return The last selected point ID")
{
char *retBuffer = Con::getReturnBuffer(32);
static const U32 bufSize = 32;
char *retBuffer = Con::getReturnBuffer(bufSize);
const S32 point = object->getSelectedPoint();
dSprintf(retBuffer, 32, "%d", point);
dSprintf(retBuffer, bufSize, "%d", point);
return retBuffer;
}
@ -1158,9 +1162,10 @@ ConsoleMethod(GuiParticleGraphCtrl, isExistingPoint, const char*, 4, 4, "(int pl
Con::errorf("Invalid sample.");
}
char *retBuffer = Con::getReturnBuffer(32);
static const U32 bufSize = 32;
char *retBuffer = Con::getReturnBuffer(bufSize);
const bool isPoint = object->isExistingPoint(plotID, samples);
dSprintf(retBuffer, 32, "%d", isPoint);
dSprintf(retBuffer, bufSize, "%d", isPoint);
return retBuffer;
}
@ -1180,9 +1185,10 @@ ConsoleMethod(GuiParticleGraphCtrl, getPlotPoint, const char*, 4, 4, "(int plotI
Con::errorf("Invalid sample.");
}
char *retBuffer = Con::getReturnBuffer(64);
static const U32 bufSize = 64;
char *retBuffer = Con::getReturnBuffer(bufSize);
const Point2F &pos = object->getPlotPoint(plotID, samples);
dSprintf(retBuffer, 64, "%f %f", pos.x, pos.y);
dSprintf(retBuffer, bufSize, "%f %f", pos.x, pos.y);
return retBuffer;
}
@ -1201,9 +1207,10 @@ ConsoleMethod(GuiParticleGraphCtrl, getPlotIndex, const char*, 5, 5, "(int plotI
Con::errorf("Invalid plotID.");
}
char *retBuffer = Con::getReturnBuffer(32);
static const U32 bufSize = 32;
char *retBuffer = Con::getReturnBuffer(bufSize);
const S32 &index = object->getPlotIndex(plotID, x, y);
dSprintf(retBuffer, 32, "%d", index);
dSprintf(retBuffer, bufSize, "%d", index);
return retBuffer;
}
@ -1218,9 +1225,10 @@ ConsoleMethod(GuiParticleGraphCtrl, getGraphColor, const char*, 3, 3, "(int plot
Con::errorf("Invalid plotID.");
}
char *retBuffer = Con::getReturnBuffer(64);
static const U32 bufSize = 64;
char *retBuffer = Con::getReturnBuffer(bufSize);
const ColorF &color = object->getGraphColor(plotID);
dSprintf(retBuffer, 64, "%f %f %f", color.red, color.green, color.blue);
dSprintf(retBuffer, bufSize, "%f %f %f", color.red, color.green, color.blue);
return retBuffer;
}
@ -1235,9 +1243,10 @@ ConsoleMethod(GuiParticleGraphCtrl, getGraphMin, const char*, 3, 3, "(int plotID
Con::errorf("Invalid plotID.");
}
char *retBuffer = Con::getReturnBuffer(64);
static const U32 bufSize = 64;
char *retBuffer = Con::getReturnBuffer(bufSize);
const Point2F graphMin = object->getGraphMin(plotID);
dSprintf(retBuffer, 64, "%f %f", graphMin.x, graphMin.y);
dSprintf(retBuffer, bufSize, "%f %f", graphMin.x, graphMin.y);
return retBuffer;
}
@ -1252,9 +1261,10 @@ ConsoleMethod(GuiParticleGraphCtrl, getGraphMax, const char*, 3, 3, "(int plotID
Con::errorf("Invalid plotID.");
}
char *retBuffer = Con::getReturnBuffer(64);
static const U32 bufSize = 64;
char *retBuffer = Con::getReturnBuffer(bufSize);
const Point2F graphMax = object->getGraphMax(plotID);
dSprintf(retBuffer, 64, "%f %f", graphMax.x, graphMax.y);
dSprintf(retBuffer, bufSize, "%f %f", graphMax.x, graphMax.y);
return retBuffer;
}
@ -1269,9 +1279,10 @@ ConsoleMethod(GuiParticleGraphCtrl, getGraphName, const char*, 3, 3, "(int plotI
Con::errorf("Invalid plotID.");
}
char *retBuffer = Con::getReturnBuffer(64);
static const U32 bufSize = 64;
char *retBuffer = Con::getReturnBuffer(bufSize);
const StringTableEntry graphName = object->getGraphName(plotID);
dSprintf(retBuffer, 64, "%s", graphName);
dSprintf(retBuffer, bufSize, "%s", graphName);
return retBuffer;
}

View file

@ -98,6 +98,9 @@ static S32 QSORT_CALLBACK compareEntries(const void* a,const void* b)
//-----------------------------------------------------------------------------
bool GuiInspectorDynamicGroup::inspectGroup()
{
if( !mParent )
return false;
// clear the first responder if it's set
mStack->clearFirstResponder();

View file

@ -455,7 +455,7 @@ void GuiInspectorField::setInspectorProfile()
{
GuiControlProfile *profile = NULL;
if( mInspector->getNumInspectObjects() > 1 )
if( mInspector && (mInspector->getNumInspectObjects() > 1) )
{
if( !hasSameValueInAllObjects() )
Sim::findObject( "GuiInspectorMultiFieldDifferentProfile", profile );

View file

@ -230,7 +230,7 @@ void GuiInspectorGroup::clearFields()
bool GuiInspectorGroup::inspectGroup()
{
// We can't inspect a group without a target!
if( !mParent->getNumInspectObjects() )
if( !mParent || !mParent->getNumInspectObjects() )
return false;
// to prevent crazy resizing, we'll just freeze our stack for a sec..

View file

@ -50,6 +50,12 @@ GuiInspectorVariableField::~GuiInspectorVariableField()
bool GuiInspectorVariableField::onAdd()
{
if( !mInspector )
{
Con::errorf("GuiInspectorVariableField::onAdd - Fail - No inspector");
return false;
}
setInspectorProfile();
// Hack: skip our immediate parent