From e9b9ad093ca8126425101e4046471c71c39377ac Mon Sep 17 00:00:00 2001 From: Jan Date: Tue, 1 Jul 2025 21:31:46 +0100 Subject: [PATCH] chore: remove hashIndex from t6 json material as it is always 0 --- src/ObjCommon/Material/JsonMaterial.h.template | 2 -- src/ObjLoading/Material/JsonMaterialLoader.cpp.template | 1 - src/ObjWriting/Game/T6/Material/DumperMaterialT6.cpp | 1 + src/ObjWriting/Material/JsonMaterialWriter.cpp.template | 1 - test/ObjLoadingTests/Game/T6/Material/LoaderMaterialT6Test.cpp | 1 - test/ObjWritingTests/Game/T6/Material/DumperMaterialT6Test.cpp | 1 - 6 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/ObjCommon/Material/JsonMaterial.h.template b/src/ObjCommon/Material/JsonMaterial.h.template index f3fbb66f..6afb6b0a 100644 --- a/src/ObjCommon/Material/JsonMaterial.h.template +++ b/src/ObjCommon/Material/JsonMaterial.h.template @@ -509,7 +509,6 @@ namespace GAME uint8_t maxStreamedMips; #elif defined(FEATURE_T6) unsigned layeredSurfaceTypes; - unsigned hashIndex; unsigned surfaceFlags; unsigned contents; uint8_t probeMipBits; @@ -534,7 +533,6 @@ namespace GAME maxStreamedMips, #elif defined(FEATURE_T6) layeredSurfaceTypes, - hashIndex, surfaceFlags, contents, probeMipBits, diff --git a/src/ObjLoading/Material/JsonMaterialLoader.cpp.template b/src/ObjLoading/Material/JsonMaterialLoader.cpp.template index 21c32982..69ceb3ef 100644 --- a/src/ObjLoading/Material/JsonMaterialLoader.cpp.template +++ b/src/ObjLoading/Material/JsonMaterialLoader.cpp.template @@ -420,7 +420,6 @@ namespace material.info.surfaceTypeBits = jMaterial.surfaceTypeBits; #ifdef FEATURE_T6 material.info.layeredSurfaceTypes = jMaterial.layeredSurfaceTypes; - material.info.hashIndex = static_cast(jMaterial.hashIndex); material.info.surfaceFlags = jMaterial.surfaceFlags; material.info.contents = jMaterial.contents; #endif diff --git a/src/ObjWriting/Game/T6/Material/DumperMaterialT6.cpp b/src/ObjWriting/Game/T6/Material/DumperMaterialT6.cpp index c90c2eb7..9f193037 100644 --- a/src/ObjWriting/Game/T6/Material/DumperMaterialT6.cpp +++ b/src/ObjWriting/Game/T6/Material/DumperMaterialT6.cpp @@ -30,5 +30,6 @@ void AssetDumperMaterial::DumpAsset(AssetDumpingContext& context, XAssetInfoAsset(); assert(material->info.gameFlags < 0x8000); + assert(material->info.hashIndex == 0); DumpMaterialAsJson(*assetFile, *material, context); } diff --git a/src/ObjWriting/Material/JsonMaterialWriter.cpp.template b/src/ObjWriting/Material/JsonMaterialWriter.cpp.template index 00cc2b43..fdbec537 100644 --- a/src/ObjWriting/Material/JsonMaterialWriter.cpp.template +++ b/src/ObjWriting/Material/JsonMaterialWriter.cpp.template @@ -315,7 +315,6 @@ namespace jMaterial.surfaceTypeBits = material.info.surfaceTypeBits; #ifdef FEATURE_T6 jMaterial.layeredSurfaceTypes = material.info.layeredSurfaceTypes; - jMaterial.hashIndex = material.info.hashIndex; jMaterial.surfaceFlags = material.info.surfaceFlags; jMaterial.contents = material.info.contents; #endif diff --git a/test/ObjLoadingTests/Game/T6/Material/LoaderMaterialT6Test.cpp b/test/ObjLoadingTests/Game/T6/Material/LoaderMaterialT6Test.cpp index 2596dc78..2d797315 100644 --- a/test/ObjLoadingTests/Game/T6/Material/LoaderMaterialT6Test.cpp +++ b/test/ObjLoadingTests/Game/T6/Material/LoaderMaterialT6Test.cpp @@ -62,7 +62,6 @@ namespace "10", "CASTS_SHADOW" ], - "hashIndex": 0, "layeredSurfaceTypes": 536870925, "probeMipBits": 0, "sortKey": 4, diff --git a/test/ObjWritingTests/Game/T6/Material/DumperMaterialT6Test.cpp b/test/ObjWritingTests/Game/T6/Material/DumperMaterialT6Test.cpp index 4c6e5f50..a8704d6d 100644 --- a/test/ObjWritingTests/Game/T6/Material/DumperMaterialT6Test.cpp +++ b/test/ObjWritingTests/Game/T6/Material/DumperMaterialT6Test.cpp @@ -282,7 +282,6 @@ namespace "10", "CASTS_SHADOW" ], - "hashIndex": 0, "layeredSurfaceTypes": 536870925, "probeMipBits": 0, "sortKey": 4,