simplification of the Class::_set<slotname>Asset methods, (as well as early outting before dAtoi(index) hurt itself if index was invalid)

also since I was in there, fixed isrgb accidently being flipped on by default
This commit is contained in:
AzaezelX 2020-10-12 04:43:47 -05:00
parent f0068c2435
commit 4250e1d1b4
5 changed files with 53 additions and 414 deletions

View file

@ -204,27 +204,27 @@ public:
//-----------------------------------------------------------------------
// Data
//-----------------------------------------------------------------------
DECLARE_TEXTUREARRAY(DiffuseMap, MAX_STAGES);
DECLARE_TEXTUREARRAY(Material, DiffuseMap, MAX_STAGES);
bool mDiffuseMapSRGB[MAX_STAGES]; // SRGB diffuse
DECLARE_TEXTUREARRAY(OverlayMap, MAX_STAGES);
DECLARE_TEXTUREARRAY(LightMap, MAX_STAGES);;
DECLARE_TEXTUREARRAY(ToneMap, MAX_STAGES);
DECLARE_TEXTUREARRAY(DetailMap, MAX_STAGES);;
DECLARE_TEXTUREARRAY(NormalMap, MAX_STAGES);
DECLARE_TEXTUREARRAY(ORMConfigMap, MAX_STAGES);
DECLARE_TEXTUREARRAY(Material, OverlayMap, MAX_STAGES);
DECLARE_TEXTUREARRAY(Material, LightMap, MAX_STAGES);;
DECLARE_TEXTUREARRAY(Material, ToneMap, MAX_STAGES);
DECLARE_TEXTUREARRAY(Material, DetailMap, MAX_STAGES);;
DECLARE_TEXTUREARRAY(Material, NormalMap, MAX_STAGES);
DECLARE_TEXTUREARRAY(Material, ORMConfigMap, MAX_STAGES);
bool mIsSRGb[MAX_STAGES];
DECLARE_TEXTUREARRAY(RoughMap, MAX_STAGES);
DECLARE_TEXTUREARRAY(Material, RoughMap, MAX_STAGES);
bool mInvertRoughness[MAX_STAGES];
F32 mRoughnessChan[MAX_STAGES];
DECLARE_TEXTUREARRAY(AOMap, MAX_STAGES);
DECLARE_TEXTUREARRAY(Material, AOMap, MAX_STAGES);
F32 mAOChan[MAX_STAGES];
DECLARE_TEXTUREARRAY(MetalMap, MAX_STAGES);
DECLARE_TEXTUREARRAY(Material, MetalMap, MAX_STAGES);
F32 mMetalChan[MAX_STAGES];
DECLARE_TEXTUREARRAY(GlowMap, MAX_STAGES);
DECLARE_TEXTUREARRAY(Material, GlowMap, MAX_STAGES);
F32 mGlowMul[MAX_STAGES];
/// A second normal map which repeats at the detail map
/// scale and blended with the base normal map.
DECLARE_TEXTUREARRAY(DetailNormalMap, MAX_STAGES);
DECLARE_TEXTUREARRAY(Material, DetailNormalMap, MAX_STAGES);
/// The strength scalar for the detail normal map.
F32 mDetailNormalMapStrength[MAX_STAGES];
@ -412,19 +412,6 @@ protected:
/// in the "mapTo" data variable.
virtual void _mapMaterial();
static bool _setDiffuseMapAsset(void* obj, const char* index, const char* data);
static bool _setOverlayMapAsset(void* obj, const char* index, const char* data);
static bool _setLightMapAsset(void* obj, const char* index, const char* data);
static bool _setToneMapAsset(void* obj, const char* index, const char* data);
static bool _setDetailMapAsset(void* obj, const char* index, const char* data);
static bool _setNormalMapAsset(void* obj, const char* index, const char* data);
static bool _setORMConfigMapAsset(void* obj, const char* index, const char* data);
static bool _setRoughMapAsset(void* obj, const char* index, const char* data);
static bool _setAOMapAsset(void* obj, const char* index, const char* data);
static bool _setMetalMapAsset(void* obj, const char* index, const char* data);
static bool _setGlowMapAsset(void* obj, const char* index, const char* data);
static bool _setDetailNormalMapAsset(void* obj, const char* index, const char* data);
private:
static GFXCubemapHandle smNormalizeCube;
};