Elaztek Developer Hub
Blamite Game Engine - blam!  00423.10.27.24.0533.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 
20 
21 #pragma pack(push, 1)
23 {
24  //LOD Distances
25  /*LOD levels range from 0 to 3, with 0 being the best quality model and 3 being the worst quality.
26 
27  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.*/
32  //Decorator Variants
33  /*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.*/
34  TAG_BLOCK(variants,
35  {
36  data_reference identifier;
37  bitfield16 flags;
38  TAG_BLOCK(LODs,
39  {
41  int8_t lod;
42  });
43  vector3 min_scale;
44  vector3 max_scale;
45  real minimum_distance_between_decorators;
46  real placement_weight;
47  });
48 };
49 #pragma pack(pop)
50 
52 {
53 public:
55  {
56  class_name_long = "decorator_set";
57  class_name_short = "dctr";
58  version = 0;
59 
60  revisions = {
61 
62  };
63 
64  tag_size = 64;
65 
66  fields =
67  {
68  new CommentField("LOD Distances",
69  "LOD levels range from 0 to 3, with 0 being the best quality model and 3 being the worst quality.\n"
70  "\n"
71  "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."),
72  new Vector2Field("LOD0 (base) distance", ""),
73  new Vector2Field("LOD1 distance", ""),
74  new Vector2Field("LOD2 distance", ""),
75  new Vector2Field("LOD3 distance", ""),
76  new CommentField("Decorator Variants",
77  "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."),
78  new BlockField(98, "variants", "",
79  {
80  new DataReferenceField("identifier", "Must be unique to this decorator."),
81  new Bitfield16Field("flags", "",
82  {
83  "random rotation",
84  "random scale",
85  }),
86  new BlockField(33, "LODs", "",
87  {
88  new TagReferenceField("model", "", { }),
89  new Int8Field("lod", ""),
90  }),
91  new Vector3Field("min scale", ""),
92  new Vector3Field("max scale", ""),
93  new RealField("minimum distance between decorators", "The minimum distance (in WU) allowed between placements"),
94  new RealField("placement weight", "When placing a decorator set without a specific type selected, weight value is used to determine the distribution of types"),
95  }),
96 
97  };
98  }
99 };
100 
101 namespace Blam::Content::Tags
102 {
103  BLAM decorator_set* GetDecoratorSetTag(std::string tag_path);
104 }
Blam::Content::Tags
Namespace containing functions related to tag data.
Definition: bitmap.h:197
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:426
Vector2Field
Class representing a vector2 tag field.
Definition: vector.h:34
decorator_set::lod1_distance
vector2 lod1_distance
Definition: decorator_set.h:29
decorator_set::lod3_distance
vector2 lod3_distance
Definition: decorator_set.h:31
DecoratorSetTagClass
Definition: decorator_set.h:51
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
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:197
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:200
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:199
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:197
decorator_set::TAG_BLOCK
TAG_BLOCK(variants, { data_reference identifier;bitfield16 flags;TAG_BLOCK(LODs, { tag_reference model;int8_t lod;});vector3 min_scale;vector3 max_scale;real minimum_distance_between_decorators;real placement_weight;})
BlamTagClass::version
int version
The tag class version. Should be incremented any time a tag class is modified whatsoever.
Definition: tags.h:198
DecoratorSetTagClass::DecoratorSetTagClass
DecoratorSetTagClass()
Definition: decorator_set.h:54
decorator_set::lod0_distance
vector2 lod0_distance
Definition: decorator_set.h:28
tag_reference
Structure representing a tag reference.
Definition: tags.h:277
BlamTagClass::class_name_long
std::string class_name_long
The longer class name. Typically shown alongside short name for user-friendliness.
Definition: tags.h:196
real
float real
Typedef for a 'real', aka a float.
Definition: tags.h:424
Blam::Content::Tags::GetDecoratorSetTag
BLAM decorator_set * GetDecoratorSetTag(std::string tag_path)
Definition: decorator_set.cpp:13
bitfield16
Typedef for a bitfield16 field, used in tag data definitions.
Definition: tags.h:359
decorator_set::lod2_distance
vector2 lod2_distance
Definition: decorator_set.h:30
data_reference
Structure representing a data reference.
Definition: tags.h:323
decorator_set.h
decorator_set
Definition: decorator_set.h:22
BlamTagClass::tag_size
int tag_size
The size of the tag's data. Used on loading/writing tag files.
Definition: tags.h:201
vector2
BlamVector2 vector2
Typedef for a vector2 field, used in tag definitions.
Definition: tags.h:425
BlamTagData::address
void * address
The address pointing to the start of the tag's data.
Definition: tags.h:130
tags.h
BlamTagData
Class used to contain and access tag data.
Definition: tags.h:124
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:193
api.h
model
Definition: model.h:25