Elaztek Developer Hub
Blamite Game Engine - blam!  00453.06.08.26.0624.blamite
The core library for the Blamite Game Engine.
tile_set.h
Go to the documentation of this file.
1 // tile_set [tils] - Tag Definition //
3 // -------- //
4 // Part of the Blamite Game Engine //
5 // Copyright (c) Elaztek Studios 2013 - 2023 //
7 
8 
9 #pragma once
10 
11 #include <string>
12 #include <blam/api/v1/types/tags.h>
14 
15 #ifndef BLAM
16 #define BLAM
17 #endif
18 
19 #define tag_tils "tils"
20 
21 
22 
23 #pragma pack(push, 1)
24 struct tile_set
25 {
26  TAG_BLOCK(tile_sources,
27  {
29  });
30  TAG_BLOCK(tiles,
31  {
32  data_reference id;
33  TAG_ENUM8(type,
34  {
35  single,
36  auto_tile,
37  });
38 
39  int32_t source_index;
40  vector4 region;
41  vector2 placement_offset;
42  });
43 };
44 #pragma pack(pop)
45 
47 {
48 public:
50  {
51  class_name_long = "tile_set";
52  class_name_short = "tils";
53  version = 0;
54 
55  revisions = {
56 
57  };
58 
59  tag_size = 64;
60 
61  fields =
62  {
63  new BlockField(32, "tile sources", "",
64  {
65  new TagReferenceField("bitmap", "", { }),
66  }),
67  new BlockField(61, "tiles", "",
68  {
69  new DataReferenceField("id", ""),
70  new Enum8Field("type", "",
71  {
72  "Single Tile",
73  "Auto Tile",
74  }),
75  new Int32Field("source index", ""),
76  new Vector4Field("region", ""),
77  new Vector2Field("placement offset", ""),
78  }),
79 
80  };
81  }
82 };
83 
84 namespace Blam::Content::Tags
85 {
86  BLAM tile_set* GetTileSetTag(std::string tag_path);
87 }
tile_set
Definition: tile_set.h:24
Blam::Content::Tags
Namespace containing functions related to tag data.
Definition: bitmap.h:181
Vector4Field
Class representing a vector4 tag field.
Definition: vector.h:60
Vector2Field
Class representing a vector2 tag field.
Definition: vector.h:34
TileSetTagClass
Definition: tile_set.h:46
vector4
BlamVector4 vector4
Typedef for a vector4 field, used in tag definitions.
Definition: tags.h:446
DataReferenceField
Class representing a data reference, or dataref for short.
Definition: dataref.h:19
Blam::Content::Tags::GetTileSetTag
BLAM tile_set * GetTileSetTag(std::string tag_path)
Definition: tile_set.cpp:13
TagReferenceField
Class representing a tag reference, or tagref for short.
Definition: tagref.h:20
Blam::API::v1::Tags::GetTagData
BLAM_EXT_API BlamTagData * GetTagData(std::string tag_path)
Retrieves information for a given tag.
Definition: api.cpp:208
BlamTagClass::fields
std::vector< BlamTagClassField * > fields
A series of tag fields that store the layout of the tag.
Definition: tags.h:209
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:208
int32_t
int int32_t
Definition: stdint.h:13
plugins.h
BlamTagClass::class_name_short
std::string class_name_short
The short, 4-character name of the tag class.
Definition: tags.h:206
BlamTagClass::version
int version
The tag class version. Should be incremented any time a tag class is modified whatsoever.
Definition: tags.h:207
tag_reference
Structure representing a tag reference.
Definition: tags.h:289
BLAM
#define BLAM
Definition: tile_set.h:16
tile_set.h
BlamTagClass::class_name_long
std::string class_name_long
The longer class name. Typically shown alongside short name for user-friendliness.
Definition: tags.h:205
TAG_ENUM8
#define TAG_ENUM8(name,...)
Macro used to aid in the creation of enums within tag structures.
Definition: tags.h:57
Enum8Field
Definition: enum.h:33
Int32Field
Class representing an int32 tag field.
Definition: int.h:46
tag_tils
#define tag_tils
Definition: tile_set.h:19
data_reference
Structure representing a data reference.
Definition: tags.h:342
BlamTagClass::tag_size
int tag_size
The size of the tag's data. Used on loading/writing tag files.
Definition: tags.h:210
vector2
BlamVector2 vector2
Typedef for a vector2 field, used in tag definitions.
Definition: tags.h:444
bitmap
Definition: bitmap.h:34
BlamTagData::address
void * address
The address pointing to the start of the tag's data.
Definition: tags.h:132
tags.h
BlamTagData
Class used to contain and access tag data.
Definition: tags.h:125
tile_set::TAG_BLOCK
TAG_BLOCK(tile_sources, { tag_reference bitmap;})
BlockField
Class representing a tag block field, also sometimes referred to as a struct or reflexive in the modd...
Definition: block.h:19
TileSetTagClass::TileSetTagClass
TileSetTagClass()
Definition: tile_set.h:49
BlamTagClass
Class representing a tag class.
Definition: tags.h:202
api.h
BlamTagData::tag_class
std::string tag_class
The tag's short class name.
Definition: tags.h:146