whitespace

This commit is contained in:
Thomas "elfprince13" Dickerson 2017-01-11 23:34:46 -05:00
parent 6164f36c47
commit bcc5459818
50 changed files with 2111 additions and 2111 deletions

View file

@ -109,15 +109,15 @@ void FieldBrushObject::destroyFields()
static char replacebuf[1024];
static char* suppressSpaces(const char* in_pname)
{
U32 i = 0;
char chr;
do
{
chr = in_pname[i];
replacebuf[i++] = (chr != 32) ? chr : '_';
} while(chr);
U32 i = 0;
char chr;
do
{
chr = in_pname[i];
replacebuf[i++] = (chr != 32) ? chr : '_';
} while(chr);
return replacebuf;
return replacebuf;
}
//-----------------------------------------------------------------------------
@ -125,7 +125,7 @@ static char* suppressSpaces(const char* in_pname)
//-----------------------------------------------------------------------------
DefineConsoleMethod(FieldBrushObject, queryGroups, const char*, (const char* simObjName), , "(simObject) Query available static-field groups for selected object./\n"
"@param simObject Object to query static-field groups on.\n"
"@return Space-seperated static-field group list.")
"@return Space-seperated static-field group list.")
{
// Fetch selected object.
SimObject* pSimObject = dynamic_cast<SimObject*>( Sim::findObject( simObjName ) );
@ -194,7 +194,7 @@ DefineConsoleMethod(FieldBrushObject, queryGroups, const char*, (const char* sim
DefineConsoleMethod(FieldBrushObject, queryFields, const char*, (const char* simObjName, const char* groupList), (""), "(simObject, [groupList]) Query available static-fields for selected object./\n"
"@param simObject Object to query static-fields on.\n"
"@param groupList groups to filter static-fields against.\n"
"@return Space-seperated static-field list.")
"@return Space-seperated static-field list.")
{
// Fetch selected object.
SimObject* pSimObject = dynamic_cast<SimObject*>( Sim::findObject( simObjName ) );
@ -369,7 +369,7 @@ DefineConsoleMethod(FieldBrushObject, queryFields, const char*, (const char* sim
DefineConsoleMethod(FieldBrushObject, copyFields, void, (const char* simObjName, const char* pFieldList), (""), "(simObject, [fieldList]) Copy selected static-fields for selected object./\n"
"@param simObject Object to copy static-fields from.\n"
"@param fieldList fields to filter static-fields against.\n"
"@return No return value.")
"@return No return value.")
{
// Fetch selected object.
SimObject* pSimObject = dynamic_cast<SimObject*>( Sim::findObject( simObjName ) );
@ -502,7 +502,7 @@ void FieldBrushObject::copyFields( SimObject* pSimObject, const char* fieldList
//-----------------------------------------------------------------------------
DefineConsoleMethod(FieldBrushObject, pasteFields, void, (const char* simObjName), , "(simObject) Paste copied static-fields to selected object./\n"
"@param simObject Object to paste static-fields to.\n"
"@return No return value.")
"@return No return value.")
{
// Fetch selected object.
SimObject* pSimObject = dynamic_cast<SimObject*>( Sim::findObject( simObjName ) );

View file

@ -210,7 +210,7 @@ DefineEngineFunction( findNextFile, String, ( const char* pattern ), ( "" ),
//-----------------------------------------------------------------------------
DefineEngineFunction( getFileCount, S32, ( const char* pattern, bool recurse ), ( "", true ),
"@brief Returns the number of files in the directory tree that match the given patterns\n\n"
"@brief Returns the number of files in the directory tree that match the given patterns\n\n"
"This function differs from getFileCountMultiExpr() in that it supports a single search "
"pattern being passed in.\n\n"
@ -246,7 +246,7 @@ DefineEngineFunction( getFileCount, S32, ( const char* pattern, bool recurse ),
//-----------------------------------------------------------------------------
DefineEngineFunction(findFirstFileMultiExpr, String, ( const char* pattern, bool recurse ), ( "", true),
"@brief Returns the first file in the directory system matching the given patterns.\n\n"
"@brief Returns the first file in the directory system matching the given patterns.\n\n"
"Use the corresponding findNextFileMultiExpr() to step through "
"the results. If you're only interested in the number of files returned by the "
@ -259,10 +259,10 @@ DefineEngineFunction(findFirstFileMultiExpr, String, ( const char* pattern, bool
"call to findFirstFile() and findFirstFileMultiExpr() initiates a new search and renders "
"a previous search invalid.\n\n"
"@param pattern The path and file name pattern to match against, such as *.cs. Separate "
"@param pattern The path and file name pattern to match against, such as *.cs. Separate "
"multiple patterns with TABs. For example: \"*.cs\" TAB \"*.dso\"\n"
"@param recurse If true, the search will exhaustively recurse into subdirectories "
"of the given path and match the given filename patterns.\n"
"@param recurse If true, the search will exhaustively recurse into subdirectories "
"of the given path and match the given filename patterns.\n"
"@return String of the first matching file path, or an empty string if no matching "
"files were found.\n\n"
@ -280,7 +280,7 @@ DefineEngineFunction(findFirstFileMultiExpr, String, ( const char* pattern, bool
"@see findNextFileMultiExpr()"
"@see getFileCountMultiExpr()"
"@see findFirstFile()"
"@ingroup FileSearches")
"@ingroup FileSearches")
{
S32 numResults = buildFileList(pattern, recurse, true);
@ -302,7 +302,7 @@ DefineEngineFunction(findFirstFileMultiExpr, String, ( const char* pattern, bool
DefineEngineFunction(findNextFileMultiExpr, String, ( const char* pattern ), (""),
"@brief Returns the next file matching a search begun in findFirstFileMultiExpr().\n\n"
"@param pattern The path and file name pattern to match against. This is optional "
"@param pattern The path and file name pattern to match against. This is optional "
"and may be left out as it is not used by the code. It is here for legacy reasons.\n"
"@return String of the next matching file path, or an empty string if no matching "
"files were found.\n\n"
@ -319,7 +319,7 @@ DefineEngineFunction(findNextFileMultiExpr, String, ( const char* pattern ), (""
"@endtsexample\n\n"
"@see findFirstFileMultiExpr()"
"@ingroup FileSearches")
"@ingroup FileSearches")
{
if ( sgFindFilesPos + 1 > sgFindFilesResults.size() )
return String();
@ -328,16 +328,16 @@ DefineEngineFunction(findNextFileMultiExpr, String, ( const char* pattern ), (""
}
DefineEngineFunction(getFileCountMultiExpr, S32, ( const char* pattern, bool recurse ), ( "", true),
"@brief Returns the number of files in the directory tree that match the given patterns\n\n"
"@brief Returns the number of files in the directory tree that match the given patterns\n\n"
"If you're interested in a list of files that match the given patterns and not just "
"the number of files, use findFirstFileMultiExpr() and findNextFileMultiExpr().\n\n"
"@param pattern The path and file name pattern to match against, such as *.cs. Separate "
"@param pattern The path and file name pattern to match against, such as *.cs. Separate "
"multiple patterns with TABs. For example: \"*.cs\" TAB \"*.dso\"\n"
"@param recurse If true, the search will exhaustively recurse into subdirectories "
"of the given path and match the given filename pattern.\n"
"@return Number of files located using the patterns\n\n"
"@param recurse If true, the search will exhaustively recurse into subdirectories "
"of the given path and match the given filename pattern.\n"
"@return Number of files located using the patterns\n\n"
"@tsexample\n"
"// Count all DTS or Collada models\n"
@ -347,7 +347,7 @@ DefineEngineFunction(getFileCountMultiExpr, S32, ( const char* pattern, bool rec
"@see findFirstFileMultiExpr()"
"@see findNextFileMultiExpr()"
"@ingroup FileSearches")
"@ingroup FileSearches")
{
S32 numResults = buildFileList(pattern, recurse, true);
@ -399,14 +399,14 @@ DefineEngineFunction(isFile, bool, ( const char* fileName ),,
}
DefineEngineFunction( IsDirectory, bool, ( const char* directory ),,
"@brief Determines if a specified directory exists or not\n\n"
"@brief Determines if a specified directory exists or not\n\n"
"@param directory String containing path in the form of \"foo/bar\"\n"
"@param directory String containing path in the form of \"foo/bar\"\n"
"@return Returns true if the directory was found.\n"
"@note Do not include a trailing slash '/'.\n"
"@note Do not include a trailing slash '/'.\n"
"@ingroup FileSystem")
"@ingroup FileSystem")
{
String dir(Torque::Path::CleanSeparators(directory));
Con::expandScriptFilename(sgScriptFilenameBuffer, sizeof(sgScriptFilenameBuffer), dir.c_str());
@ -416,12 +416,12 @@ DefineEngineFunction( IsDirectory, bool, ( const char* directory ),,
}
DefineEngineFunction(isWriteableFileName, bool, ( const char* fileName ),,
"@brief Determines if a file name can be written to using File I/O\n\n"
"@brief Determines if a file name can be written to using File I/O\n\n"
"@param fileName Name and path of file to check\n"
"@return Returns true if the file can be written to.\n"
"@param fileName Name and path of file to check\n"
"@return Returns true if the file can be written to.\n"
"@ingroup FileSystem")
"@ingroup FileSystem")
{
String filename(Torque::Path::CleanSeparators(fileName));
Con::expandScriptFilename(sgScriptFilenameBuffer, sizeof(sgScriptFilenameBuffer), filename.c_str());
@ -434,32 +434,32 @@ DefineEngineFunction(isWriteableFileName, bool, ( const char* fileName ),,
}
DefineEngineFunction(startFileChangeNotifications, void, (),,
"@brief Start watching resources for file changes\n\n"
"@brief Start watching resources for file changes\n\n"
"Typically this is called during initializeCore().\n\n"
"@see stopFileChangeNotifications()\n"
"@ingroup FileSystem")
"@ingroup FileSystem")
{
Torque::FS::StartFileChangeNotifications();
}
DefineEngineFunction(stopFileChangeNotifications, void, (),,
"@brief Stop watching resources for file changes\n\n"
"@brief Stop watching resources for file changes\n\n"
"Typically this is called during shutdownCore().\n\n"
"@see startFileChangeNotifications()\n"
"@ingroup FileSystem")
"@ingroup FileSystem")
{
Torque::FS::StopFileChangeNotifications();
}
DefineEngineFunction(getDirectoryList, String, ( const char* path, S32 depth ), ( "", 0 ),
"@brief Gathers a list of directories starting at the given path.\n\n"
"@brief Gathers a list of directories starting at the given path.\n\n"
"@param path String containing the path of the directory\n"
"@param depth Depth of search, as in how many subdirectories to parse through\n"
"@return Tab delimited string containing list of directories found during search, \"\" if no files were found\n"
"@param path String containing the path of the directory\n"
"@param depth Depth of search, as in how many subdirectories to parse through\n"
"@return Tab delimited string containing list of directories found during search, \"\" if no files were found\n"
"@ingroup FileSystem")
"@ingroup FileSystem")
{
// Grab the full path.
char fullpath[1024];
@ -508,23 +508,23 @@ DefineEngineFunction(getDirectoryList, String, ( const char* path, S32 depth ),
}
DefineEngineFunction(fileSize, S32, ( const char* fileName ),,
"@brief Determines the size of a file on disk\n\n"
"@brief Determines the size of a file on disk\n\n"
"@param fileName Name and path of the file to check\n"
"@return Returns filesize in bytes, or -1 if no file\n"
"@param fileName Name and path of the file to check\n"
"@return Returns filesize in bytes, or -1 if no file\n"
"@ingroup FileSystem")
"@ingroup FileSystem")
{
Con::expandScriptFilename(sgScriptFilenameBuffer, sizeof(sgScriptFilenameBuffer), fileName);
return Platform::getFileSize( sgScriptFilenameBuffer );
}
DefineEngineFunction( fileModifiedTime, String, ( const char* fileName ),,
"@brief Returns a platform specific formatted string with the last modified time for the file.\n\n"
"@brief Returns a platform specific formatted string with the last modified time for the file.\n\n"
"@param fileName Name and path of file to check\n"
"@return Formatted string (OS specific) containing modified time, \"9/3/2010 12:33:47 PM\" for example\n"
"@ingroup FileSystem")
"@param fileName Name and path of file to check\n"
"@return Formatted string (OS specific) containing modified time, \"9/3/2010 12:33:47 PM\" for example\n"
"@ingroup FileSystem")
{
Con::expandScriptFilename(sgScriptFilenameBuffer, sizeof(sgScriptFilenameBuffer), fileName);
@ -566,12 +566,12 @@ DefineEngineFunction( fileCreatedTime, String, ( const char* fileName ),,
}
DefineEngineFunction(fileDelete, bool, ( const char* path ),,
"@brief Delete a file from the hard drive\n\n"
"@brief Delete a file from the hard drive\n\n"
"@param path Name and path of the file to delete\n"
"@note THERE IS NO RECOVERY FROM THIS. Deleted file is gone for good.\n"
"@return True if file was successfully deleted\n"
"@ingroup FileSystem")
"@param path Name and path of the file to delete\n"
"@note THERE IS NO RECOVERY FROM THIS. Deleted file is gone for good.\n"
"@return True if file was successfully deleted\n"
"@ingroup FileSystem")
{
static char fileName[1024];
static char sandboxFileName[1024];
@ -586,11 +586,11 @@ DefineEngineFunction(fileDelete, bool, ( const char* path ),,
//----------------------------------------------------------------
DefineEngineFunction(fileExt, String, ( const char* fileName ),,
"@brief Get the extension of a file\n\n"
"@brief Get the extension of a file\n\n"
"@param fileName Name and path of file\n"
"@return String containing the extension, such as \".exe\" or \".cs\"\n"
"@ingroup FileSystem")
"@param fileName Name and path of file\n"
"@return String containing the extension, such as \".exe\" or \".cs\"\n"
"@ingroup FileSystem")
{
const char *ret = dStrrchr(fileName, '.');
if(ret)
@ -626,11 +626,11 @@ DefineEngineFunction(fileBase, String, ( const char* fileName ),,
}
DefineEngineFunction(fileName, String, ( const char* fileName ),,
"@brief Get only the file name of a path and file name string (removes path)\n\n"
"@brief Get only the file name of a path and file name string (removes path)\n\n"
"@param fileName Name and path of file to check\n"
"@return String containing the file name, minus the path\n"
"@ingroup FileSystem")
"@param fileName Name and path of file to check\n"
"@return String containing the file name, minus the path\n"
"@ingroup FileSystem")
{
S32 pathLen = dStrlen( fileName );
FrameTemp<char> szPathCopy( pathLen + 1);
@ -649,11 +649,11 @@ DefineEngineFunction(fileName, String, ( const char* fileName ),,
}
DefineEngineFunction(filePath, String, ( const char* fileName ),,
"@brief Get the path of a file (removes name and extension)\n\n"
"@brief Get the path of a file (removes name and extension)\n\n"
"@param fileName Name and path of file to check\n"
"@return String containing the path, minus name and extension\n"
"@ingroup FileSystem")
"@param fileName Name and path of file to check\n"
"@return String containing the path, minus name and extension\n"
"@ingroup FileSystem")
{
S32 pathLen = dStrlen( fileName );
FrameTemp<char> szPathCopy( pathLen + 1);
@ -672,10 +672,10 @@ DefineEngineFunction(filePath, String, ( const char* fileName ),,
}
DefineEngineFunction(getWorkingDirectory, String, (),,
"@brief Reports the current directory\n\n"
"@brief Reports the current directory\n\n"
"@return String containing full file path of working directory\n"
"@ingroup FileSystem")
"@return String containing full file path of working directory\n"
"@ingroup FileSystem")
{
return Platform::getCurrentDirectory();
}
@ -687,13 +687,13 @@ DefineEngineFunction(getWorkingDirectory, String, (),,
// are not currently built with TORQUE_TOOLS defined.
DefineEngineFunction(makeFullPath, String, ( const char* path, const char* cwd ), ( "", ""),
"@brief Converts a relative file path to a full path\n\n"
"@brief Converts a relative file path to a full path\n\n"
"For example, \"./console.log\" becomes \"C:/Torque/t3d/examples/FPS Example/game/console.log\"\n"
"@param path Name of file or path to check\n"
"For example, \"./console.log\" becomes \"C:/Torque/t3d/examples/FPS Example/game/console.log\"\n"
"@param path Name of file or path to check\n"
"@param cwd Optional current working directory from which to build the full path.\n"
"@return String containing non-relative directory of path\n"
"@ingroup FileSystem")
"@return String containing non-relative directory of path\n"
"@ingroup FileSystem")
{
static const U32 bufSize = 512;
char *buf = Con::getReturnBuffer(bufSize);
@ -702,25 +702,25 @@ DefineEngineFunction(makeFullPath, String, ( const char* path, const char* cwd )
}
DefineEngineFunction(makeRelativePath, String, ( const char* path, const char* to ), ( "", ""),
"@brief Turns a full or local path to a relative one\n\n"
"@brief Turns a full or local path to a relative one\n\n"
"For example, \"./game/art\" becomes \"game/art\"\n"
"@param path Full path (may include a file) to convert\n"
"@param to Optional base path used for the conversion. If not supplied the current "
"working directory is used.\n"
"@returns String containing relative path\n"
"@ingroup FileSystem")
"@returns String containing relative path\n"
"@ingroup FileSystem")
{
return Platform::makeRelativePathName( path, dStrlen(to) > 1 ? to : NULL );
}
DefineEngineFunction(pathConcat, String, ( const char* path, const char* file), ( "", ""),
"@brief Combines two separate strings containing a file path and file name together into a single string\n\n"
"@brief Combines two separate strings containing a file path and file name together into a single string\n\n"
"@param path String containing file path\n"
"@param file String containing file name\n"
"@return String containing concatenated file name and path\n"
"@ingroup FileSystem")
"@param path String containing file path\n"
"@param file String containing file name\n"
"@return String containing concatenated file name and path\n"
"@ingroup FileSystem")
{
static const U32 bufSize = 1024;
char *buf = Con::getReturnBuffer(bufSize);
@ -731,10 +731,10 @@ DefineEngineFunction(pathConcat, String, ( const char* path, const char* file),
//-----------------------------------------------------------------------------
DefineEngineFunction(getExecutableName, String, (),,
"@brief Gets the name of the game's executable\n\n"
"@brief Gets the name of the game's executable\n\n"
"@return String containing this game's executable name\n"
"@ingroup FileSystem")
"@return String containing this game's executable name\n"
"@ingroup FileSystem")
{
return Platform::getExecutableName();
}

View file

@ -34,22 +34,22 @@
IMPLEMENT_CONOBJECT(PersistenceManager);
ConsoleDocClass( PersistenceManager,
"@brief this class manages updating SimObjects in the file they were "
"created in non-destructively (mostly aimed at datablocks and materials).\n\n"
"@brief this class manages updating SimObjects in the file they were "
"created in non-destructively (mostly aimed at datablocks and materials).\n\n"
"Basic scripting interface:\n\n"
" - Creation: new PersistenceManager(FooManager);\n"
" - Flag objects as dirty: FooManager.setDirty(<object name or id>);\n"
" - Remove objects from dirty list: FooManager.removeDirty(<object name or id>);\n"
" - List all currently dirty objects: FooManager.listDirty();\n"
" - Check to see if an object is dirty: FooManager.isDirty(<object name or id>);\n"
" - Save dirty objects to their files: FooManager.saveDirty();\n\n"
"@note Dirty objects don't update their files until saveDirty() is "
"called so you can change their properties after you flag them as dirty\n\n"
"@note Currently only used by editors, not intended for actual game development\n\n"
"@ingroup Console\n"
"@ingroup Editors\n"
"@internal");
"Basic scripting interface:\n\n"
" - Creation: new PersistenceManager(FooManager);\n"
" - Flag objects as dirty: FooManager.setDirty(<object name or id>);\n"
" - Remove objects from dirty list: FooManager.removeDirty(<object name or id>);\n"
" - List all currently dirty objects: FooManager.listDirty();\n"
" - Check to see if an object is dirty: FooManager.isDirty(<object name or id>);\n"
" - Save dirty objects to their files: FooManager.saveDirty();\n\n"
"@note Dirty objects don't update their files until saveDirty() is "
"called so you can change their properties after you flag them as dirty\n\n"
"@note Currently only used by editors, not intended for actual game development\n\n"
"@ingroup Console\n"
"@ingroup Editors\n"
"@internal");
PersistenceManager::PersistenceManager()
{
@ -890,7 +890,7 @@ PersistenceManager::ParsedObject* PersistenceManager::findParsedObject(SimObject
{
const ParsedProperty &prop = testObj->properties[j];
if ( dStrcmp( prop.name, "internalName" ) == 0 &&
if ( dStrcmp( prop.name, "internalName" ) == 0 &&
dStrcmp( prop.value, object->getInternalName() ) == 0 )
return testObj;
else if ( dStrcmp(prop.name, "internalName") == 0)
@ -2037,24 +2037,24 @@ bool PersistenceManager::saveDirtyObject(SimObject* object)
const char *name = object->getName();
if (name)
{
Con::errorf("PersistenceManager::saveDirtyObject(): Unable to open %s to save %s %s (%d)",
dirtyObject.fileName, object->getClassName(), name, object->getId());
}
else
{
Con::errorf("PersistenceManager::saveDirtyObject(): Unable to open %s to save %s (%d)",
dirtyObject.fileName, object->getClassName(), object->getId());
}
Con::errorf("PersistenceManager::saveDirtyObject(): Unable to open %s to save %s %s (%d)",
dirtyObject.fileName, object->getClassName(), name, object->getId());
}
else
{
Con::errorf("PersistenceManager::saveDirtyObject(): Unable to open %s to save %s (%d)",
dirtyObject.fileName, object->getClassName(), object->getId());
}
return false;
}
return false;
}
// if the file exists then lets update and save
if(mCurrentFile)
{
updateObject(object);
if(mCurrentFile)
{
updateObject(object);
saveDirtyFile();
}
}
break;
}
@ -2230,7 +2230,7 @@ DefineConsoleMethod( PersistenceManager, removeDirty, void, ( const char * objNa
"Remove a SimObject from the dirty list.")
{
SimObject *dirtyObject = NULL;
if (dStrcmp( objName,"")!=0)
if (dStrcmp( objName,"")!=0)
{
if (!Sim::findObject(objName, dirtyObject))
{

View file

@ -343,10 +343,10 @@ bool collapseScriptFilename(char *filename, U32 size, const char *src)
//-----------------------------------------------------------------------------
ConsoleFunction(expandFilename, const char*, 2, 2, "(string filename)"
"@brief Grabs the full path of a specified file\n\n"
"@param filename Name of the local file to locate\n"
"@return String containing the full filepath on disk\n"
"@ingroup FileSystem")
"@brief Grabs the full path of a specified file\n\n"
"@param filename Name of the local file to locate\n"
"@return String containing the full filepath on disk\n"
"@ingroup FileSystem")
{
TORQUE_UNUSED(argc);
static const U32 bufSize = 1024;
@ -356,9 +356,9 @@ ConsoleFunction(expandFilename, const char*, 2, 2, "(string filename)"
}
ConsoleFunction(expandOldFilename, const char*, 2, 2, "(string filename)"
"@brief Retrofits a filepath that uses old Torque style\n\n"
"@return String containing filepath with new formatting\n"
"@ingroup FileSystem")
"@brief Retrofits a filepath that uses old Torque style\n\n"
"@return String containing filepath with new formatting\n"
"@ingroup FileSystem")
{
TORQUE_UNUSED(argc);
static const U32 bufSize = 1024;
@ -372,7 +372,7 @@ ConsoleFunction(expandOldFilename, const char*, 2, 2, "(string filename)"
//-----------------------------------------------------------------------------
ConsoleToolFunction(collapseFilename, const char*, 2, 2, "(string filename)"
"@internal Editor use only")
"@internal Editor use only")
{
TORQUE_UNUSED(argc);
static const U32 bufSize = 1024;
@ -382,7 +382,7 @@ ConsoleToolFunction(collapseFilename, const char*, 2, 2, "(string filename)"
}
ConsoleToolFunction(setScriptPathExpando, void, 3, 4, "(string expando, string path[, bool toolsOnly])"
"@internal Editor use only")
"@internal Editor use only")
{
if(argc == 4)
Con::setScriptPathExpando(argv[1], argv[2], dAtob(argv[3]));
@ -391,13 +391,13 @@ ConsoleToolFunction(setScriptPathExpando, void, 3, 4, "(string expando, string p
}
ConsoleToolFunction(removeScriptPathExpando, void, 2, 2, "(string expando)"
"@internal Editor use only")
"@internal Editor use only")
{
Con::removeScriptPathExpando(argv[1]);
}
ConsoleToolFunction(isScriptPathExpando, bool, 2, 2, "(string expando)"
"@internal Editor use only")
"@internal Editor use only")
{
return Con::isScriptPathExpando(argv[1]);
}

View file

@ -53,13 +53,13 @@ ConsoleDocClass( ScriptObject,
);
IMPLEMENT_CALLBACK( ScriptObject, onAdd, void, ( SimObjectId ID ), ( ID ),
"Called when this ScriptObject is added to the system.\n"
"@param ID Unique object ID assigned when created (%this in script).\n"
"Called when this ScriptObject is added to the system.\n"
"@param ID Unique object ID assigned when created (%this in script).\n"
);
IMPLEMENT_CALLBACK( ScriptObject, onRemove, void, ( SimObjectId ID ), ( ID ),
"Called when this ScriptObject is removed from the system.\n"
"@param ID Unique object ID assigned when created (%this in script).\n"
"Called when this ScriptObject is removed from the system.\n"
"@param ID Unique object ID assigned when created (%this in script).\n"
);
ScriptObject::ScriptObject()
@ -105,18 +105,18 @@ ConsoleDocClass( ScriptTickObject,
);
IMPLEMENT_CALLBACK( ScriptTickObject, onInterpolateTick, void, ( F32 delta ), ( delta ),
"This is called every frame, but only if the object is set to process ticks.\n"
"@param delta The time delta for this frame.\n"
"This is called every frame, but only if the object is set to process ticks.\n"
"@param delta The time delta for this frame.\n"
);
IMPLEMENT_CALLBACK( ScriptTickObject, onProcessTick, void, (), (),
"Called once every 32ms if this object is set to process ticks.\n"
"Called once every 32ms if this object is set to process ticks.\n"
);
IMPLEMENT_CALLBACK( ScriptTickObject, onAdvanceTime, void, ( F32 timeDelta ), ( timeDelta ),
"This is called every frame regardless if the object is set to process ticks, but only "
"This is called every frame regardless if the object is set to process ticks, but only "
"if the callOnAdvanceTime property is set to true.\n"
"@param timeDelta The time delta for this frame.\n"
"@param timeDelta The time delta for this frame.\n"
"@see callOnAdvanceTime\n"
);
@ -188,37 +188,37 @@ DefineEngineMethod( ScriptTickObject, isProcessingTicks, bool, ( ),,
IMPLEMENT_CONOBJECT(ScriptGroup);
ConsoleDocClass( ScriptGroup,
"@brief Essentially a SimGroup, but with onAdd and onRemove script callbacks.\n\n"
"@brief Essentially a SimGroup, but with onAdd and onRemove script callbacks.\n\n"
"@tsexample\n"
"// First container, SimGroup containing a ScriptGroup\n"
"new SimGroup(Scenes)\n"
"{\n"
" // Subcontainer, ScriptGroup containing variables\n"
" // related to a cut scene and a starting WayPoint\n"
" new ScriptGroup(WelcomeScene)\n"
" {\n"
" class = \"Scene\";\n"
" pathName = \"Pathx\";\n"
" description = \"A small orc village set in the Hardesty mountains. This town and its surroundings will be used to illustrate some the Torque Game Engine\'s features.\";\n"
" pathTime = \"0\";\n"
" title = \"Welcome to Orc Town\";\n\n"
" new WayPoint(start)\n"
" {\n"
" position = \"163.873 -103.82 208.354\";\n"
" rotation = \"0.136165 -0.0544916 0.989186 44.0527\";\n"
" scale = \"1 1 1\";\n"
" dataBlock = \"WayPointMarker\";\n"
" team = \"0\";\n"
" };\n"
" };\n"
"};\n"
"@endtsexample\n\n"
"@tsexample\n"
"// First container, SimGroup containing a ScriptGroup\n"
"new SimGroup(Scenes)\n"
"{\n"
" // Subcontainer, ScriptGroup containing variables\n"
" // related to a cut scene and a starting WayPoint\n"
" new ScriptGroup(WelcomeScene)\n"
" {\n"
" class = \"Scene\";\n"
" pathName = \"Pathx\";\n"
" description = \"A small orc village set in the Hardesty mountains. This town and its surroundings will be used to illustrate some the Torque Game Engine\'s features.\";\n"
" pathTime = \"0\";\n"
" title = \"Welcome to Orc Town\";\n\n"
" new WayPoint(start)\n"
" {\n"
" position = \"163.873 -103.82 208.354\";\n"
" rotation = \"0.136165 -0.0544916 0.989186 44.0527\";\n"
" scale = \"1 1 1\";\n"
" dataBlock = \"WayPointMarker\";\n"
" team = \"0\";\n"
" };\n"
" };\n"
"};\n"
"@endtsexample\n\n"
"@see SimGroup\n"
"@see SimGroup\n"
"@ingroup Console\n"
"@ingroup Scripting"
"@ingroup Console\n"
"@ingroup Scripting"
);
ScriptGroup::ScriptGroup()
@ -226,13 +226,13 @@ ScriptGroup::ScriptGroup()
}
IMPLEMENT_CALLBACK( ScriptGroup, onAdd, void, ( SimObjectId ID ), ( ID ),
"Called when this ScriptGroup is added to the system.\n"
"@param ID Unique object ID assigned when created (%this in script).\n"
"Called when this ScriptGroup is added to the system.\n"
"@param ID Unique object ID assigned when created (%this in script).\n"
);
IMPLEMENT_CALLBACK( ScriptGroup, onRemove, void, ( SimObjectId ID ), ( ID ),
"Called when this ScriptObject is removed from the system.\n"
"@param ID Unique object ID assigned when created (%this in script).\n"
"Called when this ScriptObject is removed from the system.\n"
"@param ID Unique object ID assigned when created (%this in script).\n"
);
bool ScriptGroup::onAdd()
@ -248,7 +248,7 @@ bool ScriptGroup::onAdd()
void ScriptGroup::onRemove()
{
// Call onRemove in script!
onRemove_callback(getId());
onRemove_callback(getId());
Parent::onRemove();
}

View file

@ -139,7 +139,7 @@ DefineConsoleFunction( spawnObject, S32, ( const char * spawnClass
, const char * spawnProperties
, const char * spawnScript
),("","","","") ,"spawnObject(class [, dataBlock, name, properties, script])"
"@hide")
"@hide")
{
SimObject* spawnObject = Sim::spawnObject(spawnClass, spawnDataBlock, spawnName, spawnProperties, spawnScript);
@ -203,12 +203,12 @@ ConsoleFunction(schedule, S32, 4, 0, "schedule(time, refobject|0, command, <arg1
}
DefineConsoleFunction( getUniqueName, const char*, (const char * baseName), ,
"( String baseName )\n"
"@brief Returns a unique unused SimObject name based on a given base name.\n\n"
"@baseName Name to conver to a unique string if another instance exists\n"
"@note Currently only used by editors\n"
"@ingroup Editors\n"
"@internal")
"( String baseName )\n"
"@brief Returns a unique unused SimObject name based on a given base name.\n\n"
"@baseName Name to conver to a unique string if another instance exists\n"
"@note Currently only used by editors\n"
"@ingroup Editors\n"
"@internal")
{
String outName = Sim::getUniqueName( baseName );
@ -247,10 +247,10 @@ DefineConsoleFunction( getUniqueInternalName, const char*, (const char * baseNam
}
DefineConsoleFunction( isValidObjectName, bool, (const char * name), , "( string name )"
"@brief Return true if the given name makes for a valid object name.\n\n"
"@param name Name of object\n"
"@return True if name is allowed, false if denied (usually because it starts with a number, _, or invalid character"
"@ingroup Console")
"@brief Return true if the given name makes for a valid object name.\n\n"
"@param name Name of object\n"
"@return True if name is allowed, false if denied (usually because it starts with a number, _, or invalid character"
"@ingroup Console")
{
return Sim::isValidObjectName( name );
}

View file

@ -150,7 +150,7 @@ void SimNameDictionary::remove(SimObject* obj)
if(*walk == obj)
{
*walk = obj->nextNameObject;
obj->nextNameObject = (SimObject*)-1;
obj->nextNameObject = (SimObject*)-1;
hashEntryCount--;
Mutex::unlockMutex(mutex);
@ -164,7 +164,7 @@ void SimNameDictionary::remove(SimObject* obj)
root.erase(name);
#endif
Mutex::unlockMutex(mutex);
}
}
//----------------------------------------------------------------------------
@ -279,7 +279,7 @@ void SimManagerNameDictionary::remove(SimObject* obj)
if(*walk == obj)
{
*walk = obj->nextManagerNameObject;
obj->nextManagerNameObject = (SimObject*)-1;
obj->nextManagerNameObject = (SimObject*)-1;
hashEntryCount--;
Mutex::unlockMutex(mutex);
@ -293,7 +293,7 @@ void SimManagerNameDictionary::remove(SimObject* obj)
root.erase(name);
#endif
Mutex::unlockMutex(mutex);
}
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------

View file

@ -61,7 +61,7 @@ struct StringTableEntryEq
}
};
typedef std::unordered_map<StringTableEntry, SimObject*, StringTableEntryHash, StringTableEntryEq> StringDictDef;
typedef std::unordered_map<StringTableEntry, SimObject*, StringTableEntryHash, StringTableEntryEq> StringDictDef;
typedef std::unordered_map<SimObjectId, SimObject*> SimObjectIdDictDef;
#endif

View file

@ -39,10 +39,10 @@ SimConsoleEvent::SimConsoleEvent(S32 argc, ConsoleValueRef *argv, bool onObject)
mArgv[i].value = new ConsoleValue();
mArgv[i].value->type = ConsoleValue::TypeInternalString;
mArgv[i].value->init();
if (argv)
{
mArgv[i].value->setStringValue((const char*)argv[i]);
}
if (argv)
{
mArgv[i].value->setStringValue((const char*)argv[i]);
}
}
}

View file

@ -93,7 +93,7 @@ static void shutdownEventQueue()
U32 postEvent(SimObject *destObject, SimEvent* event,U32 time)
{
AssertFatal(time == -1 || time >= getCurrentTime(),
AssertFatal(time == -1 || time >= getCurrentTime(),
"Sim::postEvent() - Event time must be greater than or equal to the current time." );
AssertFatal(destObject, "Sim::postEvent() - Destination object for event doesn't exist.");
@ -256,7 +256,7 @@ void advanceToTime(SimTime targetTime)
event->process(obj);
delete event;
}
gCurrentTime = targetTime;
gCurrentTime = targetTime;
Mutex::unlockMutex(gEventQueueMutex);
}
@ -393,7 +393,7 @@ SimObject* findObject(const char* name)
SimObject* findObject(SimObjectId id)
{
return gIdDictionary->find(id);
return gIdDictionary->find(id);
}
SimObject *spawnObject(String spawnClass, String spawnDataBlock, String spawnName,
@ -600,7 +600,7 @@ SimDataBlockGroup::SimDataBlockGroup()
S32 QSORT_CALLBACK SimDataBlockGroup::compareModifiedKey(const void* a,const void* b)
{
const SimDataBlock* dba = *((const SimDataBlock**)a);
const SimDataBlock* dba = *((const SimDataBlock**)a);
const SimDataBlock* dbb = *((const SimDataBlock**)b);
return dba->getModifiedKey() - dbb->getModifiedKey();
@ -612,6 +612,6 @@ void SimDataBlockGroup::sort()
if(mLastModifiedKey != SimDataBlock::getNextModifiedKey())
{
mLastModifiedKey = SimDataBlock::getNextModifiedKey();
dQsort(objectList.address(),objectList.size(),sizeof(SimObject *),compareModifiedKey);
dQsort(objectList.address(),objectList.size(),sizeof(SimObject *),compareModifiedKey);
}
}

View file

@ -81,7 +81,7 @@ SimObject::SimObject()
mFlags.set( ModStaticFields | ModDynamicFields );
mFieldDictionary = NULL;
mCanSaveFieldDictionary = true;
mCanSaveFieldDictionary = true;
mClassName = NULL;
mSuperClassName = NULL;
@ -592,7 +592,7 @@ void SimObject::setDeclarationLine(U32 lineNumber)
bool SimObject::registerObject()
{
AssertFatal( !mFlags.test( Added ), "reigsterObject - Object already registered!");
mFlags.clear(Deleted | Removed);
mFlags.clear(Deleted | Removed);
if(smForceId)
{
@ -609,11 +609,11 @@ bool SimObject::registerObject()
AssertFatal(Sim::gIdDictionary && Sim::gNameDictionary,
"SimObject::registerObject - tried to register an object before Sim::init()!");
Sim::gIdDictionary->insert(this);
Sim::gIdDictionary->insert(this);
Sim::gNameDictionary->insert(this);
// Notify object
// Notify object
bool ret = onAdd();
if(!ret)
@ -661,10 +661,10 @@ void SimObject::deleteObject()
void SimObject::_destroySelf()
{
AssertFatal( !isDeleted(), "SimObject::destroySelf - Object has already been deleted" );
AssertFatal( !isRemoved(), "SimObject::destroySelf - Object in the process of being removed" );
AssertFatal( !isDeleted(), "SimObject::destroySelf - Object has already been deleted" );
AssertFatal( !isRemoved(), "SimObject::destroySelf - Object in the process of being removed" );
mFlags.set( Deleted );
mFlags.set( Deleted );
if( mFlags.test( Added ) )
unregisterObject();
@ -1308,7 +1308,7 @@ void SimObject::dumpClassHierarchy()
while(pRep)
{
Con::warnf("%s ->", pRep->getClassName());
pRep = pRep->getParentClass();
pRep = pRep->getParentClass();
}
}
@ -1376,7 +1376,7 @@ bool SimObject::isChildOfGroup(SimGroup* pGroup)
if(pGroup == dynamic_cast<SimGroup*>(this))
return true;
SimGroup* temp = mGroup;
SimGroup* temp = mGroup;
while(temp)
{
if(temp == pGroup)
@ -2884,7 +2884,7 @@ DefineConsoleMethod( SimObject, isMemberOfClass, bool, ( const char* className )
return true;
}
pRep = pRep->getParentClass();
pRep = pRep->getParentClass();
}
return false;

View file

@ -826,7 +826,7 @@ class SimObject: public ConsoleObject, public TamlCallbacks
virtual bool readObject(Stream *stream);
/// Set whether fields created at runtime should be saved. Default is true.
void setCanSaveDynamicFields( bool bCanSave ) { mCanSaveFieldDictionary = bCanSave; }
void setCanSaveDynamicFields( bool bCanSave ) { mCanSaveFieldDictionary = bCanSave; }
/// Get whether fields created at runtime should be saved. Default is true.
bool getCanSaveDynamicFields( ) { return mCanSaveFieldDictionary;}

View file

@ -30,7 +30,7 @@
SimObjectMemento::SimObjectMemento()
: mState( NULL ),
mIsDatablock( false )
mIsDatablock( false )
{
}
@ -45,16 +45,16 @@ void SimObjectMemento::save( SimObject *object )
dFree( mState );
mObjectName = String::EmptyString;
// Use a stream to save the state.
// Use a stream to save the state.
MemStream stream( 256 );
U32 writeFlags = 0;
SimDataBlock* db = dynamic_cast<SimDataBlock*>(object);
if( !db )
stream.write( sizeof( "return " ) - 1, "return " );
else
SimDataBlock* db = dynamic_cast<SimDataBlock*>(object);
if( !db )
stream.write( sizeof( "return " ) - 1, "return " );
else
{
mIsDatablock = true;
mIsDatablock = true;
// Cull the datablock name from the output so that
// we can easily replace it in case the datablock's name
@ -64,7 +64,7 @@ void SimObjectMemento::save( SimObject *object )
writeFlags |= SimObject::NoName;
}
object->write( stream, 0, writeFlags );
stream.write( (UTF8)0 );
@ -82,9 +82,9 @@ SimObject *SimObjectMemento::restore() const
// TODO: We could potentially make this faster by
// caching the CodeBlock generated from the string
SimObject* object;
if( !mIsDatablock )
{
SimObject* object;
if( !mIsDatablock )
{
// Set the redefine behavior to automatically giving
// the new objects unique names. This will restore the
// old names if they are still available or give reasonable
@ -95,22 +95,22 @@ SimObject *SimObjectMemento::restore() const
// Read the object.
const UTF8* result = Con::evaluate( mState );
const UTF8* result = Con::evaluate( mState );
// Restore the redefine behavior.
Con::setVariable( "$Con::redefineBehavior", oldRedefineBehavior );
if ( !result || !result[ 0 ] )
return NULL;
if ( !result || !result[ 0 ] )
return NULL;
// Look up the object.
U32 objectId = dAtoi( result );
object = Sim::findObject( objectId );
}
else
{
U32 objectId = dAtoi( result );
object = Sim::findObject( objectId );
}
else
{
String objectName = mObjectName;
// For datablocks, it's getting a little complicated. Datablock definitions cannot be used
@ -140,16 +140,16 @@ SimObject *SimObjectMemento::restore() const
dStrcpy( &tempBuffer[ numCharsToLeftParen + uniqueNameLen ], &mState[ numCharsToLeftParen ] );
}
Con::evaluate( tempBuffer );
Con::evaluate( tempBuffer );
if( tempBuffer != mState )
dFree( tempBuffer );
if( objectName == String::EmptyString )
return NULL;
return NULL;
object = Sim::findObject( objectName );
}
object = Sim::findObject( objectName );
}
return object;
}

View file

@ -42,7 +42,7 @@ protected:
/// The captured object's name.
String mObjectName;
bool mIsDatablock;
bool mIsDatablock;
public:

View file

@ -29,13 +29,13 @@
IMPLEMENT_CONOBJECT( SimPersistSet );
ConsoleDocClass( SimPersistSet,
"@brief A SimSet that can be safely persisted.\n\n"
"Uses SimPersistIDs to reference objects in the set "
"while persisted on disk. This allows the set to resolve "
"its references no matter whether they are loaded before or "
"after the set is created.\n\n"
"Not intended for game development, for editors or internal use only.\n\n "
"@internal");
"@brief A SimSet that can be safely persisted.\n\n"
"Uses SimPersistIDs to reference objects in the set "
"while persisted on disk. This allows the set to resolve "
"its references no matter whether they are loaded before or "
"after the set is created.\n\n"
"Not intended for game development, for editors or internal use only.\n\n "
"@internal");
//-----------------------------------------------------------------------------

View file

@ -213,18 +213,18 @@ SimObject *loadObjectStream(Stream *stream)
//-----------------------------------------------------------------------------
DefineEngineFunction(saveObject, bool, ( SimObject *object, const char *filename ),,
"@brief Serialize the object to a file.\n\n"
"@param object The object to serialize.\n"
"@param filename The file name and path.\n"
"@ingroup Console\n")
"@brief Serialize the object to a file.\n\n"
"@param object The object to serialize.\n"
"@param filename The file name and path.\n"
"@ingroup Console\n")
{
return object && Sim::saveObject(object, filename);
}
DefineEngineFunction(loadObject, SimObject*, ( const char *filename ),,
"@brief Loads a serialized object from a file.\n\n"
"@param Name and path to text file containing the object\n"
"@ingroup Console\n")
"@brief Loads a serialized object from a file.\n\n"
"@param Name and path to text file containing the object\n"
"@ingroup Console\n")
{
return Sim::loadObjectStream(filename);
}

View file

@ -121,7 +121,7 @@ bool ConsoleValueStack::reserveValues(U32 count, ConsoleValueRef *outValues)
//Con::printf("[%i]CSTK reserveValues %i", mStackPos, count);
for (U32 i=0; i<count; i++)
{
outValues[i].value = &mStack[mStackPos+i];
outValues[i].value = &mStack[mStackPos+i];
}
mStackPos += count;
return true;

View file

@ -67,17 +67,17 @@ DefineConsoleFunction( telnetSetParameters, void, ( int port, const char* consol
"@param consolePass Password for read/write access to console.\n"
"@param listenPass Password for read access to console.\n"
"@param remoteEcho [optional] Enable echoing back to the client, off by default.\n\n"
"@ingroup Debugging")
"@ingroup Debugging")
{
if (TelConsole)
TelConsole->setTelnetParameters(port, consolePass, listenPass, remoteEcho);
TelConsole->setTelnetParameters(port, consolePass, listenPass, remoteEcho);
}
static void telnetCallback(U32 level, const char *consoleLine)
{
TORQUE_UNUSED(level);
if (TelConsole)
TelConsole->processConsoleLine(consoleLine);
TelConsole->processConsoleLine(consoleLine);
}
TelnetConsole::TelnetConsole()
@ -121,9 +121,9 @@ void TelnetConsole::setTelnetParameters(S32 port, const char *telnetPassword, co
mAcceptPort = port;
if(mAcceptPort != -1 && mAcceptPort != 0)
{
NetAddress address;
Net::getIdealListenAddress(&address);
address.port = mAcceptPort;
NetAddress address;
Net::getIdealListenAddress(&address);
address.port = mAcceptPort;
mAcceptSocket = Net::openSocket();
Net::bindAddress(address, mAcceptSocket);

View file

@ -115,8 +115,8 @@ MODULE_END;
DefineConsoleFunction( dbgSetParameters, void, (S32 port, const char * password, bool waitForClient ), (false), "( int port, string password, bool waitForClient )"
"Open a debug server port on the specified port, requiring the specified password, "
"and optionally waiting for the debug client to connect.\n"
"@internal Primarily used for Torsion and other debugging tools")
"and optionally waiting for the debug client to connect.\n"
"@internal Primarily used for Torsion and other debugging tools")
{
if (TelDebugger)
{
@ -126,17 +126,17 @@ DefineConsoleFunction( dbgSetParameters, void, (S32 port, const char * password,
DefineConsoleFunction( dbgIsConnected, bool, (), , "()"
"Returns true if a script debugging client is connected else return false.\n"
"@internal Primarily used for Torsion and other debugging tools")
"@internal Primarily used for Torsion and other debugging tools")
{
return TelDebugger && TelDebugger->isConnected();
}
DefineConsoleFunction( dbgDisconnect, void, (), , "()"
"Forcibly disconnects any attached script debugging client.\n"
"@internal Primarily used for Torsion and other debugging tools")
"@internal Primarily used for Torsion and other debugging tools")
{
if (TelDebugger)
TelDebugger->disconnect();
TelDebugger->disconnect();
}
static void debuggerConsumer(U32 level, const char *line)
@ -244,9 +244,9 @@ void TelnetDebugger::setDebugParameters(S32 port, const char *password, bool wai
mAcceptPort = port;
if(mAcceptPort != -1 && mAcceptPort != 0)
{
NetAddress address;
Net::getIdealListenAddress(&address);
address.port = mAcceptPort;
NetAddress address;
Net::getIdealListenAddress(&address);
address.port = mAcceptPort;
mAcceptSocket = Net::openSocket();
Net::bindAddress(address, mAcceptSocket);
@ -588,7 +588,7 @@ void TelnetDebugger::addAllBreakpoints(CodeBlock *code)
// TODO: This assumes that the OS file names are case
// insensitive... Torque needs a dFilenameCmp() function.
if( dStricmp( cur->fileName, code->name ) == 0 )
{
{
cur->code = code;
// Find the fist breakline starting from and
@ -741,7 +741,7 @@ void TelnetDebugger::removeBreakpoint(const char *fileName, S32 line)
{
Breakpoint *brk = *bp;
*bp = brk->next;
if ( brk->code )
if ( brk->code )
brk->code->clearBreakpoint(brk->lineNumber);
dFree(brk->testExpression);
delete brk;
@ -754,7 +754,7 @@ void TelnetDebugger::removeAllBreakpoints()
while(walk)
{
Breakpoint *temp = walk->next;
if ( walk->code )
if ( walk->code )
walk->code->clearBreakpoint(walk->lineNumber);
dFree(walk->testExpression);
delete walk;
@ -792,10 +792,10 @@ void TelnetDebugger::setBreakOnNextStatement( bool enabled )
for(CodeBlock *walk = CodeBlock::getCodeBlockList(); walk; walk = walk->nextFile)
walk->clearAllBreaks();
for(Breakpoint *w = mBreakpoints; w; w = w->next)
{
if ( w->code )
{
if ( w->code )
w->code->setBreakpoint(w->lineNumber);
}
}
mBreakOnNextStatement = false;
}
}
@ -848,7 +848,7 @@ void TelnetDebugger::debugStepOut()
setBreakOnNextStatement( false );
mStackPopBreakIndex = gEvalState.getStackDepth() - 1;
if ( mStackPopBreakIndex == 0 )
mStackPopBreakIndex = -1;
mStackPopBreakIndex = -1;
mProgramPaused = false;
send("RUNNING\r\n");
}

View file

@ -49,42 +49,42 @@ void TypeValidator::consoleError(SimObject *object, const char *format, ...)
void FRangeValidator::validateType(SimObject *object, void *typePtr)
{
F32 *v = (F32 *) typePtr;
if(*v < minV || *v > maxV)
{
consoleError(object, "Must be between %g and %g", minV, maxV);
if(*v < minV)
*v = minV;
else if(*v > maxV)
*v = maxV;
}
F32 *v = (F32 *) typePtr;
if(*v < minV || *v > maxV)
{
consoleError(object, "Must be between %g and %g", minV, maxV);
if(*v < minV)
*v = minV;
else if(*v > maxV)
*v = maxV;
}
}
void IRangeValidator::validateType(SimObject *object, void *typePtr)
{
S32 *v = (S32 *) typePtr;
if(*v < minV || *v > maxV)
{
consoleError(object, "Must be between %d and %d", minV, maxV);
if(*v < minV)
*v = minV;
else if(*v > maxV)
*v = maxV;
}
S32 *v = (S32 *) typePtr;
if(*v < minV || *v > maxV)
{
consoleError(object, "Must be between %d and %d", minV, maxV);
if(*v < minV)
*v = minV;
else if(*v > maxV)
*v = maxV;
}
}
void IRangeValidatorScaled::validateType(SimObject *object, void *typePtr)
{
S32 *v = (S32 *) typePtr;
*v /= factor;
if(*v < minV || *v > maxV)
{
consoleError(object, "Scaled value must be between %d and %d", minV, maxV);
if(*v < minV)
*v = minV;
else if(*v > maxV)
*v = maxV;
}
S32 *v = (S32 *) typePtr;
*v /= factor;
if(*v < minV || *v > maxV)
{
consoleError(object, "Scaled value must be between %d and %d", minV, maxV);
if(*v < minV)
*v = minV;
else if(*v > maxV)
*v = maxV;
}
}
void Point3NormalizeValidator::validateType(SimObject *object, void *typePtr)