mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-12 19:31:41 +00:00
Converts all game, gui editor, and system classes to utilize assets
Processed core, tools and default modules to utilize assets Converted all console types that were string based, such as TypeImageFilename to utilize const char*/the string table, which avoids a lot of type swapping shenanigans and avoids string corruption Removed unneeded MainEditor mockup module Removed some unused/duplicate image assets from the tools
This commit is contained in:
parent
83b0432283
commit
5525f8ecdd
1708 changed files with 19619 additions and 4596 deletions
|
|
@ -46,6 +46,8 @@
|
|||
/// For frame signal
|
||||
#include "gui/core/guiCanvas.h"
|
||||
|
||||
#include "T3D/assets/LevelAsset.h"
|
||||
|
||||
|
||||
extern bool gEditingMission;
|
||||
|
||||
|
|
@ -333,18 +335,23 @@ void Forest::createNewFile()
|
|||
mData = NULL;
|
||||
|
||||
// We need to construct a default file name
|
||||
String missionName( Con::getVariable( "$Client::MissionFile" ) );
|
||||
String levelDirectory( Con::getVariable( "$pref::Directories::Level" ) );
|
||||
if ( levelDirectory.isEmpty() )
|
||||
{
|
||||
levelDirectory = "levels";
|
||||
}
|
||||
missionName.replace( "tools/levels", levelDirectory );
|
||||
missionName = Platform::makeRelativePathName(missionName, Platform::getMainDotCsDir());
|
||||
String levelAssetId(Con::getVariable("$Client::LevelAsset"));
|
||||
|
||||
LevelAsset* levelAsset;
|
||||
if (!Sim::findObject(levelAssetId.c_str(), levelAsset))
|
||||
{
|
||||
Con::errorf("Forest::createNewFile() - Unable to find current level's LevelAsset. Unable to construct forest filePath");
|
||||
return;
|
||||
}
|
||||
|
||||
Torque::Path basePath(levelAsset->getForestPath() );
|
||||
|
||||
//If we didn't already define a forestfile to work with, just base it off our filename
|
||||
if (basePath.isEmpty())
|
||||
basePath = levelAsset->getLevelPath();
|
||||
|
||||
Torque::Path basePath( missionName );
|
||||
String fileName = Torque::FS::MakeUniquePath( basePath.getPath(), basePath.getFileName(), "forest" );
|
||||
mDataFileName = StringTable->insert( fileName );
|
||||
mDataFileName = StringTable->insert( fileName.c_str() );
|
||||
|
||||
ForestData *file = new ForestData;
|
||||
file->write( mDataFileName );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue