Elaztek Developer Hub
Blamite Game Engine - blam!  00423.10.27.24.0533.blamite
The core library for the Blamite Game Engine.
test_tag.h
Go to the documentation of this file.
1 // test_tag [ttag] - Tag Definition //
3 // -------- //
4 // Author: haloman30 //
5 // Revision: 3 //
6 // -------- //
7 // Part of the Blamite Game Engine //
8 // Copyright (c) Elaztek Studios 2013 - 2023 //
10 
11 
12 #pragma once
13 
14 #include <string>
15 #include <blam/api/v1/types/tags.h>
17 
18 #ifndef BLAM
19 #define BLAM
20 #endif
21 
22 
23 
24 #pragma pack(push, 1)
25 struct test_tag
26 {
27  //test tag
28  /*this tag class is used for testing purposes only, do not use it for actual game data*/
29  //Bitmap
30  /*im gonna shove a bitmap up your ass*/
34 
37  TAG_BLOCK(block_test,
38  {
39  int16_t width;
40  int16_t height;
41  int8_t depth;
42  //comment title
43  /*explanation goes here brotheR*/
44  bitfield8 format_flags;
45 
48  TAG_ENUM(type,
49  {
50  _2d_texture,
51  _3d_texture,
52  cubemap,
53  unknown,
54  });
55 
56  int32_t hidden_child_field;
57  });
61  TAG_BLOCK(the_go_fuck_yourself_block,
62  {
63  bitfield16 extra_flags;
64  bitfield32 who_needs_this_many_fucking_flags;
65  });
69  TAG_BLOCK(nested_block_test,
70  {
71  int32_t nested_property;
72  data_reference nested_string;
73  TAG_BLOCK(child_block,
74  {
75  int16_t please_work;
76  data_reference nested_string1;
80  TAG_ENUM(argh,
81  {
82  on_e,
83  two,
84  thr__e__e,
85  _4,
86  });
87 
88  data_reference nested_string2;
90  });
91  });
93  //Normal Comment
94  /*normal, unstyled comment*/
95  //Info Comment
96  /*key information*/
97  //Warning Comment
98  /*warning message*/
99  //Error Comment
100  /*error message*/
101  TAG_BLOCK(block,
102  {
103  int32_t integer;
104  data_reference dataref;
105  TAG_BLOCK(block_two,
106  {
107  int32_t integer;
108  data_reference dataref;
109  TAG_BLOCK(block_three,
110  {
111  int32_t integer;
112  data_reference dataref;
113  TAG_BLOCK(block_four,
114  {
115  int32_t integer;
116  data_reference dataref;
117  TAG_BLOCK(block_five,
118  {
119  int32_t integer;
120  data_reference dataref;
121  });
122  });
123  });
124  });
125  });
128  TAG_BLOCK(hidden_tag_block,
129  {
130  int32_t yeah;
131  });
136 };
137 #pragma pack(pop)
138 
140 {
141 public:
143  {
144  class_name_long = "test_tag";
145  class_name_short = "ttag";
146  version = 3;
147 
148  revisions = {
149  {1, "haloman30", "Initial implementation."},
150  {2, "haloman30", "Move over test fields that were in bitmap tag for some reason"},
151  {3, "haloman30", "* Added hidden tag block and hidden real fields"},
152 
153  };
154 
155  tag_size = 295;
156 
157  fields =
158  {
159  new CommentField("test tag",
160  "this tag class is used for testing purposes only, do not use it for actual game data"),
161  new CommentField("Bitmap",
162  "im gonna shove a bitmap up your ass"),
163  new Int32Field("integer test", "memes"),
164  new Int16Field("short test", "A short has a length of 2 bytes."),
165  new Int8Field("byte test", "A byte has a length of 1 bytes."),
166  new BlockField(14, "block test", "*sweats nervously*",
167  {
168  new Int16Field("width", "image width"),
169  new Int16Field("height", "image height"),
170  new Int8Field("depth", "image depth"),
171  new CommentField("comment title",
172  "explanation goes here brotheR"),
173  new Bitfield8Field("format flags", "extra flags for fuck you",
174  {
175  "bit 0",
176  "bit 1",
177  "bit 2",
178  "is tiled",
179  }),
180  new Enum32Field("type", "the usage type of this bitmap",
181  {
182  "2d texture",
183  "3d texture",
184  "cubemap",
185  "unknown",
186  }),
187  new Int32Field("hidden child field", ""),
188  }),
189  new BlockField(6, "the 'go fuck yourself' block", "yea im tired leave me alone",
190  {
191  new Bitfield16Field("extra flags", "hi",
192  {
193  "can you imagine needing this many flags",
194  "yea me neither",
195  }),
196  new Bitfield32Field("who needs this many fucking flags", "apparently me because i put this shit here",
197  {
198  "enable diffusion dithering",
199  "disable height map compression",
200  "uniform sprite sequences",
201  "filthy sprite bug fix",
202  "use sharp bump filter",
203  "UNUSED",
204  "use clamped/mirrored bump",
205  "invert detail fade",
206  "swap x-y vector components",
207  "convert from signed",
208  "convert to signed",
209  "import mipmap chains",
210  "intentionally true color",
211  }),
212  }),
213  new BlockField(68, "nested block test", "testing block nesting",
214  {
215  new Int32Field("nested property", ""),
216  new DataReferenceField("nested string", ""),
217  new BlockField(102, "child block", "",
218  {
219  new Int16Field("please work", ""),
220  new DataReferenceField("nested string1", ""),
221  new Enum32Field("argh", "second enum test",
222  {
223  "ON E",
224  "tWo",
225  "thR e E",
226  "4",
227  }),
228  new DataReferenceField("nested string2", ""),
229  new DataReferenceField("test dataref", "testing data reference"),
230  }),
231  }),
232  new DataReferenceField("test dataref", "testing data reference"),
233  new CommentField("Normal Comment",
234  "normal, unstyled comment"),
235  new CommentField("Info Comment",
236  "key information"),
237  new CommentField("Warning Comment",
238  "warning message"),
239  new CommentField("Error Comment",
240  "error message"),
241  new BlockField(68, "block", "",
242  {
243  new Int32Field("integer", ""),
244  new DataReferenceField("dataref", ""),
245  new BlockField(68, "block two", "",
246  {
247  new Int32Field("integer", ""),
248  new DataReferenceField("dataref", ""),
249  new BlockField(68, "block three", "",
250  {
251  new Int32Field("integer", ""),
252  new DataReferenceField("dataref", ""),
253  new BlockField(68, "block four", "",
254  {
255  new Int32Field("integer", ""),
256  new DataReferenceField("dataref", ""),
257  new BlockField(36, "block five", "",
258  {
259  new Int32Field("integer", ""),
260  new DataReferenceField("dataref", ""),
261  }),
262  }),
263  }),
264  }),
265  }),
266  new Int32Field("another int", ""),
267  new FieldReferenceField("fieldref field 0", ""),
268  new BlockField(4, "hidden tag block", "",
269  {
270  new Int32Field("yeah", ""),
271  }),
272  new RealField("hidden real", ""),
273  new DataReferenceField("dataref field 0", ""),
274  new TagReferenceField("tagref field 1", "", { ""}),
275  new ColorField("color field 2", ""),
276 
277  };
278  }
279 };
280 
281 namespace Blam::Content::Tags
282 {
283  BLAM test_tag* GetTestTagTag(std::string tag_path);
284 }
Int16Field
Class representing an int16 tag field.
Definition: int.h:59
test_tag.h
Blam::Content::Tags
Namespace containing functions related to tag data.
Definition: bitmap.h:197
RealField
Class representing a real tag field.
Definition: real.h:16
TestTagTagClass::TestTagTagClass
TestTagTagClass()
Definition: test_tag.h:142
test_tag::test_dataref
data_reference test_dataref
testing data reference
Definition: test_tag.h:92
color
BlamColor color
Typedef for a color field, used in tag definitions.
Definition: tags.h:428
test_tag::integer_test
int32_t integer_test
memes
Definition: test_tag.h:31
bitfield32
Typedef for a bitfield32 field, used in tag data definitions.
Definition: tags.h:383
DataReferenceField
Class representing a data reference, or dataref for short.
Definition: dataref.h:19
Bitfield16Field
Class representing a bitfield16 tag field.
Definition: bitfield.h:44
BLAM
#define BLAM
Definition: test_tag.h:19
TagReferenceField
Class representing a tag reference, or tagref for short.
Definition: tagref.h:20
test_tag::TAG_BLOCK
TAG_BLOCK(block_test, { int16_t width;int16_t height;int8_t depth;bitfield8 format_flags;TAG_ENUM(type, { _2d_texture, _3d_texture, cubemap, unknown, });int32_t hidden_child_field;})
sweats nervously
Enum32Field
Definition: enum.h:46
Blam::API::v1::Tags::GetTagData
BLAM_EXT_API BlamTagData * GetTagData(std::string tag_path)
Retrieves information for a given tag.
Definition: api.cpp:197
int8_t
signed char int8_t
Definition: stdint.h:11
BlamTagClass::fields
std::vector< BlamTagClassField * > fields
A series of tag fields that store the layout of the tag.
Definition: tags.h:200
bitfield8
Typedef for a bitfield8 field, used in tag data definitions.
Definition: tags.h:344
test_tag::hidden_real
real hidden_real
Definition: test_tag.h:132
BlamTagClass::revisions
std::vector< BlamTagClassRevision > revisions
List of all tag class revisions. Does not get written to tags, but is included in plugin files.
Definition: tags.h:199
int32_t
int int32_t
Definition: stdint.h:13
plugins.h
Int8Field
Class representing an int8 tag field.
Definition: int.h:72
BlamTagClass::class_name_short
std::string class_name_short
The short, 4-character name of the tag class.
Definition: tags.h:197
BlamTagClass::version
int version
The tag class version. Should be incremented any time a tag class is modified whatsoever.
Definition: tags.h:198
test_tag::tagref_field_1
tag_reference tagref_field_1
Definition: test_tag.h:134
tag_reference
Structure representing a tag reference.
Definition: tags.h:277
field_reference
Structure representing a field reference.
Definition: tags.h:436
Bitfield32Field
Class representing a bitfield32 tag field.
Definition: bitfield.h:55
BlamTagClass::class_name_long
std::string class_name_long
The longer class name. Typically shown alongside short name for user-friendliness.
Definition: tags.h:196
real
float real
Typedef for a 'real', aka a float.
Definition: tags.h:424
test_tag::color_field_2
color color_field_2
Definition: test_tag.h:135
test_tag::byte_test
int8_t byte_test
A byte has a length of 1 bytes.
Definition: test_tag.h:33
Int32Field
Class representing an int32 tag field.
Definition: int.h:46
bitfield16
Typedef for a bitfield16 field, used in tag data definitions.
Definition: tags.h:359
Blam::Content::Tags::GetTestTagTag
BLAM test_tag * GetTestTagTag(std::string tag_path)
Definition: test_tag.cpp:16
test_tag
Definition: test_tag.h:25
data_reference
Structure representing a data reference.
Definition: tags.h:323
BlamTagClass::tag_size
int tag_size
The size of the tag's data. Used on loading/writing tag files.
Definition: tags.h:201
ColorField
Class representing a color tag field.
Definition: color.h:19
TestTagTagClass
Definition: test_tag.h:139
BlamTagData::address
void * address
The address pointing to the start of the tag's data.
Definition: tags.h:130
tags.h
int16_t
short int16_t
Definition: stdint.h:12
BlamTagData
Class used to contain and access tag data.
Definition: tags.h:124
FieldReferenceField
Class representing a fieldref tag field.
Definition: fieldref.h:17
CommentField
Class representing a comment field.
Definition: comment.h:29
BlockField
Class representing a tag block field, also sometimes referred to as a struct or reflexive in the modd...
Definition: block.h:19
test_tag::fieldref_field_0
field_reference fieldref_field_0
Definition: test_tag.h:127
TAG_ENUM
#define TAG_ENUM(name,...)
Macro used to aid in the creation of enums within tag structures.
Definition: tags.h:41
test_tag::another_int
int32_t another_int
Definition: test_tag.h:126
BlamTagClass
Class representing a tag class.
Definition: tags.h:193
Bitfield8Field
Class representing a bitfield8 tag field.
Definition: bitfield.h:33
test_tag::dataref_field_0
data_reference dataref_field_0
Definition: test_tag.h:133
test_tag::short_test
int16_t short_test
A short has a length of 2 bytes.
Definition: test_tag.h:32
api.h