Elaztek Developer Hub
Blamite Game Engine - blam!  00367.02.08.23.1815.blamite
The core library for the Blamite Game Engine.
scenario.h
Go to the documentation of this file.
1 #pragma once
2 
5 
6 #ifndef BLAM
7 #define BLAM
8 #endif
9 
10 #pragma pack(push, 1)
11 struct scenario
12 {
13  TAG_ENUM(type,
14  {
15  solo,
16  multiplayer,
17  main_menu,
18  multiplayer_shared,
19  singleplayer_shared
20  });
21 
22  TAG_BLOCK(project_folders,
23  {
24  bitfield8 flags;
25  int folder_id;
26  int parent_folder_id;
27  ascii folder_name;
28  });
29 
30  TAG_BLOCK(primitives,
31  {
32  int folder_id;
33  ascii name;
34  ascii description;
35 
36  TAG_ENUM(type,
37  {
38  cuboid,
39  cylinder
40  });
41 
42  vector3 position;
43  vector3 rotation;
44  vector3 scale;
45 
46  vector2 cylinder_radius;
47  int cylinder_resolution;
48  });
49 };
50 #pragma pack(pop)
51 
53 {
55  {
56  public:
58  {
59  class_name_long = "scenario";
60  class_name_short = "scnr";
61  version = 2;
62 
63  revisions = {
64  {1, "haloman30", "Initial implementation."},
65  {2, "haloman30", "Added 'project folders' block."},
66  {3, "haloman30", "Replaced several real values with vectors."}
67  };
68 
69  tag_size = sizeof(scenario);
70 
71  fields =
72  {
73  new Enum32Field("type", "",
74  {
75  "solo",
76  "multiplayer",
77  "main menu",
78  "multiplayer shared",
79  "singleplayer shared"
80  }),
81  new Int32Field("unused padding", ""),
82  new BlockField(sizeof(scenario::project_folders_entry), "project folders", "Contains information about project folders. Only used within the editor.",
83  {
84  new Bitfield8Field("flags", "List of flags that apply to this folder.",
85  {
86  "has parent folder"
87  }),
88  new Int32Field("folder id", "The ID of this folder."),
89  new Int32Field("parent folder id", "The ID of this folder's parent folder, if applicable."),
90  new AsciiField("folder name", "The display name of the folder.")
91  }),
92  new BlockField(sizeof(scenario::primitives_entry), "primitives", "List of primitive objects contained within the scenario.",
93  {
94  new Int32Field("folder id", "the folder id that this primitive exists within. set to -1 to have no parent"),
95  new AsciiField("name", "custom display name for the object"),
96  new AsciiField("description", "custom description for the object"),
97 
98  new Enum32Field("type", "The type of this primitive.",
99  {
100  "cuboid",
101  "cylinder"
102  }),
103 
104  new CommentField("POSITION", ""),
105 
106  new Vector3Field("position", ""),
107  new Vector3Field("rotation", "", "[yaw,pitch,roll]"),
108  new Vector3Field("scale", ""),
109 
110  new CommentField("cylinder specific properties", ""),
111  new Vector2Field("radius", "", "[inner, outer]"),
112  new Int32Field("cylinder resolution", ""),
113  })
114  };
115  }
116  };
117 }
ascii
char ascii[128]
Typedef for an ascii field, used in tag data definitions.
Definition: tags.h:313
vector2
BlamVector2 vector2
Typedef for a vector2 field, used in tag definitions.
Definition: tags.h:316
Blam::Content::Tags::Classes::ScenarioTagClass::ScenarioTagClass
ScenarioTagClass()
Definition: scenario.h:57
AsciiField
Class representing an ascii tag field.
Definition: ascii.h:12
Vector2Field
Class representing a vector2 tag field.
Definition: vector.h:28
Vector3Field
Class representing a vector3 tag field.
Definition: vector.h:41
scenario::TAG_BLOCK
TAG_BLOCK(project_folders, { bitfield8 flags;int folder_id;int parent_folder_id;ascii folder_name;})
Blam::Content::Tags::Classes::ScenarioTagClass
Definition: scenario.h:54
scenario
Definition: scenario.h:11
Enum32Field
Definition: enum.h:40
bitfield8
Typedef for a bitfield8 field, used in tag data definitions.
Definition: tags.h:235
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:49
BlamTagClass::class_name_short
std::string class_name_short
The short, 4-character name of the tag class.
Definition: tagclass.h:47
BlamTagClass::version
int version
The tag class version. Should be incremented any time a tag class is modified whatsoever.
Definition: tagclass.h:48
BlamTagClass::class_name_long
std::string class_name_long
The longer class name. Typically shown alongside short name for user-friendliness.
Definition: tagclass.h:46
main_menu
BlamDebugMenu * main_menu
The debug menu data.
Definition: debug_menu.cpp:15
scenario::TAG_ENUM
TAG_ENUM(type, { solo, multiplayer, main_menu, multiplayer_shared, singleplayer_shared })
fields.h
Int32Field
Class representing an int32 tag field.
Definition: int.h:40
vector3
BlamVector3 vector3
Typedef for a vector3 field, used in tag definitions.
Definition: tags.h:317
BlamTagClass::tag_size
int tag_size
The size of the tag's data. Used on loading/writing tag files.
Definition: tagclass.h:53
tagclass.h
Blam::Content::Tags::Classes
Definition: cache_file_resource_data.h:32
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
BlamTagClass
Class representing a tag class.
Definition: tagclass.h:43
BlamTagClass::fields
std::vector< BlamPluginField * > fields
A series of tag fields that store the layout of the tag.
Definition: tagclass.h:51
Bitfield8Field
Class representing a bitfield8 tag field.
Definition: bitfield.h:27