 |
Blamite Game Engine - Guerilla (Library)
00449.01.12.26.0555.blamite
The tag editor for the Blamite Game Engine.
|
Go to the documentation of this file.
8 #ifdef GUERILLA_LIB_EXPORTS
9 #define GUERILLA_LIB_API __declspec(dllexport)
11 #define GUERILLA_LIB_API __declspec(dllimport)
57 BlamTagField* GetField(std::string field_id, BlamTagFieldType field_type);
73 template <
typename T> T*
GetField(std::string field_id, BlamTagFieldType field_type = BlamTagFieldType::Unspecified)
75 if (std::is_same_v<T, BlamTagField_Bitfield>)
return (T*)GetField(field_id, field_type);
76 else if (std::is_same_v<T, BlamTagField_Block>)
return (T*)GetField(field_id, BlamTagFieldType::Block);
77 else if (std::is_same_v<T, BlamTagField_Boolean>)
return (T*)GetField(field_id, BlamTagFieldType::Boolean);
78 else if (std::is_same_v<T, BlamTagField_Color>)
return (T*)GetField(field_id, BlamTagFieldType::Color);
79 else if (std::is_same_v<T, BlamTagField_Comment>)
return (T*)GetField(field_id, BlamTagFieldType::Comment);
80 else if (std::is_same_v<T, BlamTagField_Dataref>)
return (T*)GetField(field_id, BlamTagFieldType::DataReference);
81 else if (std::is_same_v<T, BlamTagField_Enum>)
return (T*)GetField(field_id, field_type);
82 else if (std::is_same_v<T, BlamTagField_Fieldref>)
return (T*)GetField(field_id, BlamTagFieldType::Block);
83 else if (std::is_same_v<T, BlamTagField_Float32>)
return (T*)GetField(field_id, BlamTagFieldType::Block);
84 else if (std::is_same_v<T, BlamTagField_Int>)
return (T*)GetField(field_id, field_type);
85 else if (std::is_same_v<T, BlamTagField_Tagref>)
return (T*)GetField(field_id, BlamTagFieldType::Block);
86 else if (std::is_same_v<T, BlamTagField_Vector>)
return (T*)GetField(field_id, field_type);
101 BlamTagField* GetFieldFromRelativeAddress(std::string address);
119 int c_entry_count = 0;
120 int c_entry_offset = 0;
121 int max_entry_count = -1;
157 bool ParseXMLData(rapidxml::xml_node<>* field_node)
override;
192 bool AddEntry(
int offset = -1);
201 bool DuplicateEntry(
int index);
210 bool DeleteEntry(
int index);
215 void DeleteAllEntries();
243 std::vector<char> GetEntryDataAsBytes();
Class representing a tag field.
Definition: fields.h:272
BlamTagFieldType GetType()
Retrieves the type of this field.
Definition: BlamTagField.cpp:19
BlamPluginField * Copy(BlamPlugin *new_plugin) override
Creates a copy of this plugin field.
Definition: BlamPluginField_Bitfield.cpp:322
virtual BlamTagField * GenerateTagField(BlamTag *tag)
Generates a new tag field from this plugin field.
Definition: BlamPluginField.cpp:41
bool generate_doxygen_comments
Whether or not to include doxygen-compatible comments when generating the tag struct.
Definition: fields.h:29
int entry_size
The size of a each block entry.
Definition: block.h:116
BlamTagBlockEntry * Copy()
Creates a copy of this block entry.
Definition: BlamTagBlockEntry.cpp:48
T * GetField(std::string field_id, BlamTagFieldType field_type=BlamTagFieldType::Unspecified)
Locates a field within the entry with a specified ID and type.
Definition: block.h:73
std::string GenerateCppClassString(std::string line_prefix="") override
Generates a string containing C++ code representing this plugin field.
Definition: BlamPluginField_Bitfield.cpp:111
BlamPluginField * GetField(std::string id)
Locates a field within the entry template with a specified ID.
Definition: BlamPluginField_Block.cpp:25
std::vector< BlamBitfieldBitData > bits
The list of bits within this bitfield.
Definition: bitfield.h:68
BlamPluginField * GetPluginField()
Retrieves the plugin data associated with this field, if available.
Definition: BlamTagField.cpp:29
virtual std::string GenerateXMLString()
Generates a string representing this plugin field.
Definition: BlamPluginField.cpp:61
BlamTag * GetTag()
Retrieves the tag associated with this field.
Definition: BlamTagField.cpp:24
BlamPluginField * ParseField(rapidxml::xml_node<> *field_node)
Attempts to parse an XML node as a plugin field.
Definition: BlamPlugin.cpp:69
std::vector< BlamTagBlockEntry * > entries
The list of entries within this block.
Definition: block.h:175
~BlamPluginField_Block()
Definition: BlamPluginField_Block.cpp:15
std::string GenerateCppStructString(std::string line_prefix="", BlamPluginExportOptions options=BlamPluginExportOptions()) override
Generates a string containing C++ code representing this plugin field.
Definition: BlamPluginField_Block.cpp:100
std::string default_value
The default text value for the field.
Definition: fields.h:113
bool include_comments
Whether or not to include comment fields when generating the tag data structure.
Definition: fields.h:28
std::string field_id
The ID of this field.
Definition: fields.h:284
BlamTagField * GenerateTagField(BlamTag *tag, void *address) override
Generates a new tag field from this plugin field.
Definition: BlamPluginField_Bitfield.cpp:216
std::string input_hint
An additional piece of short text that can be used to suggest valid input for a field.
Definition: fields.h:111
BlamTagFieldType GetType()
Retrieves the type of this field.
Definition: BlamPluginField.cpp:31
std::string GenerateXMLString() override
Generates a string representing this plugin field.
Definition: BlamPluginField_Bitfield.cpp:23
std::string GenerateXMLString(bool keep_unused, bool keep_invalid)
Generates a string with the field ID and value, ready to be written to an XML file.
Definition: BlamTagField_Block.cpp:133
Data structure representing a tag block entry.
Definition: block.h:30
void DeleteAllEntries()
Deletes all block entries from the field.
Definition: BlamTagField_Block.cpp:82
std::vector< char > GetEntryDataAsBytes()
Compiles the entry data into a list of bytes.
Definition: BlamTagField_Block.cpp:211
std::string id
The ID of the bit.
Definition: bitfield.h:30
Class representing a real (float32) tag field.
Definition: float32.h:33
int index
The bit's index.
Definition: bitfield.h:22
Class representing a block plugin field.
Definition: block.h:113
virtual std::string GenerateXMLString()
Generates a string with the field ID and value, ready to be written to an XML file.
Definition: BlamTagField.cpp:9
std::string file_path
The path to the plugin file.
Definition: tags.h:135
bool HasBit(std::string flag_id)
Checks if a given bitfield flag exists.
Definition: BlamTagField_Bitfield.cpp:168
virtual void UpdateOffsetData(int new_offset)
Updates any offsets or lengths for the given field.
Definition: BlamPluginField.cpp:91
Class representing an tagref tag field.
Definition: tagref.h:42
std::string id
The ID of the bit.
Definition: bitfield.h:20
bool DeleteEntry(int index)
Deletes a specific block entry from the field.
Definition: BlamTagField_Block.cpp:63
std::string display_name
The display name of the field.
Definition: fields.h:108
Clas representing a bitfield tag field.
Definition: bitfield.h:65
Class representing a block tag field.
Definition: block.h:172
BlamTagField * GetField(std::string field_id)
Locates a field within the entry with a specified ID.
Definition: BlamTagBlockEntry.cpp:16
Class representing a plugin field.
Definition: fields.h:98
BlamTagField_Bitfield(BlamTag *_tag, BlamTagFieldType _type)
Constructs a new bitfield tag field.
Definition: BlamTagField_Bitfield.cpp:15
Class representing a dataref tag field.
Definition: dataref.h:46
Class representing a Tag.
Definition: tags.h:319
std::vector< char > GetValueAsBytes() override
Retrieves the field value as a list of bytes.
Definition: BlamTagField_Block.cpp:185
BlamPluginField * Copy(BlamPlugin *new_plugin) override
Creates a copy of this plugin field.
Definition: BlamPluginField_Block.cpp:254
BlamPluginField(BlamPlugin *_plugin, BlamTagFieldType _type)
Constructs a new plugin field.
Definition: BlamPluginField.cpp:9
BlamTagField_Block(BlamTag *_tag)
Constructs a new block tag field.
Definition: BlamTagField_Block.cpp:3
BlamTagField * GetFieldFromRelativeAddress(std::string address)
Definition: BlamTagBlockEntry.cpp:71
bool value
The bit's value.
Definition: bitfield.h:31
std::string GenerateCppStructString(std::string line_prefix="", BlamPluginExportOptions options=BlamPluginExportOptions()) override
Generates a string containing C++ code representing this plugin field.
Definition: BlamPluginField_Bitfield.cpp:42
std::string GenerateXMLString() override
Generates a string representing this plugin field.
Definition: BlamPluginField_Block.cpp:84
#define GUERILLA_LIB_API
Definition: block.h:11
virtual BlamPluginField * Copy(BlamPlugin *new_plugin)
Creates a copy of this plugin field.
Definition: BlamPluginField.cpp:229
BlamPluginField_Bitfield(BlamPluginField *base_field)
Constructs a new bitfield plugin field from an existing generic plugin field.
Definition: BlamPluginField_Bitfield.cpp:18
bool visible
Whether or not the field is visible.
Definition: fields.h:107
bool HasPluginField()
Checks whether the field has plugin data available.
Definition: BlamTagField.cpp:34
virtual bool ParseXMLData(rapidxml::xml_node<> *field_node)
Populates data within the plugin field from an XML node.
Definition: BlamPluginField.cpp:106
std::vector< BlamTagField * > fields
The list of fields within the entry.
Definition: block.h:34
Class representing a tag enum field.
Definition: enum.h:80
std::string name
The display name of the bit.
Definition: bitfield.h:21
~BlamTagBlockEntry()
Definition: BlamTagBlockEntry.cpp:6
Class representing a Plugin.
Definition: tags.h:93
std::string field_id
The ID of the field.
Definition: fields.h:110
Class representing an integer tag field.
Definition: int.h:33
BlamTagBlockEntry * CreateNewEntry()
Creates a new block entry based on the plugin's entry template.
Definition: BlamTagField_Block.cpp:99
Class representing a vector tag field.
Definition: vector.h:36
Clas representing a bitfield plugin field.
Definition: bitfield.h:39
void ChangeType(BlamTagFieldType new_type)
Changes the type of a plugin field.
Definition: BlamPluginField.cpp:224
bool ParseXMLData(rapidxml::xml_node<> *field_node) override
Populates data within the plugin field from an XML node.
Definition: BlamPluginField_Bitfield.cpp:145
int c_entry_count
The entry count. Used in tag decompilation.
Definition: block.h:119
std::vector< BlamPluginField * > fields
The list of fields within the tag block.
Definition: block.h:117
bool DuplicateEntry(int index)
Copies a specific block entry within the field.
Definition: BlamTagField_Block.cpp:42
void UpdateOffsetData(int new_offset) override
Updates any offsets or lengths for the given field.
Definition: BlamPluginField_Block.cpp:67
BlamTagField * GenerateTagField(BlamTag *tag, void *address) override
Generates a new tag field from this plugin field.
Definition: BlamPluginField_Block.cpp:231
BlamPluginField * plugin_field
The plugin data associated with this field, if any.
Definition: fields.h:283
bool export_legacy_bitfields
Whether or not to export bitfields using the legacy output method.
Definition: fields.h:43
Class representing a boolean tag field.
Definition: boolean.h:35
BlamTagField(BlamTag *_tag, BlamTagFieldType _type)
Constructs a new tag field.
Definition: BlamTagField.cpp:3
bool SetBit(std::string flag_id, bool value)
Sets the value of a bitfield flag.
Definition: BlamTagField_Bitfield.cpp:194
Data structure containing plugin export options.
Definition: fields.h:26
#define GUERILLA_SET_BITFIELD_BIT(index)
Definition: BlamTagField_Bitfield.cpp:6
std::string description
An optional description of the field.
Definition: fields.h:109
Class representing a fieldref tag field.
Definition: fieldref.h:38
int c_entry_offset
The offset of the entry data. Used in tag decompilation.
Definition: block.h:120
std::vector< BlamBitfieldBitInfo > bits
The list of bits within this bitfield.
Definition: bitfield.h:42
std::string GenerateCppClassString(std::string line_prefix="") override
Generates a string containing C++ code representing this plugin field.
Definition: BlamPluginField_Block.cpp:137
BlamPlugin * GetPlugin()
Retrieves the plugin this field is associated with.
Definition: BlamPluginField.cpp:36
bool require_unused_visible
If enabled, this field will only be visible when "Show Unused Fields" is enabled.
Definition: fields.h:112
int offset
The offset of the field data.
Definition: fields.h:105
std::string name
The name of the entry.
Definition: block.h:33
bool GetBitValue(std::string flag_id)
Retrieves the value of a bitfield flag.
Definition: BlamTagField_Bitfield.cpp:181
#define GUERILLA_BITFIELD_DECOMPILE_SET_BITFIELD_BIT(index)
Definition: BlamPluginField_Bitfield.cpp:9
Data structure containing data for a bitfield bit.
Definition: bitfield.h:28
std::string GenerateXMLString()
Generates a string with the field ID and value, ready to be written to an XML file.
Definition: BlamTagField_Bitfield.cpp:20
virtual std::string GenerateCppClassString(std::string line_prefix="")
Generates a string containing C++ code representing this plugin field.
Definition: BlamPluginField.cpp:101
int length
The length of the field data.
Definition: fields.h:106
std::vector< char > GetValueAsBytes()
Retrieves the field value as a list of bytes.
Definition: BlamTagField_Bitfield.cpp:54
bool AddEntry(int offset=-1)
Adds a new entry to the field.
Definition: BlamTagField_Block.cpp:8
std::string GenerateXMLString() override
Generates a string with the field ID and value, ready to be written to an XML file.
Definition: BlamTagField_Block.cpp:128
virtual std::vector< char > GetValueAsBytes()
Retrieves the field value as a list of bytes.
Definition: BlamTagField.cpp:14
int max_entry_count
The maximum number of entries this block can contain.
Definition: block.h:121
BlamPluginField_Block(BlamPluginField *base_field)
Constructs a new block plugin field from an existing generic plugin field.
Definition: BlamPluginField_Block.cpp:10
bool ParseXMLData(rapidxml::xml_node<> *field_node) override
Populates data within the plugin field from an XML node.
Definition: BlamPluginField_Block.cpp:161
virtual std::string GenerateCppStructString(std::string line_prefix="", BlamPluginExportOptions options=BlamPluginExportOptions())
Generates a string containing C++ code representing this plugin field.
Definition: BlamPluginField.cpp:96
Data structure containing extra data for a bitfield bit.
Definition: bitfield.h:18
Class representing a color tag field.
Definition: color.h:34