|
@@ -123,7 +123,7 @@ public:
|
|
};
|
|
};
|
|
|
|
|
|
static const String mErrCodeStrings[U32(ImageAssetErrCode::Extended) - U32(Parent::Extended) + 1];
|
|
static const String mErrCodeStrings[U32(ImageAssetErrCode::Extended) - U32(Parent::Extended) + 1];
|
|
- static U32 getAssetErrCode(ConcreteAssetPtr checkAsset) { if (checkAsset) return checkAsset->mLoadedState; else return 0; }
|
|
|
|
|
|
+ static U32 getAssetErrCode(ConcreteAssetPtr checkAsset) { if (checkAsset.notNull()) return checkAsset->mLoadedState; else return 0; }
|
|
|
|
|
|
static String getAssetErrstrn(U32 errCode)
|
|
static String getAssetErrstrn(U32 errCode)
|
|
{
|
|
{
|
|
@@ -196,7 +196,7 @@ public:
|
|
static U32 getAssetById(StringTableEntry assetId, AssetPtr<ImageAsset>* imageAsset);
|
|
static U32 getAssetById(StringTableEntry assetId, AssetPtr<ImageAsset>* imageAsset);
|
|
static U32 getAssetById(String assetId, AssetPtr<ImageAsset>* imageAsset) { return getAssetById(assetId.c_str(), imageAsset); };
|
|
static U32 getAssetById(String assetId, AssetPtr<ImageAsset>* imageAsset) { return getAssetById(assetId.c_str(), imageAsset); };
|
|
|
|
|
|
-
|
|
|
|
|
|
+ void populateImage(void);
|
|
const char* getImageInfo();
|
|
const char* getImageInfo();
|
|
|
|
|
|
protected:
|
|
protected:
|
|
@@ -233,17 +233,20 @@ DefineEnumType(ImageAssetType);
|
|
|
|
|
|
#pragma region Refactor Asset Macros
|
|
#pragma region Refactor Asset Macros
|
|
|
|
|
|
-#define DECLARE_IMAGEASSET(className, name, profile) \
|
|
|
|
|
|
+#define DECLARE_IMAGEASSET(className, name, profile) \
|
|
private: \
|
|
private: \
|
|
- AssetPtr<ImageAsset> m##name##Asset;\
|
|
|
|
- String m##name##File;\
|
|
|
|
|
|
+ AssetPtr<ImageAsset> m##name##Asset; \
|
|
|
|
+ StringTableEntry m##name##File = StringTable->EmptyString(); \
|
|
public: \
|
|
public: \
|
|
void _set##name(StringTableEntry _in){ \
|
|
void _set##name(StringTableEntry _in){ \
|
|
if(m##name##Asset.getAssetId() == _in) \
|
|
if(m##name##Asset.getAssetId() == _in) \
|
|
return; \
|
|
return; \
|
|
|
|
+ if(get##name##File() == _in) \
|
|
|
|
+ return; \
|
|
if(_in == NULL || _in == StringTable->EmptyString()) \
|
|
if(_in == NULL || _in == StringTable->EmptyString()) \
|
|
{ \
|
|
{ \
|
|
m##name##Asset = NULL; \
|
|
m##name##Asset = NULL; \
|
|
|
|
+ m##name##File = ""; \
|
|
return; \
|
|
return; \
|
|
} \
|
|
} \
|
|
if(!AssetDatabase.isDeclaredAsset(_in)) \
|
|
if(!AssetDatabase.isDeclaredAsset(_in)) \
|
|
@@ -271,10 +274,12 @@ public:
|
|
imageAssetId = ImageAsset::smNoImageAssetFallback; \
|
|
imageAssetId = ImageAsset::smNoImageAssetFallback; \
|
|
} \
|
|
} \
|
|
m##name##Asset = imageAssetId; \
|
|
m##name##Asset = imageAssetId; \
|
|
|
|
+ m##name##File = _in; \
|
|
} \
|
|
} \
|
|
else \
|
|
else \
|
|
{ \
|
|
{ \
|
|
m##name##Asset = _in; \
|
|
m##name##Asset = _in; \
|
|
|
|
+ m##name##File = get##name##File(); \
|
|
} \
|
|
} \
|
|
}; \
|
|
}; \
|
|
\
|
|
\
|
|
@@ -285,17 +290,20 @@ public:
|
|
StringTableEntry get##name##File(){ return m##name##Asset.notNull() ? m##name##Asset->getImageFile() : ""; }
|
|
StringTableEntry get##name##File(){ return m##name##Asset.notNull() ? m##name##Asset->getImageFile() : ""; }
|
|
|
|
|
|
|
|
|
|
-#define DECLARE_IMAGEASSET_NET(className, name, profile, mask) \
|
|
|
|
|
|
+#define DECLARE_IMAGEASSET_NET(className, name, profile, mask) \
|
|
private: \
|
|
private: \
|
|
AssetPtr<ImageAsset> m##name##Asset; \
|
|
AssetPtr<ImageAsset> m##name##Asset; \
|
|
- String m##name##File;\
|
|
|
|
|
|
+ StringTableEntry m##name##File = StringTable->EmptyString(); \
|
|
public: \
|
|
public: \
|
|
void _set##name(StringTableEntry _in){ \
|
|
void _set##name(StringTableEntry _in){ \
|
|
if(m##name##Asset.getAssetId() == _in) \
|
|
if(m##name##Asset.getAssetId() == _in) \
|
|
return; \
|
|
return; \
|
|
|
|
+ if(get##name##File() == _in) \
|
|
|
|
+ return; \
|
|
if(_in == NULL || _in == StringTable->EmptyString()) \
|
|
if(_in == NULL || _in == StringTable->EmptyString()) \
|
|
{ \
|
|
{ \
|
|
m##name##Asset = NULL; \
|
|
m##name##Asset = NULL; \
|
|
|
|
+ m##name##File = ""; \
|
|
setMaskBits(mask); \
|
|
setMaskBits(mask); \
|
|
return; \
|
|
return; \
|
|
} \
|
|
} \
|
|
@@ -324,10 +332,12 @@ public:
|
|
imageAssetId = ImageAsset::smNoImageAssetFallback; \
|
|
imageAssetId = ImageAsset::smNoImageAssetFallback; \
|
|
} \
|
|
} \
|
|
m##name##Asset = imageAssetId; \
|
|
m##name##Asset = imageAssetId; \
|
|
|
|
+ m##name##File = _in; \
|
|
} \
|
|
} \
|
|
else \
|
|
else \
|
|
{ \
|
|
{ \
|
|
m##name##Asset = _in; \
|
|
m##name##Asset = _in; \
|
|
|
|
+ m##name##File = get##name##File(); \
|
|
} \
|
|
} \
|
|
setMaskBits(mask); \
|
|
setMaskBits(mask); \
|
|
}; \
|
|
}; \
|
|
@@ -339,22 +349,25 @@ public:
|
|
StringTableEntry get##name##File(){ return m##name##Asset.notNull() ? m##name##Asset->getImageFile() : ""; }
|
|
StringTableEntry get##name##File(){ return m##name##Asset.notNull() ? m##name##Asset->getImageFile() : ""; }
|
|
|
|
|
|
|
|
|
|
-#define INITPERSISTFIELD_IMAGEASSET(name, consoleClass, docs) \
|
|
|
|
|
|
+#define INITPERSISTFIELD_IMAGEASSET(name, consoleClass, docs) \
|
|
addProtectedField(assetText(name, Asset), TypeImageAssetPtr, Offset(m##name##Asset, consoleClass), _set##name##Data, &defaultProtectedGetFn, assetDoc(name, asset docs.)); \
|
|
addProtectedField(assetText(name, Asset), TypeImageAssetPtr, Offset(m##name##Asset, consoleClass), _set##name##Data, &defaultProtectedGetFn, assetDoc(name, asset docs.)); \
|
|
addProtectedField(assetText(name, File), TypeFilename, Offset(m##name##File, consoleClass), _set##name##Data, &defaultProtectedGetFn, assetDoc(name, file docs.));
|
|
addProtectedField(assetText(name, File), TypeFilename, Offset(m##name##File, consoleClass), _set##name##Data, &defaultProtectedGetFn, assetDoc(name, file docs.));
|
|
|
|
|
|
|
|
|
|
-#define DECLARE_IMAGEASSET_ARRAY(className, name, profile, max) \
|
|
|
|
|
|
+#define DECLARE_IMAGEASSET_ARRAY(className, name, profile, max) \
|
|
private: \
|
|
private: \
|
|
AssetPtr<ImageAsset> m##name##Asset[max]; \
|
|
AssetPtr<ImageAsset> m##name##Asset[max]; \
|
|
- String m##name##File[max];\
|
|
|
|
|
|
+ StringTableEntry m##name##File[max] = {StringTable->EmptyString() }; \
|
|
public: \
|
|
public: \
|
|
void _set##name(StringTableEntry _in, const U32& index){ \
|
|
void _set##name(StringTableEntry _in, const U32& index){ \
|
|
if(m##name##Asset[index].getAssetId() == _in) \
|
|
if(m##name##Asset[index].getAssetId() == _in) \
|
|
return; \
|
|
return; \
|
|
|
|
+ if(get##name##File(index) == _in) \
|
|
|
|
+ return; \
|
|
if(_in == NULL || _in == StringTable->EmptyString()) \
|
|
if(_in == NULL || _in == StringTable->EmptyString()) \
|
|
{ \
|
|
{ \
|
|
m##name##Asset[index] = NULL; \
|
|
m##name##Asset[index] = NULL; \
|
|
|
|
+ m##name##File[index] = ""; \
|
|
return; \
|
|
return; \
|
|
} \
|
|
} \
|
|
if(!AssetDatabase.isDeclaredAsset(_in)) \
|
|
if(!AssetDatabase.isDeclaredAsset(_in)) \
|
|
@@ -382,10 +395,12 @@ public:
|
|
imageAssetId = ImageAsset::smNoImageAssetFallback; \
|
|
imageAssetId = ImageAsset::smNoImageAssetFallback; \
|
|
} \
|
|
} \
|
|
m##name##Asset[index] = imageAssetId; \
|
|
m##name##Asset[index] = imageAssetId; \
|
|
|
|
+ m##name##File[index] = _in; \
|
|
} \
|
|
} \
|
|
else \
|
|
else \
|
|
{ \
|
|
{ \
|
|
m##name##Asset[index] = _in; \
|
|
m##name##Asset[index] = _in; \
|
|
|
|
+ m##name##File[index] = get##name##File(index); \
|
|
} \
|
|
} \
|
|
}; \
|
|
}; \
|
|
\
|
|
\
|
|
@@ -397,17 +412,20 @@ public:
|
|
StringTableEntry get##name##File(const U32& idx){ return m##name##Asset[idx].notNull() ? m##name##Asset[idx]->getImageFile() : ""; }
|
|
StringTableEntry get##name##File(const U32& idx){ return m##name##Asset[idx].notNull() ? m##name##Asset[idx]->getImageFile() : ""; }
|
|
|
|
|
|
|
|
|
|
-#define DECLARE_IMAGEASSET_ARRAY_NET(className, name, profile, max, mask) \
|
|
|
|
|
|
+#define DECLARE_IMAGEASSET_ARRAY_NET(className, name, profile, max, mask) \
|
|
private: \
|
|
private: \
|
|
AssetPtr<ImageAsset> m##name##Asset[max]; \
|
|
AssetPtr<ImageAsset> m##name##Asset[max]; \
|
|
- String m##name##File[max];\
|
|
|
|
|
|
+ StringTableEntry m##name##File[max] = {StringTable->EmptyString() }; \
|
|
public: \
|
|
public: \
|
|
void _set##name(StringTableEntry _in, const U32& index){ \
|
|
void _set##name(StringTableEntry _in, const U32& index){ \
|
|
if(m##name##Asset[index].getAssetId() == _in) \
|
|
if(m##name##Asset[index].getAssetId() == _in) \
|
|
return; \
|
|
return; \
|
|
|
|
+ if(get##name##File(index) == _in) \
|
|
|
|
+ return; \
|
|
if(_in == NULL || _in == StringTable->EmptyString()) \
|
|
if(_in == NULL || _in == StringTable->EmptyString()) \
|
|
{ \
|
|
{ \
|
|
m##name##Asset[index] = NULL; \
|
|
m##name##Asset[index] = NULL; \
|
|
|
|
+ m##name##File[index] = ""; \
|
|
setMaskBits(mask); \
|
|
setMaskBits(mask); \
|
|
return; \
|
|
return; \
|
|
} \
|
|
} \
|
|
@@ -436,10 +454,12 @@ public:
|
|
imageAssetId = ImageAsset::smNoImageAssetFallback; \
|
|
imageAssetId = ImageAsset::smNoImageAssetFallback; \
|
|
} \
|
|
} \
|
|
m##name##Asset[index] = imageAssetId; \
|
|
m##name##Asset[index] = imageAssetId; \
|
|
|
|
+ m##name##File[index] = _in; \
|
|
} \
|
|
} \
|
|
else \
|
|
else \
|
|
{ \
|
|
{ \
|
|
m##name##Asset[index] = _in; \
|
|
m##name##Asset[index] = _in; \
|
|
|
|
+ m##name##File[index] = get##name##File(index); \
|
|
} \
|
|
} \
|
|
setMaskBits(mask); \
|
|
setMaskBits(mask); \
|
|
}; \
|
|
}; \
|