Parametrize script extension, default to 'tscript'

This commit is contained in:
Lukas Aldershaab 2020-12-12 16:54:16 +01:00
parent b8b62292bd
commit 099dd4f1f3
542 changed files with 774 additions and 783 deletions

View file

@ -2630,7 +2630,7 @@ Torque::Path AssetImporter::importMaterialAsset(AssetImportObject* assetItem)
StringTableEntry assetName = StringTable->insert(assetItem->assetName.c_str());
String tamlPath = targetPath + "/" + assetName + ".asset.taml";
String scriptName = assetItem->assetName + ".cs";
String scriptName = assetItem->assetName + "." TORQUE_SCRIPT_EXTENSION;
String scriptPath = targetPath + "/" + scriptName;
String originalPath = assetItem->filePath.getFullPath().c_str();
@ -2717,7 +2717,7 @@ Torque::Path AssetImporter::importMaterialAsset(AssetImportObject* assetItem)
//Now write the script file containing our material out
//There's 2 ways to do this. If we're in-place importing an existing asset, we can see if the definition existed already, like in an old
//materials.cs file. if it does, we can just find the object by name, and save it out to our new file
//materials.tscript file. if it does, we can just find the object by name, and save it out to our new file
//If not, we'll just generate one
Material* existingMat = MATMGR->getMaterialDefinitionByName(assetName);
@ -2878,10 +2878,10 @@ Torque::Path AssetImporter::importShapeAsset(AssetImportObject* assetItem)
String shapeFileName = assetItem->filePath.getFileName() + "." + assetItem->filePath.getExtension();
String assetPath = targetPath + "/" + shapeFileName;
String constructorPath = targetPath + "/" + assetItem->filePath.getFileName() + ".cs";
String constructorPath = targetPath + "/" + assetItem->filePath.getFileName() + "." TORQUE_SCRIPT_EXTENSION;
String tamlPath = targetPath + "/" + assetName + ".asset.taml";
String originalPath = assetItem->filePath.getFullPath().c_str();
String originalConstructorPath = assetItem->filePath.getPath() + "/" + assetItem->filePath.getFileName() + ".cs";
String originalConstructorPath = assetItem->filePath.getPath() + "/" + assetItem->filePath.getFileName() + "." TORQUE_SCRIPT_EXTENSION;
char qualifiedFromFile[2048];
char qualifiedToFile[2048];

View file

@ -87,13 +87,13 @@ GFXImplementVertexFormat( GFXVertexFoliage )
//
//------------------------------------------------------------------------------
//
// Put this in /example/common/editor/EditorGui.cs in [function Creator::init( %this )]
// Put this in /example/common/editor/EditorGui.tscript in [function Creator::init( %this )]
//
// %Environment_Item[8] = "fxFoliageReplicator"; <-- ADD THIS.
//
//------------------------------------------------------------------------------
//
// Put this in /example/common/client/missionDownload.cs in [function clientCmdMissionStartPhase3(%seq,%missionName)] (line 65)
// Put this in /example/common/client/missionDownload.tscript in [function clientCmdMissionStartPhase3(%seq,%missionName)] (line 65)
// after codeline 'onPhase2Complete();'.
//
// StartFoliageReplication();

View file

@ -37,14 +37,14 @@
//------------------------------------------------------------------------------
//
// Put this in /example/common/editor/editor.cs in function [Editor::create()] (around line 66).
// Put this in /example/common/editor/editor.tscript in function [Editor::create()] (around line 66).
//
// // Ignore Replicated fxStatic Instances.
// EWorldEditor.ignoreObjClass("fxShapeReplicatedStatic");
//
//------------------------------------------------------------------------------
//
// Put this in /example/common/editor/EditorGui.cs in [function Creator::init( %this )]
// Put this in /example/common/editor/EditorGui.tscript in [function Creator::init( %this )]
//
// %Environment_Item[8] = "fxShapeReplicator"; <-- ADD THIS.
//
@ -60,7 +60,7 @@
//
//------------------------------------------------------------------------------
//
// Put this in /example/common/client/missionDownload.cs in [function clientCmdMissionStartPhase3(%seq,%missionName)] (line 65)
// Put this in /example/common/client/missionDownload.tscript in [function clientCmdMissionStartPhase3(%seq,%missionName)] (line 65)
// after codeline 'onPhase2Complete();'.
//
// StartClientReplication();

View file

@ -62,8 +62,8 @@ struct AuthInfo;
// To disable datablock caching, remove or comment out the AFX_CAP_DATABLOCK_CACHE define below.
// Also, at a minimum, the following script preferences should be set to false:
// $pref::Client::EnableDatablockCache = false; (in arcane.fx/client/defaults.cs)
// $Pref::Server::EnableDatablockCache = false; (in arcane.fx/server/defaults.cs)
// $pref::Client::EnableDatablockCache = false; (in arcane.fx/client/defaults.tscript)
// $Pref::Server::EnableDatablockCache = false; (in arcane.fx/server/defaults.tscript)
// Alternatively, all script code marked with "DATABLOCK CACHE CODE" can be removed or
// commented out.
//

