Elaztek Developer Hub
Blamite Game Engine - blam!  00453.06.08.26.0624.blamite
The core library for the Blamite Game Engine.
decorator_set.h
Go to the documentation of this file.
1 // decorator_set [dctr] - 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_dctr "dctr"
20 
21 
22 
23 #pragma pack(push, 1)
25 {
30  TAG_BLOCK(variants,
31  {
32  data_reference identifier;
33  struct bitfield16_flags
34  {
35  bool random_rotation : 1;
36  bool random_scale : 1;
37  bool unused2 : 1;
38  bool unused3 : 1;
39  bool unused4 : 1;
40  bool unused5 : 1;
41  bool unused6 : 1;
42  bool unused7 : 1;
43  bool unused8 : 1;
44  bool unused9 : 1;
45  bool unused10 : 1;
46  bool unused11 : 1;
47  bool unused12 : 1;
48  bool unused13 : 1;
49  bool unused14 : 1;
50  bool unused15 : 1;
51  };
52 
53  bitfield16_flags flags;
54  TAG_BLOCK(LODs,
55  {
57  int8_t lod;
58  });
59  vector3 min_scale;
60  vector3 max_scale;
61  real minimum_distance_between_decorators;
62  real placement_weight;
63  });
64 };
65 #pragma pack(pop)
66 
68 {
69 public:
71  {
72  class_name_long = "decorator_set";
73  class_name_short = "dctr";
74  version = 0;
75 
76  revisions = {
77 
78  };
79 
80  tag_size = 64;
81 
82  fields =
83  {
84  new CommentField("LOD Distances",
85  "LOD levels range from 0 to 3, with 0 being the best quality model and 3 being the worst quality.\n"
86  "\n"
87  "All distances listed below are used to determine at which point LOD models are visible. Only one LOD level will be visible at any given time."),
88  new Vector2Field("LOD0 (base) distance", ""),
89  new Vector2Field("LOD1 distance", ""),
90  new Vector2Field("LOD2 distance", ""),
91  new Vector2Field("LOD3 distance", ""),
92  new CommentField("Decorator Variants",
93  "These settings specify available variants for decorators. All decorators can specify available LOD models, as well as default placement settings. The placement settings below only apply when initially placing decorators, and will not automatically re-apply."),
94  new BlockField(98, "variants", "",
95  {
96  new DataReferenceField("identifier", "Must be unique to this decorator."),
97  new Bitfield16Field("flags", "",
98  {
99  "random rotation",
100  "random scale",
101  }),
102  new BlockField(33, "LODs", "",
103  {
104  new TagReferenceField("model", "", { }),
105  new Int8Field("lod", ""),
106  }),
107  new Vector3Field("min scale", ""),
108  new Vector3Field("max scale", ""),
109  new RealField("minimum distance between decorators", "The minimum distance (in WU) allowed between placements"),
110  new RealField("placement weight", "When placing a decorator set without a specific type selected, weight value is used to determine the distribution of types"),
111  }),
112 
113  };
114  }
115 };
116 
117 namespace Blam::Content::Tags
118 {
119  BLAM decorator_set* GetDecoratorSetTag(std::string tag_path);
120 }
Blam::Content::Tags
Namespace containing functions related to tag data.
Definition: bitmap.h:181
RealField
Class representing a real tag field.
Definition: real.h:16
vector3
BlamVector3 vector3
Typedef for a vector3 field, used in tag definitions.
Definition: tags.h:445
Vector2Field
Class representing a vector2 tag field.
Definition: vector.h:34
decorator_set::lod1_distance
vector2 lod1_distance
Definition: decorator_set.h:27
decorator_set::lod3_distance
vector2 lod3_distance
Definition: decorator_set.h:29
DecoratorSetTagClass
Definition: decorator_set.h:67
DataReferenceField
Class representing a data reference, or dataref for short.
Definition: dataref.h:19
Vector3Field
Class representing a vector3 tag field.
Definition: vector.h:47
decorator_set::TAG_BLOCK
TAG_BLOCK(variants, { data_reference identifier;struct bitfield16_flags { bool random_rotation :1;bool random_scale :1;bool unused2 :1;bool unused3 :1;bool unused4 :1;bool unused5 :1;bool unused6 :1;bool unused7 :1;bool unused8 :1;bool unused9 :1;bool unused10 :1;bool unused11 :1;bool unused12 :1;bool unused13 :1;bool unused14 :1;bool unused15 :1;};bitfield16_flags flags;TAG_BLOCK(LODs, { tag_reference model;int8_t lod;});vector3 min_scale;vector3 max_scale;real minimum_distance_between_decorators;real placement_weight;})
Bitfield16Field
Class representing a bitfield16 tag field.
Definition: bitfield.h:44
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
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:209
BLAM
#define BLAM
Definition: decorator_set.h:16
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
plugins.h
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:206
BlamTagClass::version
int version
The tag class version. Should be incremented any time a tag class is modified whatsoever.
Definition: tags.h:207
DecoratorSetTagClass::DecoratorSetTagClass
DecoratorSetTagClass()
Definition: decorator_set.h:70
tag_dctr
#define tag_dctr
Definition: decorator_set.h:19
decorator_set::lod0_distance
vector2 lod0_distance
Definition: decorator_set.h:26
tag_reference
Structure representing a tag reference.
Definition: tags.h:289
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
real
float real
Typedef for a 'real', aka a float.
Definition: tags.h:443
Blam::Content::Tags::GetDecoratorSetTag
BLAM decorator_set * GetDecoratorSetTag(std::string tag_path)
Definition: decorator_set.cpp:13
decorator_set::lod2_distance
vector2 lod2_distance
Definition: decorator_set.h:28
data_reference
Structure representing a data reference.
Definition: tags.h:342
decorator_set.h
decorator_set
Definition: decorator_set.h:24
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
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
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:19
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
model
Definition: model.h:27