error string interpreter, example of usage in shapebase::preload, plus flips the datablock filter back on to save some network bandwidth.

This commit is contained in:
AzaezelX 2020-12-03 15:37:51 -06:00
parent 220771d2fe
commit 8bb43dd5ae
5 changed files with 68 additions and 22 deletions

View file

@ -52,6 +52,18 @@ StringTableEntry assetInternalField = StringTable->insert("AssetInternal");
StringTableEntry assetPrivateField = StringTable->insert("AssetPrivate");
//-----------------------------------------------------------------------------
const String AssetBase::mErrCodeStrings[] =
{
"Failed",
"Ok",
"NotLoaded",
"BadFileReference",
"InvalidFormat",
"DependencyNotFound",
"FileTooLarge",
"UsingFallback",
"UnKnown"
};
AssetBase::AssetBase() :
mpOwningAssetManager(NULL),

View file

@ -55,20 +55,6 @@ extern StringTableEntry assetAutoUnloadField;
//#define ASSET_BASE_AUTOUNLOAD_FIELD "AssetAutoUnload"
//-----------------------------------------------------------------------------
enum AssetErrCode
{
Failed,
Ok,
NotLoaded,
BadFileReference,
InvalidFormat,
DependencyNotFound,
FileTooLarge,
UsingFallback,
Extended
};
class AssetBase : public SimObject
{
friend class AssetManager;
@ -82,6 +68,26 @@ protected:
U32 mAcquireReferenceCount;
public:
enum AssetErrCode
{
Failed,
Ok,
NotLoaded,
BadFileReference,
InvalidFormat,
DependencyNotFound,
FileTooLarge,
UsingFallback,
Extended
};
static const String mErrCodeStrings[AssetErrCode::Extended + 1];
static String getAssetErrstrn(U32 errCode)
{
if (errCode > AssetErrCode::Extended) return "undefined error";
return mErrCodeStrings[errCode];
};
AssetBase();
virtual ~AssetBase();