Reworks the terrain loader code to work with the assets.

Fixes the terrain asset creation, makes the loading logic go through the asset auto-import behavior when a filename or assetid is bound that is not found.
Corrects terrain material binding to properly save and load
Makes the terrain asset inspector fields work as expected.
This commit is contained in:
Areloch 2020-06-25 23:33:01 -05:00
parent 3e1795ba1d
commit 4ce558f042
15 changed files with 500 additions and 283 deletions

View file

@ -123,5 +123,20 @@ DefineConsoleType(TypeImageAssetPtr, ImageAsset)
typedef ImageAsset::ImageTypes ImageAssetType;
DefineEnumType(ImageAssetType);
#define assetText(x,suff) std::string(std::string(#x) + std::string(#suff)).c_str()
#define scriptBindMapSlot(name, consoleClass) addField(#name, TypeImageFilename, Offset(m##name##Filename, consoleClass), assetText(name,texture map.)); \
addField(assetText(name,Asset), TypeImageAssetPtr, Offset(m##name##AssetId, consoleClass), assetText(name,asset reference.));
#define scriptBindMapArraySlot(name, arraySize, consoleClass) addField(#name, TypeImageFilename, Offset(m##name##Filename, consoleClass), arraySize, assetText(name,texture map.)); \
addField(assetText(name,Asset), TypeImageAssetPtr, Offset(m##name##AssetId, consoleClass), arraySize, assetText(name,asset reference.));
#define DECLARE_TEXTUREMAP(name) FileName m##name##Filename;\
StringTableEntry m##name##AssetId;\
AssetPtr<ImageAsset> m##name##Asset;
#define DECLARE_TEXTUREARRAY(name,max) FileName m##name##Filename[max];\
StringTableEntry m##name##AssetId[max];\
AssetPtr<ImageAsset> m##name##Asset[max];
#endif