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
|
|
@ -196,7 +196,7 @@ U32 Prefab::packUpdate( NetConnection *conn, U32 mask, BitStream *stream )
|
|||
|
||||
if ( stream->writeFlag( mask & FileMask ) )
|
||||
{
|
||||
stream->write( mFilename );
|
||||
stream->writeString( mFilename );
|
||||
}
|
||||
|
||||
if ( stream->writeFlag( mask & TransformMask ) )
|
||||
|
|
@ -218,7 +218,7 @@ void Prefab::unpackUpdate(NetConnection *conn, BitStream *stream)
|
|||
// FileMask
|
||||
if ( stream->readFlag() )
|
||||
{
|
||||
stream->read( &mFilename );
|
||||
mFilename = stream->readSTString();
|
||||
}
|
||||
|
||||
// TransformMask
|
||||
|
|
@ -235,9 +235,7 @@ bool Prefab::protectedSetFile( void *object, const char *index, const char *data
|
|||
{
|
||||
Prefab *prefab = static_cast<Prefab*>(object);
|
||||
|
||||
String file = String( Platform::makeRelativePathName(data, Platform::getMainDotCsDir()) );
|
||||
|
||||
prefab->setFile( file );
|
||||
prefab->setFile( StringTable->insert(Platform::makeRelativePathName(data, Platform::getMainDotCsDir())));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -336,12 +334,12 @@ void Prefab::_loadFile( bool addFileNotify )
|
|||
{
|
||||
AssertFatal( isServerObject(), "Prefab-bad" );
|
||||
|
||||
if ( mFilename.isEmpty() )
|
||||
if ( mFilename == StringTable->EmptyString())
|
||||
return;
|
||||
|
||||
if ( !Platform::isFile( mFilename ) )
|
||||
{
|
||||
Con::errorf( "Prefab::_loadFile() - file %s was not found.", mFilename.c_str() );
|
||||
Con::errorf( "Prefab::_loadFile() - file %s was not found.", mFilename );
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -349,19 +347,19 @@ void Prefab::_loadFile( bool addFileNotify )
|
|||
{
|
||||
Con::errorf(
|
||||
"Prefab::_loadFile - failed loading prefab file (%s). \n"
|
||||
"File was referenced recursively by both a Parent and Child prefab.", mFilename.c_str() );
|
||||
"File was referenced recursively by both a Parent and Child prefab.", mFilename );
|
||||
return;
|
||||
}
|
||||
|
||||
sPrefabFileStack.push_back(mFilename);
|
||||
|
||||
String command = String::ToString( "exec( \"%s\" );", mFilename.c_str() );
|
||||
String command = String::ToString( "exec( \"%s\" );", mFilename );
|
||||
Con::evaluate( command );
|
||||
|
||||
SimGroup *group;
|
||||
if ( !Sim::findObject( Con::getVariable( "$ThisPrefab" ), group ) )
|
||||
{
|
||||
Con::errorf( "Prefab::_loadFile() - file %s did not create $ThisPrefab.", mFilename.c_str() );
|
||||
Con::errorf( "Prefab::_loadFile() - file %s did not create $ThisPrefab.", mFilename );
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -614,4 +612,4 @@ void ExplodePrefabUndoAction::redo()
|
|||
name += "_exploded";
|
||||
name = Sim::getUniqueName( name );
|
||||
mGroup->assignName( name );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue