mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Adds console function to compare file modified times
Adds console function to save a scaled image Improved logic of generating previews for shape, material and image assets to regen if original asset loose file was modified Added logic to generate scaled preview image for material and image assets to improve load times of AB
This commit is contained in:
parent
555c563b39
commit
34f0f01cea
6 changed files with 206 additions and 41 deletions
|
|
@ -580,6 +580,27 @@ DefineEngineFunction( fileCreatedTime, String, ( const char* fileName ),,
|
|||
return buffer;
|
||||
}
|
||||
|
||||
DefineEngineFunction(compareFileTimes, S32, (const char* fileA, const char* fileB), ("", ""),
|
||||
"@brief Compares 2 files' modified file times."
|
||||
|
||||
"@param fileName Name and path of first file to compare\n"
|
||||
"@param fileName Name and path of second file to compare\n"
|
||||
"@return S32. If value is 1, then fileA is newer. If value is -1, then fileB is newer. If value is 0, they are equal.\n"
|
||||
"@ingroup FileSystem")
|
||||
{
|
||||
Con::expandScriptFilename(sgScriptFilenameBuffer, sizeof(sgScriptFilenameBuffer), fileA);
|
||||
|
||||
FileTime fileATime = { 0 };
|
||||
Platform::getFileTimes(sgScriptFilenameBuffer, NULL, &fileATime);
|
||||
|
||||
Con::expandScriptFilename(sgScriptFilenameBuffer, sizeof(sgScriptFilenameBuffer), fileB);
|
||||
|
||||
FileTime fileBTime = { 0 };
|
||||
Platform::getFileTimes(sgScriptFilenameBuffer, NULL, &fileBTime);
|
||||
|
||||
return Platform::compareFileTimes(fileATime, fileBTime);
|
||||
}
|
||||
|
||||
DefineEngineFunction(fileDelete, bool, ( const char* path ),,
|
||||
"@brief Delete a file from the hard drive\n\n"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue