#include <FieldDataInstaller.h>
◆ FieldDataInstaller()
FieldDataInstaller::FieldDataInstaller |
( |
const std::string |
input_dir, |
|
|
const std::string |
output_dir |
|
) |
| |
Installer constructor.
- Parameters
-
[in] | input_dir | Path to the directory containing the original data to parse. |
[in] | output_dir | Path to the directory to write generated data to. |
◆ ~FieldDataInstaller()
FieldDataInstaller::~FieldDataInstaller |
( |
| ) |
|
◆ CollectFieldScaleFactors()
Collects the scale factor from a map.
- Parameters
-
[in] | field | The field to collect from. |
[out] | scale_factors | The scale factor for the map will be set here, in the appropiate map entry. |
[in] | field_id_to_name_lookup | Lookup table to relate field IDs and names. |
◆ CollectSpawnAndScaleFactors()
void FieldDataInstaller::CollectSpawnAndScaleFactors |
( |
int |
field_index | ) |
|
Reads spawn points and scale factors from flevel files.
Installation step 2.
- Parameters
-
[in] | field_index | Index of the field to collect from. Must be less than the value returned by { |
- See also
- CollectSpawnAndScaleFactorsInit}.
◆ CollectSpawnAndScaleFactorsInit()
int FieldDataInstaller::CollectSpawnAndScaleFactorsInit |
( |
Ogre::ResourceGroupManager * |
res_mgr | ) |
|
Initializer for {.
- See also
- CollectionFieldSpawnAndScaleFactors}.
Installation step 1.
- Parameters
-
[in] | res_mgr | The application resource manager. |
- Returns
- The total number of level files to process.
◆ CollectSpawnPoints()
Collects the spawn point from a field.
If a spawn is new, a new record will be added to the spawn point database. If it was already there, update the record to add the origin.
- Parameters
-
[in] | field | The field to collect from. |
[in] | field_id_to_name_lookup | Lookup table to relate field IDs and names. |
[out] | spawn_points | Spawn points will be added sequentially to the end of this map. |
◆ Convert()
void FieldDataInstaller::Convert |
( |
int |
field_index | ) |
|
Converts FFVII PC fields to V-Gears format.
- Parameters
-
[in] | field_index | Index of the field to collect from. Must be less than the value returned by { |
- See also
- CollectSpawnAndScaleFactorsInit}.
◆ ConvertModels()
void FieldDataInstaller::ConvertModels |
( |
std::string |
model_name | ) |
|
Converts the field models to V-Gears format.
Installation step 7 and final.
- Parameters
-
[in] | model_name | Name of the model to convert. |
◆ ConvertModelsInit()
std::vector< std::string > FieldDataInstaller::ConvertModelsInit |
( |
| ) |
|
Initializer for {.
- See also
- ConvertFieldModelsIteration}.
Installation step 6.
- Returns
- List of names of models to convert.
◆ CreateDir()
void FieldDataInstaller::CreateDir |
( |
const std::string & |
dir | ) |
|
|
private |
Creates a directory in the outputh path.
- Parameters
-
[in] | dir | Path of the directory to create, relative to the output path.. |
- Exceptions
-
std::runtime_error | If the directory can't be created. |
◆ CreateGateWayScript()
std::string FieldDataInstaller::CreateGateWayScript |
( |
const std::string & |
gateway_entity_name, |
|
|
const std::string & |
target_map_name, |
|
|
const std::string & |
source_spawn_point_name |
|
) |
| |
|
staticprivate |
Creates a gateway script.
- Parameters
-
[in] | gateway_entity_name | Name of the gateway entity. |
[in] | target_map_name | Name of the target map. |
[in] | source_spawn_point_name | The spawn point name. |
- Returns
- Gateway LUA script.
◆ ExportMesh()
void FieldDataInstaller::ExportMesh |
( |
const std::string |
outdir, |
|
|
const Ogre::MeshPtr & |
mesh |
|
) |
| |
|
private |
Exports a mesh to a file.
The file will have the mesh name.
- Parameters
-
[in] | outdir | Path to the directory where the file will be saved. |
[in] | mesh | The mesh to export. |
◆ ExtractMusicTrackIds()
Reads the music track IDs from a specific field.
- Parameters
-
[in] | field | The field to extract tracks from. |
- Returns
- The list of tracks. It can be empty.
◆ GetFieldId()
size_t FieldDataInstaller::GetFieldId |
( |
const std::string & |
name, |
|
|
const std::vector< std::string > & |
field_id_to_name_lookup |
|
) |
| |
|
staticprivate |
Retrieves a field ID from a name.
- Parameters
-
[in] | name | The name of the field. |
[in] | field_id_to_name_lookup | Lookup table to use. |
- Returns
- The field ID for the specified name.
- Exceptions
-
std::runtime_error | If there is no ID for the field name. |
◆ GetFieldScaleFactor()
float FieldDataInstaller::GetFieldScaleFactor |
( |
size_t |
field_id | ) |
|
|
private |
Retrieves a field scale factor.
- Parameters
-
[in] | field_id | The id (name) of the field. |
- Returns
- The scale factor for the map.
- Exceptions
-
std::runtime_error | If there is no ID for the field name. |
◆ IsAFieldFile()
bool FieldDataInstaller::IsAFieldFile |
( |
const Ogre::String & |
resource_name | ) |
|
|
staticprivate |
Checks if a file is a field file.
To verify it, it just checks that the extension is not '.tex', '.tut' or '.siz' and that the name is not 'maplist'.
- Parameters
-
[in] | resource_name | The name of the file to test. |
- Returns
- False if the file is surely not a field file, true otherwise.
◆ IsTestField()
bool FieldDataInstaller::IsTestField |
( |
const Ogre::String & |
resource_name | ) |
|
|
staticprivate |
Checks if a map is a test field.
It uses a hardcoded list of maps that are known to be test maps. Unused maps are considered to be test maps.
- Parameters
-
[in] | resource_name | The name of the map file to test. |
- Returns
- True if the map is a test map, false otherwise.
◆ PcFieldToVGearsField()
Converts a FFVII PC field to a V-Gears field.
- Parameters
-
[in] | field | The field map to convert. |
◆ WillCrash()
bool FieldDataInstaller::WillCrash |
( |
const Ogre::String & |
resource_name | ) |
|
|
staticprivate |
Checks if a map cause fatal crash bugs.
It uses a hardcoded list of maps that are known to cause errors. This can be removed when whatever is causing the crash(s) is fixed.
NOTE: Even so, conversion of all models will fail with a bone index out of bounds.
- Parameters
-
[in] | resource_name | The name of the map file to test. |
- Returns
- True if the map will crash, false otherwise.
◆ Write()
void FieldDataInstaller::Write |
( |
int |
field_index | ) |
|
Saves the game maps to XML files.
Installation step 4.
- Parameters
-
[in] | field_index | Index of the field to collect from. Must be less than the value returned by { |
- See also
- WriteInit}.
◆ WriteEnd()
void FieldDataInstaller::WriteEnd |
( |
| ) |
|
Cleans up after {.
- See also
- WriteMapsXmlIteration}.
Installation step 5.
◆ WriteInit()
int FieldDataInstaller::WriteInit |
( |
| ) |
|
Initializer for {.
- See also
- WriteMapsXmlIteration}.
Installation step 3.
- Returns
- The number of converted maps that need to be written.
◆ conversion_step_
size_t FieldDataInstaller::conversion_step_ |
|
private |
Helper variable to indicate internal progress of installation steps.
◆ converted_map_list_
MapList FieldDataInstaller::converted_map_list_ |
|
private |
◆ converted_map_list_iterator_
MapList::iterator FieldDataInstaller::converted_map_list_iterator_ |
|
private |
Iterator for {.
- See also
- converted_map_list}.
◆ doc_
std::unique_ptr<TiXmlDocument> FieldDataInstaller::doc_ |
|
private |
An XML document.
Internally used during some installation steps.
◆ element_
std::unique_ptr<TiXmlElement> FieldDataInstaller::element_ |
|
private |
An XML element.
Internally used during some installation steps.
◆ field_
Field currently being processed.
◆ FIELD_MAPS_DIR
std::string FieldDataInstaller::FIELD_MAPS_DIR |
|
staticprivate |
Path to the field maps directory.
◆ field_model_file_list_
Ogre::StringVectorPtr FieldDataInstaller::field_model_file_list_ |
|
private |
◆ FIELD_MODELS_DIR
std::string FieldDataInstaller::FIELD_MODELS_DIR |
|
staticprivate |
Path to the field models directory.
◆ field_models_lgp_
std::unique_ptr<ScopedLgp> FieldDataInstaller::field_models_lgp_ |
|
private |
LGP archive with field model data.
◆ field_text_writer_
◆ fields_lgp_
std::unique_ptr<ScopedLgp> FieldDataInstaller::fields_lgp_ |
|
private |
LGP archive with field data.
◆ flevel_file_list_
Ogre::StringVectorPtr FieldDataInstaller::flevel_file_list_ |
|
private |
◆ INACTIVE_GATEWAY_ID
int FieldDataInstaller::INACTIVE_GATEWAY_ID |
|
staticprivate |
Gateways to this map ID are considered to be inactive.
◆ input_dir_
std::string FieldDataInstaller::input_dir_ |
|
private |
The path to the directory from which to read the PC game data.
◆ iterator_counter_
size_t FieldDataInstaller::iterator_counter_ |
|
private |
◆ LINE_SCALE_FACTOR
float FieldDataInstaller::LINE_SCALE_FACTOR |
|
staticprivate |
The scale factor for line point coordinates.
When a LINE opcode is found in the game scripts, the line points X and Y coordinates must be scaled down by this factor.
◆ map_list_
std::vector<std::string> FieldDataInstaller::map_list_ |
|
private |
◆ materials_
std::vector<std::string> FieldDataInstaller::materials_ |
|
private |
◆ model_animation_map_iterator_
ModelAnimationMap::iterator FieldDataInstaller::model_animation_map_iterator_ |
|
private |
◆ output_dir_
std::string FieldDataInstaller::output_dir_ |
|
private |
The path to the directory where to save the V-Gears data.
◆ progress_step_num_elements_
size_t FieldDataInstaller::progress_step_num_elements_ |
|
private |
Helper variable to indicate internal progress of installation steps.
◆ scale_factors_
Map of th collected scale factors.
◆ set_progress_label_
std::function<void(std::string)> FieldDataInstaller::set_progress_label_ |
|
private |
Function used to print set the current installation progress text.
◆ spawn_points_
Map of the collected spawn points.
◆ textures_lgp_
std::unique_ptr<ScopedLgp> FieldDataInstaller::textures_lgp_ |
|
private |
LGP archive with texture data.
◆ used_models_and_anims_
ModelsAndAnimationsUsedByConvertedFields.
◆ write_output_line_
std::function<void(std::string)> FieldDataInstaller::write_output_line_ |
|
private |
Function used to print text to the log output, line by line.
The documentation for this class was generated from the following files: