From 96bca0fac7c2cbfa1d9bca84f667a01160d2a9c4 Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Sun, 9 Mar 2025 20:24:11 +0000 Subject: [PATCH] Add LM_PARAM chunk --- patterns/db_files/AllChunks.pat | 1 + patterns/db_files/DbFile.pat | 3 +-- patterns/db_files/chunks/LM_PARAM.hexpat | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 patterns/db_files/chunks/LM_PARAM.hexpat diff --git a/patterns/db_files/AllChunks.pat b/patterns/db_files/AllChunks.pat index 34f16cb..1b0d3a2 100644 --- a/patterns/db_files/AllChunks.pat +++ b/patterns/db_files/AllChunks.pat @@ -28,6 +28,7 @@ #include "db_files/chunks/HotRegions.hexpat" #include "db_files/chunks/L$_.hexpat" #include "db_files/chunks/LD$_.hexpat" +#include "db_files/chunks/LM_PARAM.hexpat" #include "db_files/chunks/MAPISRC.hexpat" #include "db_files/chunks/Mission_GameSysEAX.hexpat" #include "db_files/chunks/MultiBrush.hexpat" diff --git a/patterns/db_files/DbFile.pat b/patterns/db_files/DbFile.pat index f2f49fe..bdaf88b 100644 --- a/patterns/db_files/DbFile.pat +++ b/patterns/db_files/DbFile.pat @@ -66,6 +66,7 @@ struct TOCEntry { ("FOGZONEVAR"): Chunk fog_zone_var @ offset; ("GameSysEAX"): Chunk gamesys_eax @ offset; ("HotRegions"): Chunk hot_regions @ offset; + ("LM_PARAM"): Chunk lm_params @ offset; ("MAPISRC"): Chunk map_i_src @ offset; ("MissionEAX"): Chunk mission_eax @ offset; ("MultiBrush"): Chunk multibrush @ offset; @@ -92,11 +93,9 @@ struct TOCEntry { } else if (std::string::starts_with(name, "LD$")) { Chunk link_data @ offset [[name(name)]]; - // std::print("LD: {}", name); } else if (std::string::starts_with(name, "L$")) { Chunk link_chunk @ offset [[name(name)]]; - // std::print("L: {}", name); } else { std::print("Didn't load chunk: {}", name); diff --git a/patterns/db_files/chunks/LM_PARAM.hexpat b/patterns/db_files/chunks/LM_PARAM.hexpat new file mode 100644 index 0000000..aaf5dc4 --- /dev/null +++ b/patterns/db_files/chunks/LM_PARAM.hexpat @@ -0,0 +1,17 @@ +#pragma once + +#include "Common.hexpat" + +struct LmParams { + u32 unknown1; // I think this is struct size (seemingly always 36) + float attenuation; + float saturation; + u32 shadow_type; // TODO: Enum + u32 softness; // TODO: Enum + float center_weight; + u32 depth_mode; // TODO: Enum (16, 32, 32-2x) + bool lightmapped_water; + padding[3]; + s32 lightmap_scale; + u32 animlight_cutoff; +}; \ No newline at end of file