disable FunctionCodeIndex during replays

This commit is contained in:
Martin Michelsen
2022-07-08 00:40:18 -07:00
parent 41d03670d6
commit 39942dc4bd
2 changed files with 13 additions and 7 deletions
+4 -2
View File
@@ -41,7 +41,8 @@ std::shared_ptr<CompiledFunctionCode> compile_function_code(
struct FunctionCodeIndex {
FunctionCodeIndex(const std::string& directory);
FunctionCodeIndex() = default;
explicit FunctionCodeIndex(const std::string& directory);
std::unordered_map<std::string, std::shared_ptr<CompiledFunctionCode>> name_to_function;
std::unordered_map<uint32_t, std::shared_ptr<CompiledFunctionCode>> index_to_function;
@@ -67,7 +68,8 @@ struct DOLFileIndex {
std::vector<std::shared_ptr<DOLFile>> item_id_to_file;
std::map<std::string, std::shared_ptr<DOLFile>> name_to_file;
DOLFileIndex(const std::string& directory);
DOLFileIndex() = default;
explicit DOLFileIndex(const std::string& directory);
std::vector<MenuItem> menu() const;
inline bool empty() const {
+9 -5
View File
@@ -361,11 +361,15 @@ int main(int argc, char** argv) {
config_log.info("Collecting quest metadata");
state->quest_index.reset(new QuestIndex("system/quests"));
config_log.info("Compiling client functions");
state->function_code_index.reset(new FunctionCodeIndex("system/ppc"));
config_log.info("Loading DOL files");
state->dol_file_index.reset(new DOLFileIndex("system/dol"));
if (!replay_log_filename) {
config_log.info("Compiling client functions");
state->function_code_index.reset(new FunctionCodeIndex("system/ppc"));
config_log.info("Loading DOL files");
state->dol_file_index.reset(new DOLFileIndex("system/dol"));
} else {
state->function_code_index.reset(new FunctionCodeIndex());
state->dol_file_index.reset(new DOLFileIndex());
}
config_log.info("Creating menus");
state->create_menus(config_json);