Phasor  01.00.10.059
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
tags.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Halo.h"
4 #include <string>
5 
6 namespace halo
7 {
9  {
10  TAG_ACTV = 'actv',
11  TAG_ANT = 'ant!',
12  TAG_ANTR = 'antr',
13  TAG_BIPD = 'bipd',
14  TAG_BTIM = 'bitm',
15  TAG_COLL = 'coll',
16  TAG_COLO = 'colo',
17  TAG_CONT = 'cont',
18  TAG_DECA = 'deca',
19  TAG_DELA = 'DeLa',
20  TAG_DEVC = 'devc',
21  TAG_EFFE = 'effe',
22  TAG_EQIP = 'eqip',
23  TAG_FLAG = 'flag',
24  TAG_FONT = 'font',
25  TAG_FOOT = 'foot',
26  TAG_GRHI = 'grhi',
27  TAG_HMT = 'hmt ',
28  TAG_HUD = 'hud#',
29  TAG_HUDG = 'hudg',
30  TAG_ITMC = 'itmc',
31  TAG_JPT = 'jpt!',
32  TAG_LENS = 'lens',
33  TAG_LIGH = 'ligh',
34  TAG_LSND = 'lsnd',
35  TAG_MATG = 'matg',
36  TAG_METR = 'metr',
37  TAG_MGS2 = 'mgs2',
38  TAG_MOD2 = 'mod2',
39  TAG_PART = 'part',
40  TAG_PCTL = 'pctl',
41  TAG_PHYS = 'phys',
42  TAG_PPHY = 'pphy',
43  TAG_PROJ = 'proj',
44  TAG_SBSP = 'sbsp',
45  TAG_SCEN = 'scen',
46  TAG_SCEX = 'scex',
47  TAG_SCHI = 'schi',
48  TAG_SCNR = 'scnr',
49  TAG_SENV = 'senv',
50  TAG_SGLA = 'sgla',
51  TAG_SKY = 'sky ',
52  TAG_SMET = 'smet',
53  TAG_SND = 'snd!',
54  TAG_SNDE = 'snde',
55  TAG_SOUL = 'Soul',
56  TAG_SPLA = 'spla',
57  TAG_SSCE = 'ssce',
58  TAG_STR = 'str#',
59  TAG_TAGC = 'tagc',
60  TAG_TRAK = 'trak',
61  TAG_UDLG = 'udlg',
62  TAG_UNHI = 'unhi',
63  TAG_USTR = 'ustr',
64  TAG_VEHI = 'vehi',
65  TAG_WEAP = 'weap',
66  TAG_WIND = 'wind',
67  TAG_WPHI = 'wphi'
68  };
69 
70  #pragma pack(push, 1)
71  struct s_tag_type
72  {
73  unsigned long val;
74  explicit s_tag_type(const char* str);
75 
76  bool operator==(const s_tag_type& other);
77  bool operator==(e_tag_types type);
78  bool operator!=(const s_tag_type& other);
79  bool operator!=(e_tag_types type);
80  char* GetString(char out[5]);
81  };
82  static_assert(sizeof(s_tag_type) == 0x4, "bad");
83 
84  // Structure of the tag header (entry in tag table)
85  struct s_tag_entry
86  {
87  s_tag_type tagType; // ie weap
88  UNKNOWN(8);
89  ident id; // unique id for map
90  const char* tagName; // name of tag
91  void* metaData; // data for this tag
92  UNKNOWN(8);
93  };
94  static_assert(sizeof(s_tag_entry) == 0x20, "bad");
95 
96  // Structure of tag index table
98  {
100  unsigned long starting_ident; // ??
101  UNKNOWN(4);
102  unsigned long entityCount;
103  UNKNOWN(4);
104  unsigned long readOffset;
105  UNKNOWN(8);
106  unsigned long readSize;
107  UNKNOWN(4);
108  };
109  static_assert(sizeof(s_tag_index_table_header) == 0x28, "bad");
110 
112  {
114  char* tagName;
115  unsigned long empty;
117  };
118 
119 #pragma pack(pop)
120 
121  s_tag_entry* LookupTag(ident tagId);
122  s_tag_entry* LookupTag(s_tag_type type, const std::string& tag_name);
123  void BuildTagCache(); // call at start of each new game.
124 }