mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-18 03:40:54 +00:00
generic asset loader macros. currently unused
This commit is contained in:
parent
98a079a797
commit
ab1b14587e
1 changed files with 24 additions and 0 deletions
|
|
@ -34,6 +34,18 @@
|
|||
m##name##Asset = NULL;\
|
||||
m##name = NULL;
|
||||
|
||||
//load asset into memory by looking up the ID, spew a warning if anything goes wrong
|
||||
#define LOAD_ASSET(name, assetClass)\
|
||||
if (m##name##AssetId != StringTable->EmptyString())\
|
||||
{\
|
||||
S32 assetState = assetClass::getAssetById(m##name##AssetId, &m##name##Asset);\
|
||||
if (assetState == assetClass::Ok )\
|
||||
{\
|
||||
m##name##Name = StringTable->EmptyString();\
|
||||
}\
|
||||
else Con::warnf("Warning: %s::LOAD_ASSET(%s)-%s", mClassName, m##name##AssetId, assetClass::getAssetErrstrn(assetState).c_str());\
|
||||
}
|
||||
|
||||
// copy constructor
|
||||
#define CLONE_ASSET(name) \
|
||||
m##name##Name = other.m##name##Name;\
|
||||
|
|
@ -134,6 +146,18 @@ DefineEngineMethod(className, set##name, bool, (const char* assetName), , assetT
|
|||
m##name[index] = NULL;\
|
||||
}
|
||||
|
||||
//load asset into memory by looking up the ID, spew a warning if anything goes wrong
|
||||
#define LOAD_ASSET_ARRAY(name, index, assetClass)\
|
||||
if (m##name##AssetId[index] != StringTable->EmptyString())\
|
||||
{\
|
||||
S32 assetState = assetClass::getAssetById(m##name##AssetId[index], &m##name##Asset[index]);\
|
||||
if (assetState == assetClass::Ok )\
|
||||
{\
|
||||
m##name##Name[index] = StringTable->EmptyString();\
|
||||
}\
|
||||
else Con::warnf("Warning: %s::LOAD_ASSET(%s[%d])-%s", mClassName, m##name##AssetId[index],index, assetClass::getAssetErrstrn(assetState).c_str());\
|
||||
}
|
||||
|
||||
// copy constructor
|
||||
#define CLONE_ASSET_ARRAY(name, index) \
|
||||
{\
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue