mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-10-03 11:05:35 +00:00
feat: add support for t4 materials (#891)
* feat: add support for t4 materials * fix: t4 material struct
This commit is contained in:
1 parent
a4229788d7
commit
c385f50a0e
13 files changed
+402
-45
No files matched your search
@@ -1,4 +1,4 @@
|
||||
#options GAME (IW3, IW4, IW5, T5, T6)
|
||||
#options GAME (IW3, IW4, IW5, T4, T5, T6)
|
||||
|
||||
#filename "Game/" + GAME + "/Material/JsonMaterialLoader" + GAME + ".cpp"
|
||||
|
||||
@@ -14,6 +14,10 @@
|
||||
#define FEATURE_IW5
|
||||
#define HAS_WATER
|
||||
#define GAME_LOWER "iw5"
|
||||
#elif GAME == "T4"
|
||||
#define FEATURE_T4
|
||||
#define HAS_WATER
|
||||
#define GAME_LOWER "t4"
|
||||
#elif GAME == "T5"
|
||||
#define FEATURE_T5
|
||||
#define HAS_WATER
|
||||
@@ -104,7 +108,7 @@ namespace
|
||||
con::error("Cannot load material \"{}\": {}", material.info.name, message);
|
||||
}
|
||||
|
||||
#if defined(FEATURE_IW3) || defined(FEATURE_IW4) || defined(FEATURE_IW5)
|
||||
#if defined(FEATURE_IW3) || defined(FEATURE_IW4) || defined(FEATURE_IW5) || defined(FEATURE_T4)
|
||||
static bool CreateGameFlagsFromJson(const JsonMaterial& jMaterial, unsigned char& gameFlags)
|
||||
#elif defined(FEATURE_T5) || defined(FEATURE_T6)
|
||||
static bool CreateGameFlagsFromJson(const JsonMaterial& jMaterial, unsigned& gameFlags)
|
||||
@@ -207,7 +211,7 @@ namespace
|
||||
CreateSamplerStateFromJson(jTexture.samplerState, textureDef.samplerState);
|
||||
|
||||
textureDef.semantic = jTexture.semantic;
|
||||
#if defined(FEATURE_T5) || defined(FEATURE_T6)
|
||||
#if defined(FEATURE_T4) || defined(FEATURE_T5) || defined(FEATURE_T6)
|
||||
textureDef.isMatureContent = jTexture.isMatureContent;
|
||||
#endif
|
||||
|
||||
@@ -314,7 +318,7 @@ namespace
|
||||
structured.alphaTestDisabled = 0;
|
||||
structured.alphaTest = GFXS_ALPHA_TEST_GT_0;
|
||||
}
|
||||
#if defined(FEATURE_IW3) || defined(FEATURE_IW4) || defined(FEATURE_IW5)
|
||||
#if defined(FEATURE_IW3) || defined(FEATURE_IW4) || defined(FEATURE_IW5) || defined(FEATURE_T4)
|
||||
else if (jStateBitsTableEntry.alphaTest == JsonAlphaTest::LT128)
|
||||
{
|
||||
structured.alphaTestDisabled = 0;
|
||||
@@ -419,7 +423,7 @@ namespace
|
||||
}
|
||||
|
||||
material.info.surfaceTypeBits = jMaterial.surfaceTypeBits;
|
||||
#if defined(FEATURE_T5) || defined(FEATURE_T6)
|
||||
#if defined(FEATURE_T4) || defined(FEATURE_T5) || defined(FEATURE_T6)
|
||||
material.info.layeredSurfaceTypes = jMaterial.layeredSurfaceTypes;
|
||||
#endif
|
||||
#if defined(FEATURE_T6)
|
||||
|
||||
Reference in new issue
Block a user