Elaztek Developer Hub
Blamite Game Engine - blam!  00406.12.10.23.1457.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: 2 //
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  });
60  TAG_BLOCK(the_go_fuck_yourself_block,
61  {
62  bitfield16 extra_flags;
63  bitfield32 who_needs_this_many_fucking_flags;
64  });
68  TAG_BLOCK(nested_block_test,
69  {
70  int32_t nested_property;
71  ascii nested_string;
72  TAG_BLOCK(child_block,
73  {
74  int16_t please_work;
75  ascii nested_string1;
79  TAG_ENUM(argh,
80  {
81  on_e,
82  two,
83  thr__e__e,
84  _4,
85  });
86 
87  ascii nested_string2;
89  });
90  });
92  //Normal Comment
93  /*normal, unstyled comment*/
94  //Info Comment
95  /*key information*/
96  //Warning Comment
97  /*warning message*/
98  //Error Comment
99  /*error message*/
100  TAG_BLOCK(block,
101  {
102  int32_t integer;
103  data_reference dataref;
104  TAG_BLOCK(block_two,
105  {
106  int32_t integer;
107  data_reference dataref;
108  TAG_BLOCK(block_three,
109  {
110  int32_t integer;
111  data_reference dataref;
112  TAG_BLOCK(block_four,
113  {
114  int32_t integer;
115  data_reference dataref;
116  TAG_BLOCK(block_five,
117  {
118  int32_t integer;
119  data_reference dataref;
120  });
121  });
122  });
123  });
124  });
127 };
128 #pragma pack(pop)
129 
131 {
132 public:
134  {
135  class_name_long = "test_tag";
136  class_name_short = "ttag";
137  version = 2;
138 
139  revisions = {
140  {1, "haloman30", "Initial implementation."},
141  {2, "haloman30", "Move over test fields that were in bitmap tag for some reason"},
142 
143  };
144 
145  tag_size = 191;
146 
147  fields =
148  {
149  new CommentField("test tag",
150  "this tag class is used for testing purposes only, do not use it for actual game data"),
151  new CommentField("Bitmap",
152  "im gonna shove a bitmap up your ass"),
153  new Int32Field("integer test", "memes"),
154  new Int16Field("short test", "A short has a length of 2 bytes."),
155  new Int8Field("byte test", "A byte has a length of 1 bytes."),
156  new BlockField(10, "block test", "*sweats nervously*",
157  {
158  new Int16Field("width", "image width"),
159  new Int16Field("height", "image height"),
160  new Int8Field("depth", "image depth"),
161  new CommentField("comment title",
162  "explanation goes here brotheR"),
163  new Bitfield8Field("format flags", "extra flags for fuck you",
164  {
165  "bit 0",
166  "bit 1",
167  "bit 2",
168  "is tiled",
169  }),
170  new Enum32Field("type", "the usage type of this bitmap",
171  {
172  "2d texture",
173  "3d texture",
174  "cubemap",
175  "unknown",
176  }),
177  }),
178  new BlockField(6, "the 'go fuck yourself' block", "yea im tired leave me alone",
179  {
180  new Bitfield16Field("extra flags", "hi",
181  {
182  "can you imagine needing this many flags",
183  "yea me neither",
184  }),
185  new Bitfield32Field("who needs this many fucking flags", "apparently me because i put this shit here",
186  {
187  "enable diffusion dithering",
188  "disable height map compression",
189  "uniform sprite sequences",
190  "filthy sprite bug fix",
191  "use sharp bump filter",
192  "UNUSED",
193  "use clamped/mirrored bump",
194  "invert detail fade",
195  "swap x-y vector components",
196  "convert from signed",
197  "convert to signed",
198  "import mipmap chains",
199  "intentionally true color",
200  }),
201  }),
202  new BlockField(164, "nested block test", "testing block nesting",
203  {
204  new Int32Field("nested property", ""),
205  new AsciiField("nested string", ""),
206  new BlockField(294, "child block", "",
207  {
208  new Int16Field("please work", ""),
209  new AsciiField("nested string1", ""),
210  new Enum32Field("argh", "second enum test",
211  {
212  "ON E",
213  "tWo",
214  "thR e E",
215  "4",
216  }),
217  new AsciiField("nested string2", ""),
218  new DataReferenceField("test dataref", "testing data reference"),
219  }),
220  }),
221  new DataReferenceField("test dataref", "testing data reference"),
222  new CommentField("Normal Comment",
223  "normal, unstyled comment"),
224  new CommentField("Info Comment",
225  "key information"),
226  new CommentField("Warning Comment",
227  "warning message"),
228  new CommentField("Error Comment",
229  "error message"),
230  new BlockField(68, "block", "",
231  {
232  new Int32Field("integer", ""),
233  new DataReferenceField("dataref", ""),
234  new BlockField(68, "block two", "",
235  {
236  new Int32Field("integer", ""),
237  new DataReferenceField("dataref", ""),
238  new BlockField(68, "block three", "",
239  {
240  new Int32Field("integer", ""),
241  new DataReferenceField("dataref", ""),
242  new BlockField(68, "block four", "",
243  {
244  new Int32Field("integer", ""),
245  new DataReferenceField("dataref", ""),
246  new BlockField(36, "block five", "",
247  {
248  new Int32Field("integer", ""),
249  new DataReferenceField("dataref", ""),
250  }),
251  }),
252  }),
253  }),
254  }),
255  new Int32Field("another int", ""),
256  new FieldReferenceField("fieldref field 0", ""),
257 
258  };
259  }
260 };
261 
262 namespace Blam::Content::Tags
263 {
264  BLAM test_tag* GetTestTagTag(std::string tag_path);
265 }
Int16Field
Class representing an int16 tag field.
Definition: int.h:59
test_tag.h
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, });})
sweats nervously
Blam::Content::Tags
Namespace containing functions related to tag data.
Definition: bitmap.h:195
TestTagTagClass::TestTagTagClass
TestTagTagClass()
Definition: test_tag.h:133
test_tag::test_dataref
data_reference test_dataref
testing data reference
Definition: test_tag.h:91
AsciiField
Class representing an ascii tag field.
Definition: ascii.h:18
test_tag::integer_test
int32_t integer_test
memes
Definition: test_tag.h:31
ascii
char ascii[128]
Typedef for an ascii field, used in tag data definitions.
Definition: tags.h:410
bitfield32
Typedef for a bitfield32 field, used in tag data definitions.
Definition: tags.h:371
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
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:34
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:195
bitfield8
Typedef for a bitfield8 field, used in tag data definitions.
Definition: tags.h:332
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:194
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:192
BlamTagClass::version
int version
The tag class version. Should be incremented any time a tag class is modified whatsoever.
Definition: tags.h:193
field_reference
Structure representing a field reference.
Definition: tags.h:424
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:191
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:347
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:318
BlamTagClass::tag_size
int tag_size
The size of the tag's data. Used on loading/writing tag files.
Definition: tags.h:196
TestTagTagClass
Definition: test_tag.h:130
BlamTagData::address
void * address
The address pointing to the start of the tag's data.
Definition: tags.h:128
tags.h
int16_t
short int16_t
Definition: stdint.h:12
BlamTagData
Class used to contain and access tag data.
Definition: tags.h:125
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:126
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:125
BlamTagClass
Class representing a tag class.
Definition: tags.h:188
Bitfield8Field
Class representing a bitfield8 tag field.
Definition: bitfield.h:33
test_tag::short_test
int16_t short_test
A short has a length of 2 bytes.
Definition: test_tag.h:32
api.h