V-Gears 0
Free Final Fantasy VII engine.
FieldDecompiler.h
Go to the documentation of this file.
1/*
2 * V-Gears
3 * Copyright (C) 2022 V-Gears Team
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#pragma once
20
21#include <string>
24
29
30 public:
31
35 struct Line{
36
40 std::string name;
41
45 std::vector<float> point_a;
46
50 std::vector<float> point_b;
51 };
52
57
62
67
71 std::string name;
72 };
73
78
82 std::string luaScript;
83
89 std::vector<FieldEntity> entities;
90
94 std::vector<Line> lines;
95 };
96
104 static float ScaleFactor(const std::vector<unsigned char>& script_bytes);
105
123 std::string script_name, const std::vector<unsigned char>& script_bytes,
124 FieldScriptFormatter& formatter, std::string text_after = "", std::string text_before = ""
125 );
126};
Base class for decompilers.
Definition: Decompiler.h:24
Decompiler for field maps.
Definition: FieldDecompiler.h:28
static DecompiledScript Decompile(std::string script_name, const std::vector< unsigned char > &script_bytes, FieldScriptFormatter &formatter, std::string text_after="", std::string text_before="")
Decompiles a field script.
Definition: FieldDecompiler.cpp:32
static float ScaleFactor(const std::vector< unsigned char > &script_bytes)
Retrieves the scale factor of a field.
Definition: FieldDecompiler.cpp:23
Formatter for field scripts.
Definition: FieldScriptFormatter.h:26
DummyFormatter formatter
Definition: ff7_field_disasm_all_opcodes_by_category_test.cpp:1966
unsigned int uint
Definition: scummsys.h:437
The field decompiled script.
Definition: FieldDecompiler.h:77
std::string luaScript
The LUA script for the field.
Definition: FieldDecompiler.h:82
std::vector< Line > lines
Lines in the field.
Definition: FieldDecompiler.h:94
std::vector< FieldEntity > entities
The field entities.
Definition: FieldDecompiler.h:89
An entity.
Definition: FieldDecompiler.h:56
std::string name
Name of the entity.
Definition: FieldDecompiler.h:71
uint char_id
Character identifier of the entity.
Definition: FieldDecompiler.h:61
uint index
Index of the entity in the field.
Definition: FieldDecompiler.h:66
A line.
Definition: FieldDecompiler.h:35
std::string name
Name of the line entity.
Definition: FieldDecompiler.h:40
std::vector< float > point_a
First point of the line.
Definition: FieldDecompiler.h:45
std::vector< float > point_b
Second point of the line.
Definition: FieldDecompiler.h:50