mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-10 22:24:33 +00:00
add compile options to asset manager
CompileAll - allows us to compile all assets to binary CompileModuleAssets - allows us to just compile assets for a specific module CompileAsset - compile a single asset
This commit is contained in:
parent
7d497383da
commit
f1658d2e1e
3 changed files with 206 additions and 4 deletions
|
|
@ -1,4 +1,4 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (c) 2013 GarageGames, LLC
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
|
|
@ -20,11 +20,12 @@
|
|||
// IN THE SOFTWARE.
|
||||
//-----------------------------------------------------------------------------
|
||||
#include "console/engineAPI.h"
|
||||
#include "assetBase.h"
|
||||
#include "assetManager.h"
|
||||
#include "assets/assetBase.h"
|
||||
#include "assets/assetManager.h"
|
||||
#include "module/moduleDefinition.h"
|
||||
#include "console/sim.h"
|
||||
|
||||
|
||||
DefineEngineMethod(AssetManager, compileReferencedAssets, bool, (const char* moduleDefinition), (""),
|
||||
"Compile the referenced assets determined by the specified module definition.\n"
|
||||
"@param moduleDefinition The module definition specifies the asset manifest.\n"
|
||||
|
|
@ -853,3 +854,40 @@ DefineEngineMethod(AssetManager, dumpDeclaredAssets, void, (), ,
|
|||
{
|
||||
return object->dumpDeclaredAssets();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
DefineEngineMethod(AssetManager, compileAllAssets, bool, (bool compressed, bool includeUnloaded),(false, true),
|
||||
"Compile all assets.\n"
|
||||
"@return true on success.\n")
|
||||
{
|
||||
return object->compileAllAssets(compressed, includeUnloaded);
|
||||
}
|
||||
|
||||
DefineEngineMethod(AssetManager, compileModuleAssets, bool, (const char* moduleDefinition), (""),
|
||||
"Compile all assets for a module.\n"
|
||||
"@return true on success.\n")
|
||||
{
|
||||
// Fetch module definition.
|
||||
ModuleDefinition* pModuleDefinition;
|
||||
Sim::findObject(moduleDefinition, pModuleDefinition);
|
||||
|
||||
// Did we find the module definition?
|
||||
if (pModuleDefinition == NULL)
|
||||
{
|
||||
// No, so warn.
|
||||
Con::warnf("AssetManager::removeDeclaredAssets() - Could not find the module definition '%s'.", moduleDefinition);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Remove declared assets.
|
||||
return object->compileModuleAssets(pModuleDefinition);
|
||||
}
|
||||
|
||||
DefineEngineMethod(AssetManager, compileAsset, bool, (const char* assetId), (""),
|
||||
"Compile a single asset.\n"
|
||||
"@return true on success.\n")
|
||||
{
|
||||
return object->compileAsset(assetId);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue