59 Entity(
const std::string& name,
size_t index);
99 void AddFunction(
const std::string& name,
size_t index);
111 void MarkAsLine(
bool line, std::vector<float> point_a, std::vector<float> point_b);
211 InstVec &insts,
const std::vector<unsigned char>& raw_script_data
230 const InstVec& insts, std::ostream &output
262 std::vector<FieldDecompiler::FieldEntity>
GetEntityList()
const;
269 std::vector<FieldDecompiler::Line>
GetLineList()
const;
287 const std::string& entity_name,
size_t entity_index,
288 const std::string& func_name,
size_t func_index
303 size_t entity_index,
bool line, std::vector<float> point_a, std::vector<float> point_b
boost::adjacency_list< boost::setS, boost::listS, boost::bidirectionalS, GraphProperty, EdgeProperty > Graph
Definition: Graph.h:169
std::vector< InstPtr > InstVec
Type representing a vector of InstPtrs.
Definition: Instruction.h:382
Base class for engines.
Definition: Engine.h:34
Any entity in a field.
Definition: Entity.h:101
Represents an entity.
Definition: FieldEngine.h:41
size_t index_
Entity index.
Definition: FieldEngine.h:154
void AddFunction(const std::string &name, size_t index)
Adds a function to the engine.
Definition: FieldEngine.cpp:68
std::string FunctionByIndex(size_t index) const
Retrieves a function.
Definition: FieldEngine.cpp:62
std::string GetName() const
Retrieves the entity name.
Definition: FieldEngine.cpp:58
std::vector< float > point_a_
The first point of a line entity.
Definition: FieldEngine.h:171
size_t GetIndex() const
Retrieves the entity index.
Definition: FieldEngine.cpp:60
bool is_line_
Indicates if the entity is a line.
Definition: FieldEngine.h:164
std::map< size_t, std::string > functions_
Entity function (script) list.
Definition: FieldEngine.h:159
bool IsLine()
Checks if the entity is a line.
Definition: FieldEngine.cpp:97
std::vector< float > point_b_
The second point of a line entity.
Definition: FieldEngine.h:178
std::vector< float > GetLinePointB()
Retrieves the second point of the line entity.
Definition: FieldEngine.cpp:101
Entity()=default
Entity constructor.
std::vector< float > GetLinePointA()
Retrieves the first point of the line entity.
Definition: FieldEngine.cpp:99
void MarkAsLine(bool line, std::vector< float > point_a, std::vector< float > point_b)
Marks the entity as a line.
Definition: FieldEngine.cpp:72
std::string name_
Entity name.
Definition: FieldEngine.h:149
Represents the FF7 Field engine.
Definition: FieldEngine.h:31
FieldScriptFormatter & formatter_
The script formatter.
Definition: FieldEngine.h:377
float scale_factor_
The map scale factor.
Definition: FieldEngine.h:387
const Entity & EntityByIndex(size_t index) const
Retrieves an entity.
Definition: FieldEngine.cpp:230
std::vector< FieldDecompiler::FieldEntity > GetEntityList() const
Retrieves all non-line entities in the map.
Definition: FieldEngine.cpp:163
void AddEntityFunction(const std::string &entity_name, size_t entity_index, const std::string &func_name, size_t func_index)
Adds a function to an entity.
Definition: FieldEngine.cpp:202
float GetScaleFactor() const
Retrieves the scale factor for the map.
Definition: FieldEngine.cpp:236
std::map< size_t, Entity > GetEntityIndexMap() const
Retrieves all entities in the map.
Definition: FieldEngine.h:276
FieldEngine & operator=(const FieldEngine &engine)=delete
Copy constructor, disabled.
void RemoveTrailingInfiniteLoops(InstVec &insts, Graph graph)
Removes trailing infinite loops.
Definition: FieldEngine.cpp:261
void MarkEntityAsLine(size_t entity_index, bool line, std::vector< float > point_a, std::vector< float > point_b)
Marks an entity as a line.
Definition: FieldEngine.cpp:215
virtual void PostCFG(InstVec &insts, Graph graph) override
Post-processing actions to apply to the scripts.
Definition: FieldEngine.cpp:130
std::map< size_t, Entity > entity_index_map_
The entity index map for the field.
Definition: FieldEngine.h:382
std::vector< FieldDecompiler::Line > GetLineList() const
Retrieves all line entities in the map.
Definition: FieldEngine.cpp:188
virtual bool UsePureGrouping() const override
Indicates if instructions are purely grouped.
Definition: FieldEngine.cpp:144
FieldEngine(const FieldEngine &engine)=delete
Copy constructor, disabled.
std::string script_name_
The script name.
Definition: FieldEngine.h:392
void RemoveExtraneousReturnStatements(InstVec &insts, Graph graph)
Removes extraneous return statements.
Definition: FieldEngine.cpp:240
bool EntityIsLine(size_t entity_index)
Checks if an entity has been marked as a line.
Definition: FieldEngine.cpp:224
std::map< std::string, int > GetEntities() const
Retrieves all entities in the map.
Definition: FieldEngine.cpp:146
const std::string & GetScriptName() const
Retrieves the script name.
Definition: FieldEngine.cpp:238
virtual std::unique_ptr< CodeGenerator > GetCodeGenerator(const InstVec &insts, std::ostream &output) override
Retrieves the code generator.
Definition: FieldEngine.cpp:121
virtual std::unique_ptr< Disassembler > GetDisassembler(InstVec &insts, const std::vector< unsigned char > &raw_script_data) override
Retrieves the disasembler.
Definition: FieldEngine.cpp:107
void MarkInfiniteLoopGroups(InstVec &insts, Graph graph)
Tries to detect scripts with trailing infinite loops.
Definition: FieldEngine.cpp:282
FieldEngine(FieldScriptFormatter &formatter, std::string script_name)
Constructor.
Definition: FieldEngine.cpp:103
DummyFormatter formatter
Definition: ff7_field_disasm_all_opcodes_by_category_test.cpp:1966