Elaztek Developer Hub
Blamite Game Engine - blam!  00398.09.22.23.2015.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>
18 
19 #ifndef BLAM
20 #define BLAM
21 #endif
22 
23 
24 
25 #pragma pack(push, 1)
26 struct test_tag
27 {
28  //test tag
29  /*this tag class is used for testing purposes only, do not use it for actual game data*/
30  //Bitmap
31  /*im gonna shove a bitmap up your ass*/
35 
38  TAG_BLOCK(block_test,
39  {
40  int16_t width;
41  int16_t height;
42  int8_t depth;
43  //comment title
44  /*explanation goes here brotheR*/
45  bitfield8 format_flags;
46 
49  TAG_ENUM(type,
50  {
51  _2d_texture,
52  _3d_texture,
53  cubemap,
54  unknown,
55  });
56 
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  ascii nested_string;
73  TAG_BLOCK(child_block,
74  {
75  int16_t please_work;
76  ascii nested_string1;
80  TAG_ENUM(argh,
81  {
82  on_e,
83  two,
84  thr__e__e,
85  _4,
86  });
87 
88  ascii 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 };
129 #pragma pack(pop)
130 
132 {
133 public:
135  {
136  class_name_long = "test_tag";
137  class_name_short = "ttag";
138  version = 2;
139 
140  revisions = {
141  {1, "haloman30", "Initial implementation."},
142  {2, "haloman30", "Move over test fields that were in bitmap tag for some reason"},
143 
144  };
145 
146  tag_size = 191;
147 
148  fields =
149  {
150  new CommentField("test tag",
151  "this tag class is used for testing purposes only, do not use it for actual game data"),
152  new CommentField("Bitmap",
153  "im gonna shove a bitmap up your ass"),
154  new Int32Field("integer test", "memes"),
155  new Int16Field("short test", "A short has a length of 2 bytes."),
156  new Int8Field("byte test", "A byte has a length of 1 bytes."),
157  new BlockField(10, "block test", "*sweats nervously*",
158  {
159  new Int16Field("width", "image width"),
160  new Int16Field("height", "image height"),
161  new Int8Field("depth", "image depth"),
162  new CommentField("comment title",
163  "explanation goes here brotheR"),
164  new Bitfield8Field("format flags", "extra flags for fuck you",
165  {
166  "bit 0",
167  "bit 1",
168  "bit 2",
169  "is tiled",
170  }),
171  new Enum32Field("type", "the usage type of this bitmap",
172  {
173  "2d texture",
174  "3d texture",
175  "cubemap",
176  "unknown",
177  }),
178  }),
179  new BlockField(6, "the 'go fuck yourself' block", "yea im tired leave me alone",
180  {
181  new Bitfield16Field("extra flags", "hi",
182  {
183  "can you imagine needing this many flags",
184  "yea me neither",
185  }),
186  new Bitfield32Field("who needs this many fucking flags", "apparently me because i put this shit here",
187  {
188  "enable diffusion dithering",
189  "disable height map compression",
190  "uniform sprite sequences",
191  "filthy sprite bug fix",
192  "use sharp bump filter",
193  "UNUSED",
194  "use clamped/mirrored bump",
195  "invert detail fade",
196  "swap x-y vector components",
197  "convert from signed",
198  "convert to signed",
199  "import mipmap chains",
200  "intentionally true color",
201  }),
202  }),
203  new BlockField(164, "nested block test", "testing block nesting",
204  {
205  new Int32Field("nested property", ""),
206  new AsciiField("nested string", ""),
207  new BlockField(294, "child block", "",
208  {
209  new Int16Field("please work", ""),
210  new AsciiField("nested string1", ""),
211  new Enum32Field("argh", "second enum test",
212  {
213  "ON E",
214  "tWo",
215  "thR e E",
216  "4",
217  }),
218  new AsciiField("nested string2", ""),
219  new DataReferenceField("test dataref", "testing data reference"),
220  }),
221  }),
222  new DataReferenceField("test dataref", "testing data reference"),
223  new CommentField("Normal Comment",
224  "normal, unstyled comment"),
225  new CommentField("Info Comment",
226  "key information"),
227  new CommentField("Warning Comment",
228  "warning message"),
229  new CommentField("Error Comment",
230  "error message"),
231  new BlockField(68, "block", "",
232  {
233  new Int32Field("integer", ""),
234  new DataReferenceField("dataref", ""),
235  new BlockField(68, "block two", "",
236  {
237  new Int32Field("integer", ""),
238  new DataReferenceField("dataref", ""),
239  new BlockField(68, "block three", "",
240  {
241  new Int32Field("integer", ""),
242  new DataReferenceField("dataref", ""),
243  new BlockField(68, "block four", "",
244  {
245  new Int32Field("integer", ""),
246  new DataReferenceField("dataref", ""),
247  new BlockField(36, "block five", "",
248  {
249  new Int32Field("integer", ""),
250  new DataReferenceField("dataref", ""),
251  }),
252  }),
253  }),
254  }),
255  }),
256  new Int32Field("another int", ""),
257  new FieldReferenceField("fieldref field 0", ""),
258 
259  };
260  }
261 };
262 
263 namespace Blam::Content::Tags
264 {
265  BLAM test_tag* GetTestTagTag(std::string tag_path);
266 }
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:196
TestTagTagClass::TestTagTagClass
TestTagTagClass()
Definition: test_tag.h:134
test_tag::test_dataref
data_reference test_dataref
testing data reference
Definition: test_tag.h:92
width
int width
Definition: bgfx.cpp:19
TAG_ENUM
#define TAG_ENUM(name,...)
Definition: tags.h:30
AsciiField
Class representing an ascii tag field.
Definition: ascii.h:18
test_tag::integer_test
int32_t integer_test
memes
Definition: test_tag.h:32
ascii
char ascii[128]
Typedef for an ascii field, used in tag data definitions.
Definition: tags.h:353
bitfield32
Typedef for a bitfield32 field, used in tag data definitions.
Definition: tags.h:314
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:20
Enum32Field
Definition: enum.h:46
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:138
bitfield8
Typedef for a bitfield8 field, used in tag data definitions.
Definition: tags.h:275
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:137
int32_t
int int32_t
Definition: stdint.h:13
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:135
BlamTagClass::version
int version
The tag class version. Should be incremented any time a tag class is modified whatsoever.
Definition: tags.h:136
field_reference
Structure representing a field reference.
Definition: tags.h:367
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:134
Blam::Content::Tags::GetTagData
BLAM BlamTagData * GetTagData(std::string tag_path)
Retrieves information for a given tag.
Definition: tags.cpp:80
test_tag::byte_test
int8_t byte_test
A byte has a length of 1 bytes.
Definition: test_tag.h:34
fields.h
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:290
height
int height
Definition: bgfx.cpp:20
Blam::Content::Tags::GetTestTagTag
BLAM test_tag * GetTestTagTag(std::string tag_path)
Definition: test_tag.cpp:16
test_tag
Definition: test_tag.h:26
data_reference
Structure representing a data reference.
Definition: tags.h:261
BlamTagClass::tag_size
int tag_size
The size of the tag's data. Used on loading/writing tag files.
Definition: tags.h:139
TestTagTagClass
Definition: test_tag.h:131
BlamTagData::address
void * address
The address pointing to the start of the tag's data.
Definition: tags.h:71
tagclass.h
tags.h
tags.h
int16_t
short int16_t
Definition: stdint.h:12
BlamTagData
Class used to contain and access tag data.
Definition: tags.h:68
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:21
test_tag::fieldref_field_0
field_reference fieldref_field_0
Definition: test_tag.h:127
test_tag::another_int
int32_t another_int
Definition: test_tag.h:126
BlamTagClass
Class representing a tag class.
Definition: tags.h:131
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:33