View file

@ -85,7 +85,7 @@ ConsoleDocClass( LightFlareData,
"as a 2D sprite in screenspace.\n\n"
"@tsexample\n"
"// example from Full Template, core/art/datablocks/lights.cs\n"
"// example from Full Template, core/art/datablocks/lights." TORQUE_SCRIPT_EXTENSION "\n"
"datablock LightFlareData( LightFlareExample0 )\n"
"{\n"
" overallScale = 2.0;\n"
@ -676,4 +676,4 @@ DefineEngineMethod( LightFlareData, apply, void, (),,
)
{
object->inspectPostApply();
}
}

View file

@ -294,7 +294,7 @@ DefineEngineStaticMethod( BanList, export, void, ( const char* filename ),,
"Dump the banlist to a file.\n\n"
"@param filename Path of the file to write the list to.\n\n"
"@tsexample\n"
"BanList::Export(\"./server/banlist.cs\");\n"
"BanList::Export(\"./server/banlist." TORQUE_SCRIPT_EXTENSION "\");\n"
"@endtsexample\n\n")
{
BanList::instance()->exportToFile( filename );

View file

@ -436,7 +436,7 @@ bool StandardMainLoop::handleCommandLine( S32 argc, const char **argv )
}
#endif
// Executes an entry script file. This is "main.cs"
// Executes an entry script file. This is "main.tscript"
// by default, but any file name (with no whitespace
// in it) may be run if it is specified as the first
// command-line parameter. The script used, default
@ -459,7 +459,7 @@ bool StandardMainLoop::handleCommandLine( S32 argc, const char **argv )
// The working filestream.
FileStream str;
const char *defaultScriptName = "main.cs";
const char *defaultScriptName = "main." TORQUE_SCRIPT_EXTENSION;
bool useDefaultScript = true;
// Check if any command-line parameters were passed (the first is just the app name).
@ -493,14 +493,14 @@ bool StandardMainLoop::handleCommandLine( S32 argc, const char **argv )
{
OpenFileDialog ofd;
FileDialogData &fdd = ofd.getData();
fdd.mFilters = StringTable->insert("Main Entry Script (main.cs)|main.cs|");
fdd.mFilters = StringTable->insert("Main Entry Script (main." TORQUE_SCRIPT_EXTENSION ")|main." TORQUE_SCRIPT_EXTENSION "|");
fdd.mTitle = StringTable->insert("Locate Game Entry Script");
// Get the user's selection
if( !ofd.Execute() )
return false;
// Process and update CWD so we can run the selected main.cs
// Process and update CWD so we can run the selected main.tscript
S32 pathLen = dStrlen( fdd.mFile );
FrameTemp<char> szPathCopy( pathLen + 1);

View file

@ -32,7 +32,7 @@ public:
/// Initialize core libraries and call registered init functions
static void init();
/// Pass command line arguments to registered functions and main.cs
/// Pass command line arguments to registered functions and main.tscript
static bool handleCommandLine(S32 argc, const char **argv);
/// A standard mainloop implementation.
@ -53,4 +53,4 @@ private:
static void preShutdown();
};
#endif
#endif

View file

