Elaztek Developer Hub
Blamite Game Engine - blam!  00367.02.08.23.1815.blamite
The core library for the Blamite Game Engine.
test_tag.h
Go to the documentation of this file.
1 #pragma once
2 
5 
6 #ifndef BLAM
7 #define BLAM
8 #endif
9 
10 #pragma pack(push, 1)
11 struct test_tag
12 {
14  short short_test;
15  byte byte_test;
16 
17  TAG_BLOCK(bitmap_data,
18  {
19  short width;
20  short height;
21  byte depth;
22  bitfield8 format_flags;
23 
24  TAG_ENUM(bitmap_type,
25  {
26  texture_2d,
27  texture_3d,
28  cubemap,
29  unknown
30  });
31  });
32 
33  TAG_BLOCK(the_go_fuck_yourself_block,
34  {
35  bitfield16 extra_flags;
36  bitfield32 who_needs_this_many_flags;
37  });
38 
39  TAG_BLOCK(nested_block_test,
40  {
41  int nested_property;
42  ascii nested_string;
43 
44  TAG_BLOCK(nested_block_child_block,
45  {
46  short please_work;
47  ascii edge_1;
48 
49  TAG_ENUM(argh,
50  {
51  argh_one,
52  argh_two,
53  argh_three,
54  argh_four
55  });
56 
57  ascii edge_2;
58 
59  //tag_reference test_ref;
61  });
62  });
63 
64  //tag_reference test_ref;
66 
67  TAG_BLOCK(block,
68  {
69  int integer;
70  data_reference dataref;
71  TAG_BLOCK(block_two,
72  {
73  int integer;
74  data_reference dataref;
75  TAG_BLOCK(block_three,
76  {
77  int integer;
78  data_reference dataref;
79  TAG_BLOCK(block_four,
80  {
81  int integer;
82  data_reference dataref;
83  TAG_BLOCK(block_five,
84  {
85  int integer;
86  data_reference dataref;
87  });
88  });
89  });
90  });
91  });
92 
94 };
95 #pragma pack(pop)
96 
98 {
99 public:
101  {
102  class_name_long = "test_tag";
103  class_name_short = "ttag";
104  version = 1;
105 
106  revisions = {
107  {1, "haloman30", "Initial implementation."},
108  {2, "haloman30", "Move over test fields that were in bitmap tag for some reason"}
109  };
110 
111  tag_size = sizeof(test_tag);
112 
113  fields =
114  {
115  new CommentField("test tag", "this tag class is used for testing purposes only, do not use it for actual game data"),
116 
117  new CommentField("Bitmap", "im gonna shove a bitmap up your ass"),
118  new Int32Field("integer test", "memes"),
119  new Int16Field("short test", "A short has a length of 2 bytes."),
120  new Int8Field("byte test", "A byte has a length of 1 bytes."),
121  new BlockField(sizeof(test_tag::bitmap_data_entry), "block test", "*sweats nervously*",
122  {
123  new Int16Field("width", "image width"),
124  new Int16Field("height", "image height"),
125  new Int8Field("depth", "image depth"),
126  new CommentField("comment title", "explanation goes here brotheR"),
127  new Bitfield8Field("format flags", "extra flags for fuck you",
128  {
129  "bit 0",
130  "bit 1",
131  "bit 2",
132  "is tiled"
133  }),
134  new Enum32Field("type", "the usage type of this bitmap",
135  {
136  "2d texture",
137  "3d texture",
138  "cubemap",
139  "unknown"
140  })
141  }),
142  new BlockField(sizeof(test_tag::the_go_fuck_yourself_block_entry), "the 'go fuck yourself' block", "yea im tired leave me alone",
143  {
144  new Bitfield16Field("extra flags", "hi",
145  {
146  "can you imagine needing this many flags",
147  "yea me neither"
148  }),
149  new Bitfield32Field("who needs this many fucking flags", "apparently me because i put this shit here",
150  {
151  "enable diffusion dithering",
152  "disable height map compression",
153  "uniform sprite sequences",
154  "filthy sprite bug fix",
155  "use sharp bump filter",
156  "UNUSED",
157  "use clamped/mirrored bump",
158  "invert detail fade",
159  "swap x-y vector components",
160  "convert from signed",
161  "convert to signed",
162  "import mipmap chains",
163  "intentionally true color"
164  })
165  }),
166  new BlockField(sizeof(test_tag::nested_block_test_entry), "nested block test", "testing block nesting",
167  {
168  new Int32Field("nested property", ""),
169  new AsciiField("nested string", ""),
170  new BlockField(sizeof(test_tag::nested_block_test_entry::nested_block_child_block_entry), "child block", "",
171  {
172  new Int16Field("please work", ""),
173  new AsciiField("nested string1", ""),
174  new Enum32Field("argh", "second enum test",
175  {
176  "ON E",
177  "tWo",
178  "thR e E",
179  "4"
180  }),
181  new AsciiField("nested string2", ""),
182  //new TagReferenceField("test ref", "testing tag reference", {"bitm", "colo"}),
183  new DataReferenceField("test dataref", "testing data reference")
184  })
185  }),
186  //new TagReferenceField("test ref", "testing tag reference", {"bitm", "colo"}),
187  new DataReferenceField("test dataref", "testing data reference"),
188  new CommentField("Normal Comment", "normal, unstyled comment", BlamCommentStyle::None),
189  new CommentField("Info Comment", "key information", BlamCommentStyle::Info),
190  new CommentField("Warning Comment", "warning message", BlamCommentStyle::Warning),
191  new CommentField("Error Comment", "error message", BlamCommentStyle::Error),
192 
193  new BlockField(sizeof(test_tag::block_entry), "block", "",
194  {
195  new Int32Field("integer", ""),
196  new DataReferenceField("dataref", ""),
197  new BlockField(sizeof(test_tag::block_entry), "block two", "",
198  {
199  new Int32Field("integer", ""),
200  new DataReferenceField("dataref", ""),
201  new BlockField(sizeof(test_tag::block_entry), "block three", "",
202  {
203  new Int32Field("integer", ""),
204  new DataReferenceField("dataref", ""),
205  new BlockField(sizeof(test_tag::block_entry), "block four", "",
206  {
207  new Int32Field("integer", ""),
208  new DataReferenceField("dataref", ""),
209  new BlockField(sizeof(test_tag::block_entry), "block five", "",
210  {
211  new Int32Field("integer", ""),
212  new DataReferenceField("dataref", "")
213  }),
214  }),
215  }),
216  }),
217  }),
218  new Int32Field("another int", "")
219  };
220  }
221 };
222 
223 namespace Blam::Content::Tags
224 {
225 
226 }
Int16Field
Class representing an int16 tag field.
Definition: int.h:53
TAG_ENUM
#define TAG_ENUM(name,...)
Definition: tags.h:33
ascii
char ascii[128]
Typedef for an ascii field, used in tag data definitions.
Definition: tags.h:313
Blam::Content::Tags
Namespace containing functions related to tag data.
Definition: bitmap.h:151
test_tag::short_test
short short_test
Definition: test_tag.h:14
TestTagTagClass::TestTagTagClass
TestTagTagClass()
Definition: test_tag.h:100
test_tag::test_dataref
data_reference test_dataref
Definition: test_tag.h:65
width
int width
Definition: bgfx.cpp:19
AsciiField
Class representing an ascii tag field.
Definition: ascii.h:12
bitfield32
Typedef for a bitfield32 field, used in tag data definitions.
Definition: tags.h:274
test_tag::another_int
int another_int
Definition: test_tag.h:93
BlamCommentStyle::None
@ None
The comment will be given the default appearance.
DataReferenceField
Class representing a data reference, or dataref for short.
Definition: dataref.h:14
Bitfield16Field
Class representing a bitfield16 tag field.
Definition: bitfield.h:38
BlamCommentStyle::Warning
@ Warning
The comment will be given a warning message appearance.
Enum32Field
Definition: enum.h:40
bitfield8
Typedef for a bitfield8 field, used in tag data definitions.
Definition: tags.h:235
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: tagclass.h:49
Int8Field
Class representing an int8 tag field.
Definition: int.h:66
BlamTagClass::class_name_short
std::string class_name_short
The short, 4-character name of the tag class.
Definition: tagclass.h:47
BlamTagClass::version
int version
The tag class version. Should be incremented any time a tag class is modified whatsoever.
Definition: tagclass.h:48
Bitfield32Field
Class representing a bitfield32 tag field.
Definition: bitfield.h:49
BlamTagClass::class_name_long
std::string class_name_long
The longer class name. Typically shown alongside short name for user-friendliness.
Definition: tagclass.h:46
test_tag::TAG_BLOCK
TAG_BLOCK(bitmap_data, { short width;short height;byte depth;bitfield8 format_flags;TAG_ENUM(bitmap_type, { texture_2d, texture_3d, cubemap, unknown });})
BlamCommentStyle::Info
@ Info
The comment will be given an information message appearance.
fields.h
Int32Field
Class representing an int32 tag field.
Definition: int.h:40
bitfield16
Typedef for a bitfield16 field, used in tag data definitions.
Definition: tags.h:250
height
int height
Definition: bgfx.cpp:20
test_tag
Definition: test_tag.h:11
data_reference
Structure representing a data reference.
Definition: tags.h:208
test_tag::byte_test
byte byte_test
Definition: test_tag.h:15
BlamTagClass::tag_size
int tag_size
The size of the tag's data. Used on loading/writing tag files.
Definition: tagclass.h:53
TestTagTagClass
Definition: test_tag.h:97
BlamCommentStyle::Error
@ Error
The comment will be given an error message appearance.
tagclass.h
CommentField
Class representing a comment field.
Definition: comment.h:23
BlockField
Class representing a tag block field, also sometimes referred to as a struct or reflexive in the modd...
Definition: block.h:13
BlamTagClass
Class representing a tag class.
Definition: tagclass.h:43
BlamTagClass::fields
std::vector< BlamPluginField * > fields
A series of tag fields that store the layout of the tag.
Definition: tagclass.h:51
test_tag::integer_test
int integer_test
Definition: test_tag.h:13
Bitfield8Field
Class representing a bitfield8 tag field.
Definition: bitfield.h:27