Elaztek Developer Hub
Blamite Game Engine - blam!  00346.12.11.21.0529.blamite
The core library for the Blamite Game Engine.
bitmap.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../tagclass.h"
4 #include "../fields.h"
5 
6 #ifndef BLAM
7 #define BLAM
8 #endif
9 
11 {
20  struct bitmap
21  {
23  short short_test;
24  byte byte_test;
25 
26  TAG_BLOCK(bitmap_data,
27  {
28  short width;
29  short height;
30  byte depth;
31  bitfield8 format_flags;
32 
33  TAG_ENUM(bitmap_type,
34  {
35  texture_2d,
36  texture_3d,
37  cubemap,
38  unknown
39  });
40  });
41 
42  TAG_BLOCK(the_go_fuck_yourself_block,
43  {
44  bitfield16 extra_flags;
45  bitfield32 who_needs_this_many_flags;
46  });
47 
48  TAG_BLOCK(nested_block_test,
49  {
50  int nested_property;
51  ascii nested_string;
52 
53  TAG_BLOCK(nested_block_child_block,
54  {
55  short please_work;
56  ascii edge_1;
57 
58  TAG_ENUM(argh,
59  {
60  argh_one,
61  argh_two,
62  argh_three,
63  argh_four
64  });
65 
66  ascii edge_2;
67 
68  //tag_reference test_ref;
70  });
71  });
72 
73  //tag_reference test_ref;
75  };
76 
77  namespace Classes
78  {
80  {
81  public:
83  {
84  class_name_long = "bitmap";
85  class_name_short = "bitm";
86  version = 2;
87 
88  revisions = {
89  {1, "haloman30", "Initial implementation."},
90  {2, "haloman30", "Add test datarefs and tagrefs"}
91  };
92 
93  tag_size = sizeof(bitmap);
94 
95  fields =
96  {
97  new CommentField("Bitmap", "im gonna shove a bitmap up your ass"),
98  new Int32Field("integer test", "memes"),
99  new Int16Field("short test", "A short has a length of 2 bytes."),
100  new Int8Field("byte test", "A byte has a length of 1 bytes."),
101  new BlockField(sizeof(bitmap::bitmap_data_entry), "block test", "*sweats nervously*",
102  {
103  new Int16Field("width", "image width"),
104  new Int16Field("height", "image height"),
105  new Int8Field("depth", "image depth"),
106  new CommentField("comment title", "explanation goes here brotheR"),
107  new Bitfield8Field("format flags", "extra flags for fuck you",
108  {
109  "bit 0",
110  "bit 1",
111  "bit 2",
112  "is tiled"
113  }),
114  new Enum32Field("type", "the usage type of this bitmap",
115  {
116  "2d texture",
117  "3d texture",
118  "cubemap",
119  "unknown"
120  })
121  }),
122  new BlockField(sizeof(bitmap::the_go_fuck_yourself_block_entry), "the 'go fuck yourself' block", "yea im tired leave me alone",
123  {
124  new Bitfield16Field("extra flags", "hi",
125  {
126  "can you imagine needing this many flags",
127  "yea me neither"
128  }),
129  new Bitfield32Field("who needs this many fucking flags", "apparently me because i put this shit here",
130  {
131  "enable diffusion dithering",
132  "disable height map compression",
133  "uniform sprite sequences",
134  "filthy sprite bug fix",
135  "use sharp bump filter",
136  "UNUSED",
137  "use clamped/mirrored bump",
138  "invert detail fade",
139  "swap x-y vector components",
140  "convert from signed",
141  "convert to signed",
142  "import mipmap chains",
143  "intentionally true color"
144  })
145  }),
146  new BlockField(sizeof(bitmap::nested_block_test_entry), "nested block test", "testing block nesting",
147  {
148  new Int32Field("nested property", ""),
149  new AsciiField("nested string", ""),
150  new BlockField(sizeof(bitmap::nested_block_test_entry::nested_block_child_block_entry), "child block", "",
151  {
152  new Int16Field("please work", ""),
153  new AsciiField("nested string1", ""),
154  new Enum32Field("argh", "second enum test",
155  {
156  "ON E",
157  "tWo",
158  "thR e E",
159  "4"
160  }),
161  new AsciiField("nested string2", ""),
162  //new TagReferenceField("test ref", "testing tag reference", {"bitm", "colo"}),
163  new DataReferenceField("test dataref", "testing data reference")
164  })
165  }),
166  //new TagReferenceField("test ref", "testing tag reference", {"bitm", "colo"}),
167  new DataReferenceField("test dataref", "testing data reference"),
168  new CommentField("Normal Comment", "normal, unstyled comment", BlamCommentStyle::None),
169  new CommentField("Info Comment", "key information", BlamCommentStyle::Info),
170  new CommentField("Warning Comment", "warning message", BlamCommentStyle::Warning),
171  new CommentField("Error Comment", "error message", BlamCommentStyle::Error)
172  };
173  }
174  };
175  }
176 
177  BLAM bitmap* GetBitmapTag(std::string tag_path);
178 }
Int16Field
Class representing an int16 tag field.
Definition: int.h:40
TAG_ENUM
#define TAG_ENUM(name,...)
Definition: tags.h:28
ascii
char ascii[128]
Typedef for an ascii field, used in tag data definitions.
Definition: tags.h:318
Blam::Content::Tags
Namespace containing functions related to tag data.
Definition: bitmap.h:10
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:279
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
Blam::Content::Tags::bitmap::test_dataref
data_reference test_dataref
Definition: bitmap.h:74
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:240
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:47
Blam::Content::Tags::bitmap::integer_test
int integer_test
Definition: bitmap.h:22
Blam::Content::Tags::Classes::BitmapTagClass
Definition: bitmap.h:79
Int8Field
Class representing an int8 tag field.
Definition: int.h:53
BlamTagClass::class_name_short
std::string class_name_short
The short, 4-character name of the tag class.
Definition: tagclass.h:45
BlamTagClass::version
int version
The tag class version. Should be incremented any time a tag class is modified whatsoever.
Definition: tagclass.h:46
Blam::Content::Tags::bitmap
Structure representing a Bitmap tag.
Definition: bitmap.h:20
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:44
Blam::Content::Tags::bitmap::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 });})
Blam::Content::Tags::Classes::BitmapTagClass::BitmapTagClass
BitmapTagClass()
Definition: bitmap.h:82
Blam::Content::Tags::bitmap::byte_test
byte byte_test
Definition: bitmap.h:24
BlamCommentStyle::Info
@ Info
The comment will be given an information message appearance.
Int32Field
Class representing an int32 tag field.
Definition: int.h:27
bitfield16
Typedef for a bitfield16 field, used in tag data definitions.
Definition: tags.h:255
height
int height
Definition: bgfx.cpp:20
data_reference
Structure representing a data reference.
Definition: tags.h:214
BLAM
#define BLAM
Definition: discord_rpc.h:8
BlamTagClass::tag_size
int tag_size
The size of the tag's data. Used on loading/writing tag files.
Definition: tagclass.h:51
BlamCommentStyle::Error
@ Error
The comment will be given an error message appearance.
Blam::Content::Tags::GetBitmapTag
BLAM bitmap * GetBitmapTag(std::string tag_path)
Definition: bitmap.cpp:5
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
Blam::Content::Tags::bitmap::short_test
short short_test
Definition: bitmap.h:23
BlamTagClass
Class representing a tag class.
Definition: tagclass.h:41
BlamTagClass::fields
std::vector< BlamPluginField * > fields
A series of tag fields that store the layout of the tag.
Definition: tagclass.h:49
Bitfield8Field
Class representing a bitfield8 tag field.
Definition: bitfield.h:27