From 6ad11c4af55b66b7b9c8e6cb8d359fb5d96d5034 Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Fri, 23 Aug 2024 11:04:03 +0100 Subject: [PATCH] Add OBJ_MAP definition --- patterns/db_files/AllChunks.pat | 1 + patterns/db_files/CowFile.hexpat | 2 ++ patterns/db_files/chunks/OBJ_MAP.hexpat | 13 +++++++++++++ 3 files changed, 16 insertions(+) create mode 100644 patterns/db_files/chunks/OBJ_MAP.hexpat diff --git a/patterns/db_files/AllChunks.pat b/patterns/db_files/AllChunks.pat index 99927df..70db505 100644 --- a/patterns/db_files/AllChunks.pat +++ b/patterns/db_files/AllChunks.pat @@ -29,6 +29,7 @@ #include "db_files/chunks/MAPISRC.hexpat" #include "db_files/chunks/Mission_GameSysEAX.hexpat" #include "db_files/chunks/MultiBrush.hexpat" +#include "db_files/chunks/OBJ_MAP.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 60bf4aa..2a8dcd5 100644 --- a/patterns/db_files/CowFile.hexpat +++ b/patterns/db_files/CowFile.hexpat @@ -10,6 +10,7 @@ FileHeader file_header @ 0x0; TableOfContents toc @ file_header.toc_offset; TOCEntry brlist_toc = get_toc_entry(toc, "BRLIST"); +TOCEntry objmap_toc = get_toc_entry(toc, "OBJ_MAP"); TOCEntry scrmodules_toc = get_toc_entry(toc, "ScrModules"); Chunk ai_room_db @ get_offset(toc, "AI_ROOM_DB"); @@ -44,6 +45,7 @@ Chunk hot_regions @ get_offset(toc, "HotRegions"); Chunk map_i_src @ get_offset(toc, "MAPISRC"); Chunk mission_eax @ get_offset(toc, "MissionEAX"); Chunk multibrush @ get_offset(toc, "MultiBrush"); +Chunk obj_map @ get_offset(toc, "OBJ_MAP"); Chunk rend_params @ get_offset(toc, "RENDPARAMS"); Chunk room_db @ get_offset(toc, "ROOM_DB"); Chunk room_eax @ get_offset(toc, "ROOM_EAX"); diff --git a/patterns/db_files/chunks/OBJ_MAP.hexpat b/patterns/db_files/chunks/OBJ_MAP.hexpat new file mode 100644 index 0000000..4e57cec --- /dev/null +++ b/patterns/db_files/chunks/OBJ_MAP.hexpat @@ -0,0 +1,13 @@ +#pragma once + +struct ObjMapElement { + s32 value; + s32 name_len; + if (name_len != -1) { + char name[name_len]; + } +}; + +struct ObjMap { + ObjMapElement objects[while($ < objmap_toc.offset + objmap_toc.size)]; +}; \ No newline at end of file