Elaztek Developer Hub
Blamite Game Engine - blam!  00310.02.05.21.0336.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 {
13  {
18  };
19 
21  {
22  short width;
23  short height;
24  byte depth;
27  //bitfield8 format_flags;
28  };
29 
31  {
34  };
35 
37  {
38  short please_work;
42 
45  };
46 
48  {
52  };
53 
55  {
56  bool bit_0;
57  bool bit_1;
58  bool bit_2;
59  bool is_tiled;
60  };
61 
70  struct bitmap
71  {
73  short short_test;
74  byte byte_test;
80  };
81 
82  namespace Classes
83  {
85  {
86  public:
88  {
89  class_name_long = "bitmap";
90  class_name_short = "bitm";
91  version = 2;
92 
93  revisions = {
94  {1, "haloman30", "Initial implementation."},
95  {2, "haloman30", "Add test datarefs and tagrefs"}
96  };
97 
98  tag_size = sizeof(bitmap);
99 
100  fields =
101  {
102  new CommentField("Bitmap", "im gonna shove a bitmap up your ass"),
103  new Int32Field("integer test", "memes"),
104  new Int16Field("short test", "A short has a length of 2 bytes."),
105  new Int8Field("byte test", "A byte has a length of 1 bytes."),
106  new BlockField(sizeof(bitmap__bitmap_data), "block test", "*sweats nervously*",
107  {
108  new Int16Field("width", "image width"),
109  new Int16Field("height", "image height"),
110  new Int8Field("depth", "image depth"),
111  new CommentField("comment title", "explanation goes here brotheR"),
112  new Bitfield8Field("format flags", "extra flags for fuck you",
113  {
114  "bit 0",
115  "bit 1",
116  "bit 2",
117  "is tiled"
118  }),
119  new Enum32Field("type", "the usage type of this bitmap",
120  {
121  "2d texture",
122  "3d texture",
123  "cubemap",
124  "unknown"
125  })
126  }),
127  new BlockField(sizeof(the_go_fuck_yourself_block), "the 'go fuck yourself' block", "yea im tired leave me alone",
128  {
129  new Bitfield16Field("extra flags", "hi",
130  {
131  "can you imagine needing this many flags",
132  "yea me neither"
133  }),
134  new Bitfield32Field("who needs this many fucking flags", "apparently me because i put this shit here",
135  {
136  "enable diffusion dithering",
137  "disable height map compression",
138  "uniform sprite sequences",
139  "filthy sprite bug fix",
140  "use sharp bump filter",
141  "UNUSED",
142  "use clamped/mirrored bump",
143  "invert detail fade",
144  "swap x-y vector components",
145  "convert from signed",
146  "convert to signed",
147  "import mipmap chains",
148  "intentionally true color"
149  })
150  }),
151  new BlockField(sizeof(nested_block_test_block), "nested block test", "testing block nesting",
152  {
153  new Int32Field("nested property", ""),
154  new AsciiField("nested string", ""),
155  new BlockField(sizeof(nested_block_child_block), "child block", "",
156  {
157  new Int16Field("please work", ""),
158  new AsciiField("nested string1", ""),
159  new Enum32Field("type", "the usage type of this bitmap",
160  {
161  "2d texture",
162  "3d texture",
163  "cubemap",
164  "unknown"
165  }),
166  new AsciiField("nested string2", ""),
167  new TagReferenceField("test ref", "testing tag reference", {"bitm", "colo"}),
168  new DataReferenceField("test dataref", "testing data reference")
169  })
170  }),
171  new TagReferenceField("test ref", "testing tag reference", {"bitm", "colo"}),
172  new DataReferenceField("test dataref", "testing data reference")
173  };
174  }
175  };
176  }
177 
178  BLAM bitmap* GetBitmapTag(std::string tag_path);
179 }
Int16Field
Class representing an int16 tag field.
Definition: int.h:40
Blam::Content::Tags::nested_block_test_block
Definition: bitmap.h:47
ascii
char ascii[128]
Typedef for an ascii field, used in tag data definitions.
Definition: tags.h:211
Blam::Content::Tags
Namespace containing things related to tag data.
Definition: bitmap.h:10
Blam::Content::Tags::nested_block_child_block
Definition: bitmap.h:36
Blam::Content::Tags::format_flags_bitfield
Definition: bitmap.h:54
tag_block
Structure representing a tag block.
Definition: tags.h:107
Blam::Content::Tags::texture_2d
@ texture_2d
Definition: bitmap.h:14
Blam::Content::Tags::the_go_fuck_yourself_block::who_needs_this_many_flags
bitfield32 who_needs_this_many_flags
Definition: bitmap.h:33
AsciiField
Class representing an ascii tag field.
Definition: ascii.h:11
Blam::Content::Tags::nested_block_child_block::bitmap_type
bitmap__bitmap_type bitmap_type
Definition: bitmap.h:40
Blam::Content::Tags::the_go_fuck_yourself_block::extra_flags
bitfield16 extra_flags
Definition: bitmap.h:32
Blam::Content::Tags::bitmap::test_ref
tag_reference test_ref
Definition: bitmap.h:78
bitfield32
bool bitfield32[32]
Typedef for a bitfield32 field, used in tag data definitions.
Definition: tags.h:209
Blam::Content::Tags::bitmap__bitmap_data::height
short height
Definition: bitmap.h:23
DataReferenceField
Class representing a data reference, or dataref for short.
Definition: dataref.h:14
Bitfield16Field
Class representing a bitfield16 tag field.
Definition: bitfield.h:40
Blam::Content::Tags::bitmap::test_dataref
data_reference test_dataref
Definition: bitmap.h:79
Blam::Content::Tags::unknown
@ unknown
Definition: bitmap.h:17
TagReferenceField
Class representing a tag reference, or tagref for short.
Definition: tagref.h:14
Enum32Field
Definition: enum.h:40
Blam::Content::Tags::nested_block_test_block::child_block
tag_block< nested_block_child_block > child_block
Definition: bitmap.h:51
Blam::Content::Tags::format_flags_bitfield::bit_2
bool bit_2
Definition: bitmap.h:58
Blam::Content::Tags::nested_block_test_block::nested_string
ascii nested_string
Definition: bitmap.h:50
Blam::Content::Tags::format_flags_bitfield::is_tiled
bool is_tiled
Definition: bitmap.h:59
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:72
Blam::Content::Tags::Classes::BitmapTagClass
Definition: bitmap.h:84
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
Blam::Content::Tags::bitmap__bitmap_data::depth
byte depth
Definition: bitmap.h:24
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:70
tag_reference
Structure representing a tag reference.
Definition: tags.h:150
Bitfield32Field
Class representing a bitfield32 tag field.
Definition: bitfield.h:51
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__bitmap_data::width
short width
Definition: bitmap.h:22
Blam::Content::Tags::texture_3d
@ texture_3d
Definition: bitmap.h:15
Blam::Content::Tags::Classes::BitmapTagClass::BitmapTagClass
BitmapTagClass()
Definition: bitmap.h:87
Blam::Content::Tags::bitmap::nested_block_test
tag_block< nested_block_test_block > nested_block_test
Definition: bitmap.h:77
Blam::Content::Tags::bitmap::bitmap_data
tag_block< bitmap__bitmap_data > bitmap_data
Definition: bitmap.h:75
Blam::Content::Tags::bitmap::byte_test
byte byte_test
Definition: bitmap.h:74
Blam::Content::Tags::nested_block_child_block::edge_2
ascii edge_2
Definition: bitmap.h:41
Int32Field
Class representing an int32 tag field.
Definition: int.h:27
Blam::Content::Tags::bitmap__bitmap_data::bitmap_type
bitmap__bitmap_type bitmap_type
Definition: bitmap.h:26
data_reference
Structure representing a data reference.
Definition: tags.h:188
Blam::Content::Tags::bitmap__bitmap_data::format_flags
bitfield8 format_flags
Definition: bitmap.h:25
Blam::Content::Tags::bitmap::the_go_fuck_yourself
tag_block< the_go_fuck_yourself_block > the_go_fuck_yourself
Definition: bitmap.h:76
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
Blam::Content::Tags::nested_block_child_block::please_work
short please_work
Definition: bitmap.h:38
Blam::Content::Tags::format_flags_bitfield::bit_0
bool bit_0
Definition: bitmap.h:56
Blam::Content::Tags::the_go_fuck_yourself_block
Definition: bitmap.h:30
Blam::Content::Tags::nested_block_child_block::edge_1
ascii edge_1
Definition: bitmap.h:39
Blam::Content::Tags::GetBitmapTag
BLAM bitmap * GetBitmapTag(std::string tag_path)
Definition: bitmap.cpp:5
bitfield16
bool bitfield16[16]
Typedef for a bitfield16 field, used in tag data definitions.
Definition: tags.h:208
Blam::Content::Tags::format_flags_bitfield::bit_1
bool bit_1
Definition: bitmap.h:57
Blam::Content::Tags::nested_block_child_block::test_dataref
data_reference test_dataref
Definition: bitmap.h:44
bitfield8
bool bitfield8[8]
Typedef for a bitfield8 field, used in tag data definitions.
Definition: tags.h:207
Blam::Content::Tags::nested_block_child_block::test_ref
tag_reference test_ref
Definition: bitmap.h:43
CommentField
Class representing a comment field.
Definition: comment.h:12
Blam::Content::Tags::bitmap__bitmap_type
bitmap__bitmap_type
Definition: bitmap.h:12
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__bitmap_data
Definition: bitmap.h:20
Blam::Content::Tags::bitmap::short_test
short short_test
Definition: bitmap.h:73
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
Blam::Content::Tags::nested_block_test_block::nested_property
int nested_property
Definition: bitmap.h:49
Blam::Content::Tags::cubemap
@ cubemap
Definition: bitmap.h:16
Bitfield8Field
Class representing a bitfield8 tag field.
Definition: bitfield.h:29