From 7fa4db7f4fa3b87ae9e97fc7c81d0111de5fbfc0 Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Fri, 23 Aug 2024 12:09:42 +0100 Subject: [PATCH] Add property chunk pattern --- patterns/db_files/AllChunks.pat | 1 + patterns/db_files/CowFile.hexpat | 5 ++++- patterns/db_files/chunks/P$_.hexpat | 14 ++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 patterns/db_files/chunks/P$_.hexpat diff --git a/patterns/db_files/AllChunks.pat b/patterns/db_files/AllChunks.pat index 70db505..b42f566 100644 --- a/patterns/db_files/AllChunks.pat +++ b/patterns/db_files/AllChunks.pat @@ -30,6 +30,7 @@ #include "db_files/chunks/Mission_GameSysEAX.hexpat" #include "db_files/chunks/MultiBrush.hexpat" #include "db_files/chunks/OBJ_MAP.hexpat" +#include "db_files/chunks/P$_.hexpat" #include "db_files/chunks/RENDPARAMS.hexpat" #include "db_files/chunks/ROOM_DB.hexpat" #include "db_files/chunks/ROOM_EAX.hexpat" diff --git a/patterns/db_files/CowFile.hexpat b/patterns/db_files/CowFile.hexpat index 2a8dcd5..a851c07 100644 --- a/patterns/db_files/CowFile.hexpat +++ b/patterns/db_files/CowFile.hexpat @@ -59,4 +59,7 @@ Chunk texture_list @ get_offset(toc, "TXLIST"); Chunk texture_patch_database @ get_offset(toc, "TXTPAT_DB"); Chunk water_banks @ get_offset(toc, "WATERBANKS"); Chunk weather_var @ get_offset(toc, "WEATHERVAR"); -Chunk world_rep @ get_offset(toc, "WREXT"); \ No newline at end of file +Chunk world_rep @ get_offset(toc, "WREXT"); + +// TODO: Have a nice function for doing all of these? +Chunk p_model_name @ get_offset(toc, "P$ModelName"); \ No newline at end of file diff --git a/patterns/db_files/chunks/P$_.hexpat b/patterns/db_files/chunks/P$_.hexpat new file mode 100644 index 0000000..afbb539 --- /dev/null +++ b/patterns/db_files/chunks/P$_.hexpat @@ -0,0 +1,14 @@ +#pragma once + +#include "Common.hexpat" + +struct ObjectProperty { + s32 obj_id; + u32 data_size; + u8 data[data_size]; +}; + +struct PropertyMap { + u32 max = get_end(toc, parent.header.name); + ObjectProperty props[while($ < max)]; +};