[decompiler] jak 2 cutscene file support (#2390)

fixes #2332 

also fills out the japanese character set
This commit is contained in:
ManDude
2023-03-22 21:31:13 +00:00
committed by GitHub
parent b18198e655
commit 217a979048
26 changed files with 1285 additions and 64 deletions
+18 -3
View File
@@ -47,6 +47,7 @@ struct ObjectFileData {
std::string name_in_dgo;
std::string name_from_map;
std::string to_unique_name() const;
std::string base_name_from_chunk;
uint32_t reference_count = 0; // number of times its used.
std::string full_output;
@@ -246,6 +247,7 @@ class ObjectFileDB {
std::string process_tpages(TextureDB& tex_db, const fs::path& output_path);
std::string process_game_count_file();
std::string process_game_text_files(const Config& cfg);
std::string process_all_spool_subtitles(const Config& cfg, const fs::path& image_out);
const ObjectFileData& lookup_record(const ObjectFileRecord& rec) const;
DecompilerTypeSystem dts;
@@ -255,7 +257,6 @@ class ObjectFileDB {
const Config& config,
TypeSpec* result);
public:
void load_map_file(const std::string& map_data);
void get_objs_from_dgo(const fs::path& filename, const Config& config);
void add_obj_from_dgo(const std::string& obj_name,
@@ -263,7 +264,8 @@ class ObjectFileDB {
const uint8_t* obj_data,
uint32_t obj_size,
const std::string& dgo_name,
const Config& config);
const Config& config,
const std::string& cut_name = "");
/*!
* Apply f to all ObjectFileData's. Does it in the right order.
@@ -273,7 +275,20 @@ class ObjectFileDB {
ASSERT(obj_files_by_name.size() == obj_file_order.size());
for (const auto& name : obj_file_order) {
for (auto& obj : obj_files_by_name.at(name)) {
// lg::info("{}...", name);
f(obj);
}
}
}
/*!
* Apply f to all ObjectFileData's in a specific DGO. Does it in the right order.
*/
template <typename Func>
void for_each_obj_in_dgo(const std::string& dgo_name, Func f) {
ASSERT(obj_files_by_name.size() == obj_file_order.size());
const auto& dgo_objs = obj_files_by_dgo.at(dgo_name);
for (const auto& rec : dgo_objs) {
for (auto& obj : obj_files_by_name.at(rec.name)) {
f(obj);
}
}