@ -220,7 +220,7 @@ DefineEngineStringlyVariadicFunction( commandToServer, void, 2, RemoteCommandEve
"@tsexample\n"
"// Create a standard function. Needs to be executed on the client, such \n"
"// as within scripts/client/default.bind.cs\n"
"// as within scripts/client/default.bind." TORQUE_SCRIPT_EXTENSION "\n"
"function toggleCamera(%val)\n"
"{\n"
" // If key was down, call a server command named 'ToggleCamera'\n"
@ -228,7 +228,7 @@ DefineEngineStringlyVariadicFunction( commandToServer, void, 2, RemoteCommandEve
" commandToServer('ToggleCamera');\n"
"}\n\n"
"// Server command being called from above. Needs to be executed on the \n"
"// server, such as within scripts/server/commands.cs\n"
"// server, such as within scripts/server/commands." TORQUE_SCRIPT_EXTENSION "\n"
"function serverCmdToggleCamera(%client)\n"
"{\n"
" if (%client.getControlObject() == %client.player)\n"
@ -264,7 +264,7 @@ DefineEngineStringlyVariadicFunction( commandToClient, void, 3, RemoteCommandEve
"@tsexample\n"
"// Set up the client command. Needs to be executed on the client, such as\n"
"// within scripts/client/client.cs\n"
"// within scripts/client/client." TORQUE_SCRIPT_EXTENSION "\n"
"// Update the Ammo Counter with current ammo, if not any then hide the counter.\n"
"function clientCmdSetAmmoAmountHud(%amount)\n"
"{\n"
@ -277,7 +277,7 @@ DefineEngineStringlyVariadicFunction( commandToClient, void, 3, RemoteCommandEve
" }\n"
"}\n\n"
"// Call it from a server function. Needs to be executed on the server, \n"
"//such as within scripts/server/game.cs\n"
"//such as within scripts/server/game." TORQUE_SCRIPT_EXTENSION "\n"
"function GameConnection::setAmmoAmountHud(%client, %amount)\n"
"{\n"
" commandToClient(%client, 'SetAmmoAmountHud', %amount);\n"

View file

@ -323,7 +323,7 @@ void init()
ConsoleConstructor::setup();
// Set up the parser(s)
CON_ADD_PARSER(CMD, "cs", true); // TorqueScript
CON_ADD_PARSER(CMD, TORQUE_SCRIPT_EXTENSION, true); // TorqueScript
// Setup the console types.
ConsoleBaseType::initialize();
@ -1184,7 +1184,7 @@ bool executeFile(const char* fileName, bool noCalls, bool journalScript)
Con::expandScriptFilename(scriptFilenameBuffer, sizeof(scriptFilenameBuffer), fileName);
// since this function expects a script file reference, if it's a .dso
// lets terminate the string before the dso so it will act like a .cs
// lets terminate the string before the dso so it will act like a .tscript
if (dStrEndsWith(scriptFilenameBuffer, ".dso"))
{
scriptFilenameBuffer[dStrlen(scriptFilenameBuffer) - dStrlen(".dso")] = '\0';
@ -1206,11 +1206,11 @@ bool executeFile(const char* fileName, bool noCalls, bool journalScript)
// Check Editor Extensions
bool isEditorScript = false;
// If the script file extension is '.ed.cs' then compile it to a different compiled extension
if (dStricmp(ext, ".cs") == 0)
// If the script file extension is '.ed.tscript' then compile it to a different compiled extension
if (dStricmp(ext, "." TORQUE_SCRIPT_EXTENSION) == 0)
{
const char* ext2 = ext - 3;
if (dStricmp(ext2, ".ed.cs") == 0)
if (dStricmp(ext2, ".ed." TORQUE_SCRIPT_EXTENSION) == 0)
isEditorScript = true;
}
else if (dStricmp(ext, ".gui") == 0)

View file

@ -468,11 +468,11 @@ namespace Con
/// This is used in (among other places) the exec() script function, which
/// takes a parameter indicating a script file and executes it. Script paths
/// can be one of:
/// - <b>Absolute:</b> <i>fps/foo/bar.cs</i> Paths of this sort are passed
/// - <b>Absolute:</b> <i>fps/foo/bar.tscript</i> Paths of this sort are passed
/// through.
/// - <b>Mod-relative:</b> <i>~/foo/bar.cs</i> Paths of this sort have their
/// - <b>Mod-relative:</b> <i>~/foo/bar.tscript</i> Paths of this sort have their
/// replaced with the name of the current mod.
/// - <b>File-relative:</b> <i>./baz/blip.cs</i> Paths of this sort are
/// - <b>File-relative:</b> <i>./baz/blip.tscript</i> Paths of this sort are
/// calculated relative to the path of the current scripting file.
///
/// @note This function determines paths relative to the currently executing

View file

@ -75,7 +75,7 @@
/// setName() - obj.setName(newName)
/// @endcode
///
/// In the Torque example app, there are two functions defined in common\\client\\scriptDoc.cs
/// In the Torque example app, there are two functions defined in common\\client\\scriptDoc.tscript
/// which automate the process of dumping the documentation. They make use of the ConsoleLogger
/// object to output the documentation to a file, and look like this:
///

View file

@ -787,7 +787,7 @@ DefineEngineFunction( strIsMatchMultipleExpr, bool, ( const char* patterns, cons
"this string. If false, differences in casing are ignored.\n"
"@return True if @a str matches any of the given @a patterns.\n\n"
"@tsexample\n"
"strIsMatchMultipleExpr( \"*.cs *.gui *.mis\", \"mymission.mis\" ) // Returns true.\n"
"strIsMatchMultipleExpr( \"*." TORQUE_SCRIPT_EXTENSION " *.gui *.mis\", \"mymission.mis\" ) // Returns true.\n"
"@endtsexample\n"
"@see strIsMatchExpr\n"
"@ingroup Strings" )
@ -1200,7 +1200,7 @@ DefineEngineFunction( isValidIP, bool, ( const char* str),,
//----------------------------------------------------------------
// Torque won't normally add another string if it already exists with another casing,
// so this forces the addition. It should be called once near the start, such as in main.cs.
// so this forces the addition. It should be called once near the start, such as in main.tscript.
DefineEngineStringlyVariadicFunction(addCaseSensitiveStrings,void,2,0,"[string1, string2, ...]"
"Adds case sensitive strings to the StringTable.")
{
@ -1810,7 +1810,7 @@ DefineEngineFunction( detag, const char*, ( const char* str ),,
"to convert a tagged string ID back into a regular string at any time.\n\n"
"@tsexample\n"
"// From scripts/client/message.cs\n"
"// From scripts/client/message. " TORQUE_SCRIPT_EXTENSION "\n"
"function clientCmdChatMessage(%sender, %voice, %pitch, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10)\n"
"{\n"
" onChatMessage(detag(%msgString), %voice, %pitch);\n"
@ -2262,7 +2262,7 @@ static U32 journalDepth = 1;
DefineEngineFunction( getDSOPath, const char*, ( const char* scriptFileName ),,
"Get the absolute path to the file in which the compiled code for the given script file will be stored.\n"
"@param scriptFileName %Path to the .cs script file.\n"
"@param scriptFileName %Path to the ." TORQUE_SCRIPT_EXTENSION " script file.\n"
"@return The absolute path to the .dso file for the given script file.\n\n"
"@note The compiler will store newly compiled DSOs in the prefs path but pre-existing DSOs will be loaded "
"from the current paths.\n\n"
@ -2303,13 +2303,13 @@ DefineEngineFunction( compile, bool, ( const char* fileName, bool overrideNoDSO
if(dsoPath && *dsoPath == 0)
return false;
// If the script file extention is '.ed.cs' then compile it to a different compiled extention
// If the script file extention is '.ed.tscript' then compile it to a different compiled extention
bool isEditorScript = false;
const char *ext = dStrrchr( scriptFilenameBuffer, '.' );
if( ext && ( dStricmp( ext, ".cs" ) == 0 ) )
if( ext && ( dStricmp( ext, "." TORQUE_SCRIPT_EXTENSION) == 0 ) )
{
const char* ext2 = ext - 3;
if( dStricmp( ext2, ".ed.cs" ) == 0 )
if( dStricmp( ext2, ".ed." TORQUE_SCRIPT_EXTENSION) == 0 )
isEditorScript = true;
}
else if( ext && ( dStricmp( ext, ".gui" ) == 0 ) )
@ -2364,8 +2364,8 @@ DefineEngineFunction( exec, bool, ( const char* fileName, bool noCalls, bool jou
"@param journalScript Deprecated\n"
"@return True if the script was successfully executed, false if not.\n\n"
"@tsexample\n"
"// Execute the init.cs script file found in the same directory as the current script file.\n"
"exec( \"./init.cs\" );\n"
"// Execute the init." TORQUE_SCRIPT_EXTENSION " script file found in the same directory as the current script file.\n"
"exec( \"./init." TORQUE_SCRIPT_EXTENSION "\" );\n"
"@endtsexample\n\n"
"@see compile\n"
"@see eval\n"
@ -2684,8 +2684,8 @@ DefineEngineFunction( export, void, ( const char* pattern, const char* filename,
"@param append If true and @a fileName is not \"\", then the definitions are appended to the specified file. "
"Otherwise existing contents of the file (if any) will be overwritten.\n\n"
"@tsexample\n"
"// Write out all preference variables to a prefs.cs file.\n"
"export( \"$prefs::*\", \"prefs.cs\" );\n"
"// Write out all preference variables to a prefs." TORQUE_SCRIPT_EXTENSION " file.\n"
"export( \"$prefs::*\", \"prefs." TORQUE_SCRIPT_EXTENSION "\" );\n"
"@endtsexample\n\n"
"@ingroup Scripting" )
{

View file

@ -103,7 +103,7 @@ void freeConsoleParserList(void);
/// \param p Parse function
/// \param r Restart function
/// \param ssb SetScanBuffer function
/// \param def true if this is the default parser (<b>Note:</b> set this only on the .cs parser!)
/// \param def true if this is the default parser (<b>Note:</b> set this only on the .tscript parser!)
/// \return true for success, false for failure (out of memory)
/// \sa FreeConsoleParserList(), ConsoleParser
//-----------------------------------------------------------------------------

View file

@ -156,8 +156,8 @@ DefineEngineFunction( findFirstFile, String, ( const char* pattern, bool recurse
"@return The path of the first file matched by the search or an empty string if no matching file could be found.\n\n"
"@tsexample\n"
"// Execute all .cs files in a subdirectory and its subdirectories.\n"
"for( %file = findFirstFile( \"subdirectory/*.cs\" ); %file !$= \"\"; %file = findNextFile() )\n"
"// Execute all ." TORQUE_SCRIPT_EXTENSION " files in a subdirectory and its subdirectories.\n"
"for( %file = findFirstFile( \"subdirectory/*." TORQUE_SCRIPT_EXTENSION "\" ); %file !$= \"\"; %file = findNextFile() )\n"
" exec( %file );\n"
"@endtsexample\n\n"
@ -193,8 +193,8 @@ DefineEngineFunction( findNextFile, String, ( const char* pattern ), ( "" ),
"@return The path of the next filename matched by the search or an empty string if no more files match.\n\n"
"@tsexample\n"
"// Execute all .cs files in a subdirectory and its subdirectories.\n"
"for( %file = findFirstFile( \"subdirectory/*.cs\" ); %file !$= \"\"; %file = findNextFile() )\n"
"// Execute all ." TORQUE_SCRIPT_EXTENSION " files in a subdirectory and its subdirectories.\n"
"for( %file = findFirstFile( \"subdirectory/*." TORQUE_SCRIPT_EXTENSION "\" ); %file !$= \"\"; %file = findNextFile() )\n"
" exec( %file );\n"
"@endtsexample\n\n"
@ -224,8 +224,8 @@ DefineEngineFunction( getFileCount, S32, ( const char* pattern, bool recurse ),
"@return Number of files located using the pattern\n\n"
"@tsexample\n"
"// Count the number of .cs files in a subdirectory and its subdirectories.\n"
"getFileCount( \"subdirectory/*.cs\" );\n"
"// Count the number of ." TORQUE_SCRIPT_EXTENSION " files in a subdirectory and its subdirectories.\n"
"getFileCount( \"subdirectory/*." TORQUE_SCRIPT_EXTENSION "\" );\n"
"@endtsexample\n\n"
"@see findFirstFile()"
@ -259,8 +259,8 @@ 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 "
"multiple patterns with TABs. For example: \"*.cs\" TAB \"*.dso\"\n"
"@param pattern The path and file name pattern to match against, such as *." TORQUE_SCRIPT_EXTENSION ". Separate "
"multiple patterns with TABs. For example: \"*." TORQUE_SCRIPT_EXTENSION "\" 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"
"@return String of the first matching file path, or an empty string if no matching "
@ -333,8 +333,8 @@ DefineEngineFunction(getFileCountMultiExpr, S32, ( const char* pattern, bool rec
"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 "
"multiple patterns with TABs. For example: \"*.cs\" TAB \"*.dso\"\n"
"@param pattern The path and file name pattern to match against, such as *." TORQUE_SCRIPT_EXTENSION ". Separate "
"multiple patterns with TABs. For example: \"*." TORQUE_SCRIPT_EXTENSION "\" 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"
@ -589,7 +589,7 @@ DefineEngineFunction(fileExt, String, ( const char* fileName ),,
"@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"
"@return String containing the extension, such as \".exe\" or \"." TORQUE_SCRIPT_EXTENSION "\"\n"
"@ingroup FileSystem")
{
const char *ret = dStrrchr(fileName, '.');
@ -744,7 +744,7 @@ DefineEngineFunction(getExecutableName, String, (),,
//-----------------------------------------------------------------------------
DefineEngineFunction( getMainDotCsDir, String, (),,
"@brief Get the absolute path to the directory that contains the main.cs script from which the engine was started.\n\n"
"@brief Get the absolute path to the directory that contains the main." TORQUE_SCRIPT_EXTENSION " script from which the engine was started.\n\n"
"This directory will usually contain all the game assets and, in a user-side game installation, will usually be "
"read-only.\n\n"

View file

@ -36,7 +36,7 @@ class CodeBlock;
/// To use the debugger, use dbgSetParameters(port, password); in the console
/// of the server to enable debugger connections. Then on some other system,
/// start up the app (you don't have to start a game or connect to the
/// server) and exec("common/debugger/debugger.cs"); in the console. Then use
/// server) and exec("common/debugger/debugger.tscript"); in the console. Then use
/// the debugger GUI to connect to the server with the right port and password.
///
/// @see http://www.planettribes.com/tribes2/editing.shtml for more thorough discussion.

View file

@ -409,7 +409,7 @@ FileNodeRef ZipFileSystem::resolve(const Path& path)
// If a zip file's name isn't the root of the path we're looking for
// then do not continue. Otherwise, we'll continue to look for the
// path's root within the zip file itself. i.e. we're looking for the
// path "scripts/test.cs". If the zip file itself isn't called scripts.zip
// path "scripts/test.tscript". If the zip file itself isn't called scripts.zip
// then we won't look within the archive for a "scripts" directory.
return NULL;
#endif
@ -472,4 +472,4 @@ void ZipFileSystem::_init()
//mZipArchive->dumpCentralDirectory();
}
};
};

View file

@ -46,7 +46,7 @@ namespace FS
/// 3) Nothing special is done for the WriteAppend case; that is, it follows the same logic as if you were
/// just trying to Write the file.
///
/// Because of rule 1) above, you should take care that any files you need to write (such as prefs.cs), are not
/// Because of rule 1) above, you should take care that any files you need to write (such as prefs.tscript), are not
/// included in read-only zip archive files.
class VirtualMountSystem : public MountSystem
{

View file

@ -64,16 +64,16 @@ void GFXCardProfiler::loadProfileScript(const char* aScriptName)
void GFXCardProfiler::loadProfileScripts(const String& render, const String& vendor, const String& card, const String& version)
{
String script = render + ".cs";
String script = render + "." TORQUE_SCRIPT_EXTENSION;
loadProfileScript(script);
script = render + "." + vendor + ".cs";
script = render + "." + vendor + "." TORQUE_SCRIPT_EXTENSION;
loadProfileScript(script);
script = render + "." + vendor + "." + card + ".cs";
script = render + "." + vendor + "." + card + "." TORQUE_SCRIPT_EXTENSION;
loadProfileScript(script);
script = render + "." + vendor + "." + card + "." + version + ".cs";
script = render + "." + vendor + "." + card + "." + version + "." TORQUE_SCRIPT_EXTENSION;
loadProfileScript(script);
}

View file

@ -67,7 +67,7 @@ GuiFileTreeCtrl::GuiFileTreeCtrl()
mSupportMouseDragging = false;
mMultipleSelections = false;
mFileFilter = "*.cs *.gui *.ed.cs";
mFileFilter = "*." TORQUE_SCRIPT_EXTENSION " *.gui *.ed." TORQUE_SCRIPT_EXTENSION;
_initFilters();
}
@ -111,7 +111,7 @@ void GuiFileTreeCtrl::updateTree()
if( !mRootPath.isEmpty() )
rootPath = String::ToString( "%s/%s", rootPath.c_str(), mRootPath.c_str() );
// get the files in the main.cs dir
// get the files in the main.tscript dir
Vector<StringTableEntry> pathVec;
Platform::dumpDirectories( rootPath, pathVec, 0, true);
_dumpFiles( rootPath, pathVec, 0);

View file

@ -510,7 +510,7 @@ bool compiledFileNeedsUpdate(UTF8* filename)
DefineEngineFunction(CompileLanguage, void, (const char* inputFile, bool createMap), (false),
"@brief Compiles a LSO language file."
" if createIndex is true, will also create languageMap.cs with"
" if createIndex is true, will also create languageMap." TORQUE_SCRIPT_EXTENSION " with"
" the global variables for each string index."
" The input file must follow this example layout:"
" TXT_HELLO_WORLD = Hello world in english!")
@ -538,9 +538,9 @@ DefineEngineFunction(CompileLanguage, void, (const char* inputFile, bool createM
{
Torque::Path mapPath = scriptFilenameBuffer;
mapPath.setFileName("languageMap");
mapPath.setExtension("cs");
mapPath.setExtension(TORQUE_SCRIPT_EXTENSION);
if ((mapStream = FileStream::createAndOpen(mapPath, Torque::FS::File::Write)) == NULL)
Con::errorf("CompileLanguage - failed creating languageMap.cs");
Con::errorf("CompileLanguage - failed creating languageMap." TORQUE_SCRIPT_EXTENSION);
}
LangFile langFile;

View file

@ -532,7 +532,7 @@ bool Material::onAdd()
matSet->addObject( (SimObject*)this );
// save the current script path for texture lookup later
const String scriptFile = Con::getVariable("$Con::File"); // current script file - local materials.cs
const String scriptFile = Con::getVariable("$Con::File"); // current script file - local materials.tscript
String::SizeType slash = scriptFile.find( '/', scriptFile.length(), String::Right );
if ( slash != String::NPos )

View file

@ -267,12 +267,12 @@ namespace Platform
/// Returns full pathname of the torque executable without filename
StringTableEntry getExecutablePath();
/// Returns the full path to the directory that contains main.cs.
/// Returns the full path to the directory that contains main.tscript.
/// Tools scripts are validated as such if they are in this directory or a
/// subdirectory of this directory.
StringTableEntry getMainDotCsDir();
/// Set main.cs directory. Used in runEntryScript()
/// Set main.tscript directory. Used in runEntryScript()
void setMainDotCsDir(const char *dir);
StringTableEntry getPrefsPath(const char *file = NULL);

View file

@ -67,7 +67,7 @@ ConsoleDocClass( RenderDeferredMgr,
"and render them to the g-buffer for use in lighting the scene and doing effects.\n\n"
"PostEffect and other shaders can access the output of this bin by using the #deferred "
"texture target name. See the edge anti-aliasing post effect for an example.\n\n"
"@see game/core/scripts/client/postFx/edgeAA.cs\n"
"@see game/core/scripts/client/postFx/edgeAA." TORQUE_SCRIPT_EXTENSION "\n"
"@ingroup RenderBin\n" );

View file

@ -42,7 +42,7 @@ ConsoleDocClass( RenderFormatToken,
"The RenderPassStateBin manager changes the rendering state associated with "
"this token. In stock Torque 3D, a single example exists in the "
"way of AL_FormatToken (found in renderManager.cs). In that script file, all the "
"way of AL_FormatToken (found in renderManager." TORQUE_SCRIPT_EXTENSION "). In that script file, all the "
"render managers are intialized, and a single RenderFormatToken is used. This "
"implementation basically exists to ensure Advanced Lighting works with MSAA.\n\n"
@ -72,7 +72,7 @@ ConsoleDocClass( RenderFormatToken,
"@see RenderPassToken\n\n"
"@see RenderPassStateBin\n"
"@see game/core/scripts/client/renderManager.cs\n"
"@see game/core/scripts/client/renderManager." TORQUE_SCRIPT_EXTENSION "\n"
"@ingroup GFX\n"
);
@ -381,4 +381,4 @@ void RenderFormatToken::onRemove()
mTarget.release();
Parent::onRemove();
}
}

View file

@ -110,7 +110,7 @@ ConsoleDocClass( RenderPassManager,
"The render pass is used to order a set of RenderBinManager objects which are used "
"when rendering a scene. This class does little work itself other than managing "
"its list of render bins.\n\n"
"In 'core/scripts/client/renderManager.cs' you will find the DiffuseRenderPassManager "
"In 'core/scripts/client/renderManager." TORQUE_SCRIPT_EXTENSION "' you will find the DiffuseRenderPassManager "
"which is used by the C++ engine to render the scene.\n\n"
"@see RenderBinManager\n"
"@ingroup RenderBin\n" );

View file

@ -37,13 +37,13 @@ ConsoleDocClass( RenderPassStateToken,
"The RenderPassStateBin manager changes the rendering state associated with "
"a token it is declared with. In stock Torque 3D, a single example exists in the "
"way of AL_FormatToken (found in renderManager.cs). In that script file, all the "
"way of AL_FormatToken (found in renderManager." TORQUE_SCRIPT_EXTENSION "). In that script file, all the "
"render managers are intialized, and a single RenderFormatToken is used. This "
"implementation basically exists to ensure Advanced Lighting works with MSAA.\n\n"
"@see RenderFormatToken\n"
"@see RenderPassStateBin\n"
"@see game/core/scripts/client/renderManager.cs\n"
"@see game/core/scripts/client/renderManager." TORQUE_SCRIPT_EXTENSION "\n"
"@ingroup RenderBin\n"
);
@ -160,4 +160,4 @@ DefineEngineMethod(RenderPassStateToken, toggle, void, (),,
"@brief Toggles the token from enabled to disabled or vice versa." )
{
object->enable(!object->isEnabled());
}
}

View file

@ -2218,8 +2218,8 @@ DefineEngineMethod( ActionMap, save, void, ( const char* fileName, bool append )
" the ActionMap will be dumped to the console.\n"
"@param append Whether to write the ActionMap at the end of the file or overwrite it.\n"
"@tsexample\n"
"// Write out the actionmap into the config.cs file\n"
"moveMap.save( \"scripts/client/config.cs\" );"
"// Write out the actionmap into the config." TORQUE_SCRIPT_EXTENSION " file\n"
"moveMap.save( \"scripts/client/config." TORQUE_SCRIPT_EXTENSION "\" );"
"@endtsexample\n\n")
{
char buffer[1024];

View file

@ -150,7 +150,7 @@ void AssimpAppMaterial::initMaterial(const Torque::Path& path, Material* mat) co
else
{ // OPAQUE
translucent = false;
blendOp = Material::LerpAlpha; // Make default so it doesn't get written to materials.cs
blendOp = Material::LerpAlpha; // Make default so it doesn't get written to materials.tscript
}
}
}
@ -296,7 +296,7 @@ String AssimpAppMaterial::cleanTextureName(String& texName, String& shapeName, c
if (nameOnly)
cleanStr = foundPath.getFullFileName();
else
{ // Unless the file is in the same directory as the materials.cs (covered above)
{ // Unless the file is in the same directory as the materials.tscript (covered above)
// we need to set the full path from the root directory. If we use "subdirectory/file.ext",
// the material manager won't find the image file, but it will be found the next time the
// material is loaded from file. If we use "./subdirectory/file.ext", the image will be found

View file

@ -427,7 +427,7 @@ void AssimpShapeLoader::updateMaterialsScript(const Torque::Path &path)
{
Torque::Path scriptPath(path);
scriptPath.setFileName("materials");
scriptPath.setExtension("cs");
scriptPath.setExtension(TORQUE_SCRIPT_EXTENSION);
// First see what materials we need to update
PersistenceManager persistMgr;

View file

@ -40,7 +40,7 @@ public:
ColladaExtension_effect* effectExt; ///< effect extension
String name; ///< Name of this material (cleaned)
// Settings extracted from the Collada file, and optionally saved to materials.cs
// Settings extracted from the Collada file, and optionally saved to materials.tscript
String diffuseMap;
String normalMap;

View file

@ -453,7 +453,7 @@ void copySketchupTexture(const Torque::Path &path, String &textureFilename)
}
//-----------------------------------------------------------------------------
/// Add collada materials to materials.cs
/// Add collada materials to materials.tscript
void updateMaterialsScript(const Torque::Path &path, bool copyTextures = false)
{
#ifdef DAE2DTS_TOOL
@ -463,7 +463,7 @@ void updateMaterialsScript(const Torque::Path &path, bool copyTextures = false)
Torque::Path scriptPath(path);
scriptPath.setFileName("materials");
scriptPath.setExtension("cs");
scriptPath.setExtension(TORQUE_SCRIPT_EXTENSION);
// First see what materials we need to update
PersistenceManager persistMgr;
@ -731,7 +731,7 @@ TSShape* loadColladaShape(const Torque::Path &path)
#endif // DAE2DTS_TOOL
// Add collada materials to materials.cs
// Add collada materials to materials.tscript
updateMaterialsScript(path, isSketchup);
}
}

View file

@ -181,7 +181,7 @@ String ColladaUtils::resolveImagePath(const domImage* image)
// it is inside the Torque folder, otherwise force textures
// to be in the same folder as the shape.
// 2. If the URI string contains a relative path, append it
// to the shape path (since materials.cs cannot handle
// to the shape path (since materials.tscript cannot handle
// relative paths).
Torque::Path imagePath;

View file

@ -101,7 +101,7 @@ namespace ColladaUtils
bool ignoreNodeScale; // Ignore <scale> elements in <node>s
bool adjustCenter; // Translate model so origin is at the center
bool adjustFloor; // Translate model so origin is at the bottom
bool forceUpdateMaterials; // Force update of materials.cs
bool forceUpdateMaterials; // Force update of materials.tscript
bool useDiffuseNames; // Use diffuse texture as the material name
// Assimp specific preprocess import options

View file

@ -2112,14 +2112,14 @@ template<> void *Resource<TSShape>::create(const Torque::Path &path)
{
// Execute the shape script if it exists
Torque::Path scriptPath(path);
scriptPath.setExtension("cs");
scriptPath.setExtension(TORQUE_SCRIPT_EXTENSION);
// Don't execute the script if we're already doing so!
StringTableEntry currentScript = Platform::stripBasePath(CodeBlock::getCurrentCodeBlockFullPath());
if (!scriptPath.getFullPath().equal(currentScript))
{
Torque::Path scriptPathDSO(scriptPath);
scriptPathDSO.setExtension("cs.dso");
scriptPathDSO.setExtension(TORQUE_SCRIPT_EXTENSION ".dso");
if (Torque::FS::IsFile(scriptPathDSO) || Torque::FS::IsFile(scriptPath))
{

View file

@ -313,9 +313,9 @@ void TSShapeConstructor::initPersistFields()
"@see adjustCenter" );
addField( "forceUpdateMaterials", TypeBool, Offset(mOptions.forceUpdateMaterials, TSShapeConstructor),
"Forces update of the materials.cs file in the same folder as the COLLADA "
"Forces update of the materials." TORQUE_SCRIPT_EXTENSION " file in the same folder as the COLLADA "
"(.dae) file, even if Materials already exist. No effect for DTS files.\n"
"Normally only Materials that are not already defined are written to materials.cs." );
"Normally only Materials that are not already defined are written to materials." TORQUE_SCRIPT_EXTENSION "." );
// Fields added for assimp options
addField( "convertLeftHanded", TypeBool, Offset(mOptions.convertLeftHanded, TSShapeConstructor),
@ -710,11 +710,11 @@ DefineTSShapeConstructorMethod( saveShape, void, ( const char* filename ),,
DefineTSShapeConstructorMethod( writeChangeSet, void, (),,
(),,
"Write the current change set to a TSShapeConstructor script file. The "
"name of the script file is the same as the model, but with .cs extension. "
"eg. myShape.cs for myShape.dts or myShape.dae.\n" )
"name of the script file is the same as the model, but with ." TORQUE_SCRIPT_EXTENSION " extension. "
"eg. myShape." TORQUE_SCRIPT_EXTENSION " for myShape.dts or myShape.dae.\n" )
{
Torque::Path scriptPath( mShapePath );
scriptPath.setExtension( "cs" );
scriptPath.setExtension(TORQUE_SCRIPT_EXTENSION);
// Read current file contents
FileObject f;