Elaztek Developer Hub
Blamite Game Engine - blam!  00357.06.18.22.0809.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 struct scenario
11 {
12  TAG_ENUM(type,
13  {
14  solo,
15  multiplayer,
16  main_menu,
17  multiplayer_shared,
18  singleplayer_shared
19  });
20 
21  TAG_BLOCK(project_folders,
22  {
23  bitfield8 flags;
24  int folder_id;
25  int parent_folder_id;
26  ascii folder_name;
27  });
28 
29  TAG_BLOCK(primitives,
30  {
31  int folder_id;
32  ascii name;
33  ascii description;
34 
35  TAG_ENUM(type,
36  {
37  cuboid,
38  cylinder
39  });
40 
41  real x;
42  real y;
43  real z;
44  real yaw;
45  real pitch;
46  real roll;
47  real scale_x;
48  real scale_y;
49  real scale_z;
50 
51  real cylinder_radius_0;
52  real cylinder_radius_1;
53  int cylinder_resolution;
54  });
55 };
56 
58 {
60  {
61  public:
63  {
64  class_name_long = "scenario";
65  class_name_short = "scnr";
66  version = 2;
67 
68  revisions = {
69  {1, "haloman30", "Initial implementation."},
70  {2, "haloman30", "Added 'project folders' block."}
71  };
72 
73  tag_size = sizeof(scenario);
74 
75  fields =
76  {
77  new Enum32Field("type", "",
78  {
79  "solo",
80  "multiplayer",
81  "main menu",
82  "multiplayer shared",
83  "singleplayer shared"
84  }),
85  new Int32Field("unused padding", ""),
86  new BlockField(sizeof(scenario::project_folders_entry), "project folders", "Contains information about project folders. Only used within the editor.",
87  {
88  new Bitfield8Field("flags", "List of flags that apply to this folder.",
89  {
90  "has parent folder"
91  }),
92  new Int32Field("folder id", "The ID of this folder."),
93  new Int32Field("parent folder id", "The ID of this folder's parent folder, if applicable."),
94  new AsciiField("folder name", "The display name of the folder.")
95  }),
96  new BlockField(sizeof(scenario::primitives_entry), "primitives", "List of primitive objects contained within the scenario.",
97  {
98  new Int32Field("folder id", "the folder id that this primitive exists within. set to -1 to have no parent"),
99  new AsciiField("name", "custom display name for the object"),
100  new AsciiField("description", "custom description for the object"),
101 
102  new Enum32Field("type", "The type of this primitive.",
103  {
104  "cuboid",
105  "cylinder"
106  }),
107 
108  new CommentField("POSITION", ""),
109  new RealField("x", ""),
110  new RealField("y", ""),
111  new RealField("z", ""),
112 
113  new CommentField("ROTATION", ""),
114  new RealField("yaw", ""),
115  new RealField("pitch", ""),
116  new RealField("roll", ""),
117 
118  new CommentField("SCALE", ""),
119  new RealField("scale x", ""),
120  new RealField("scale y", ""),
121  new RealField("scale z", ""),
122 
123  new CommentField("cylinder specific properties", ""),
124  new RealField("cylinder radius 0", ""),
125  new RealField("cylinder radius 1", ""),
126  new Int32Field("cylinder resolution", ""),
127  })
128  };
129  }
130  };
131 }
ascii
char ascii[128]
Typedef for an ascii field, used in tag data definitions.
Definition: tags.h:291
RealField
Class representing a real tag field.
Definition: real.h:10
Blam::Content::Tags::Classes::ScenarioTagClass::ScenarioTagClass
ScenarioTagClass()
Definition: scenario.h:62
AsciiField
Class representing an ascii tag field.
Definition: ascii.h:12
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:59
scenario
Definition: scenario.h:10
Enum32Field
Definition: enum.h:40
bitfield8
Typedef for a bitfield8 field, used in tag data definitions.
Definition: tags.h:213
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
y
font DisplayOffset y
Definition: README.txt:68
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
real
float real
Typedef for a 'real', aka a float.
Definition: tags.h:293
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:27
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
x
config GlyphExtraSpacing x
Definition: README.txt:30
Blam::Content::Tags::Classes
Definition: bitmap.h:77
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