diff --git a/src/CRE/auth_3d.cpp b/src/CRE/auth_3d.cpp index f4170512..d6e75697 100644 --- a/src/CRE/auth_3d.cpp +++ b/src/CRE/auth_3d.cpp @@ -2951,7 +2951,8 @@ void auth_3d_data_get_obj_sets_from_category(std::string& name, std::vectorpv_item) { if (i.index <= 0) diff --git a/src/CRE/pv_db.cpp b/src/CRE/pv_db.cpp index dfabb315..8b8dc708 100644 --- a/src/CRE/pv_db.cpp +++ b/src/CRE/pv_db.cpp @@ -267,7 +267,7 @@ const pv_db_pv_motion& pv_db_pv_difficulty::get_motion_or_default(int32_t chara_ void pv_db_pv_difficulty::reset() { difficulty = PV_DIFFICULTY_MAX; - edition = -1; + edition = PV_EDITION_NONE; attribute.reset(); script_file_name.clear(); script_file_name.shrink_to_fit(); @@ -521,7 +521,7 @@ const pv_db_pv_difficulty* pv_db_pv::get_difficulty( return 0; } -const pv_db_pv_difficulty* pv_db_pv::get_difficulty(pv_difficulty difficulty, int32_t edition) const { +const pv_db_pv_difficulty* pv_db_pv::get_difficulty(pv_difficulty difficulty, pv_edition edition) const { const std::vector& diff = this->difficulty[difficulty]; for (const pv_db_pv_difficulty& i : diff) if (i.edition == edition) @@ -1365,7 +1365,7 @@ namespace pv_db { int32_t edition; if (kv.read("edition", edition)) - d.edition = edition; + d.edition = (pv_edition)edition; const char* _attribute_original; if (!kv.read("attribute.original", _attribute_original)) { @@ -2322,7 +2322,7 @@ const pv_db_pv_difficulty* task_pv_db_get_pv_difficulty(int32_t pv_id, } const pv_db_pv_difficulty* task_pv_db_get_pv_difficulty(int32_t pv_id, - pv_difficulty difficulty, int32_t edition) { + pv_difficulty difficulty, pv_edition edition) { const pv_db_pv* pv = task_pv_db_get_pv(pv_id); if (pv) return pv->get_difficulty(difficulty, edition); diff --git a/src/CRE/pv_db.hpp b/src/CRE/pv_db.hpp index 500fd942..cb062a01 100644 --- a/src/CRE/pv_db.hpp +++ b/src/CRE/pv_db.hpp @@ -34,11 +34,6 @@ enum pv_chreff_data_type { PV_CHREFF_DATA_AUTH3D_OBJ = 0x01, }; -enum pv_movie_surface { - PV_MOVIE_SURFACE_BACK = 0x00, - PV_MOVIE_SURFACE_FRONT = 0x01, -}; - enum pv_difficulty { PV_DIFFICULTY_EASY = 0x00, PV_DIFFICULTY_NORMAL = 0x01, @@ -48,6 +43,12 @@ enum pv_difficulty { PV_DIFFICULTY_MAX = 0x05, }; +enum pv_edition { + PV_EDITION_NONE = -1, + PV_EDITION_ORIGINAL = 0x00, + PV_EDITION_EXTRA = 0x01, +}; + enum pv_frame_texture_type { PV_FRAME_TEXTURE_PRE_PP = 0x00, PV_FRAME_TEXTURE_POST_PP = 0x01, @@ -79,6 +80,11 @@ enum pv_level { PV_LV_MAX = 0x15, }; +enum pv_movie_surface { + PV_MOVIE_SURFACE_BACK = 0x00, + PV_MOVIE_SURFACE_FRONT = 0x01, +}; + enum pv_performer_item { PV_PERFORMER_ITEM_ZUJO = 0x00, PV_PERFORMER_ITEM_FACE = 0x01, @@ -271,7 +277,7 @@ struct pv_db_pv_movie { struct pv_db_pv_difficulty { pv_difficulty difficulty; - int32_t edition; + pv_edition edition; pv_db_pv_attribute attribute; std::string script_file_name; pv_level level; @@ -497,7 +503,7 @@ struct pv_db_pv { chara_index chara_index, const pv_db_pv_motion& motion) const; const pv_db_pv_difficulty* get_difficulty( pv_difficulty difficulty, pv_attribute_type attribute_type) const; - const pv_db_pv_difficulty* get_difficulty(pv_difficulty difficulty, int32_t edition) const; + const pv_db_pv_difficulty* get_difficulty(pv_difficulty difficulty, pv_edition edition) const; chara_index get_performer_chara(int32_t performer) const; int32_t get_performer_costume(int32_t performer) const; size_t get_performer_count() const; @@ -563,6 +569,6 @@ extern const pv_db_pv* task_pv_db_get_pv(int32_t pv_id); extern const pv_db_pv_difficulty* task_pv_db_get_pv_difficulty(int32_t pv_id, pv_difficulty difficulty, pv_attribute_type attribute_type); extern const pv_db_pv_difficulty* task_pv_db_get_pv_difficulty(int32_t pv_id, - pv_difficulty difficulty, int32_t edition); + pv_difficulty difficulty, pv_edition edition); extern bool task_pv_db_is_paths_empty(); extern void task_pv_db_free(); diff --git a/src/ReDIVA/data_test/motion_test.cpp b/src/ReDIVA/data_test/motion_test.cpp index e624ce60..97f390e9 100644 --- a/src/ReDIVA/data_test/motion_test.cpp +++ b/src/ReDIVA/data_test/motion_test.cpp @@ -953,7 +953,8 @@ bool DtmMot::ctrl() { switch (state) { case 1: { if (pv_id >= 0) { - const pv_db_pv_difficulty* diff = task_pv_db_get_pv_difficulty(pv_id, PV_DIFFICULTY_HARD, 0); + const pv_db_pv_difficulty* diff = task_pv_db_get_pv_difficulty( + pv_id, PV_DIFFICULTY_HARD, PV_EDITION_ORIGINAL); if (diff) { dsc_file_handler.reset(); dsc_file_handler.read_file(aft_data, diff->script_file_name.c_str()); @@ -1028,7 +1029,8 @@ bool DtmMot::ctrl() { || osage_play_data_manager_check_task_ready()) break; - const pv_db_pv_difficulty* diff = task_pv_db_get_pv_difficulty(pv_id, PV_DIFFICULTY_HARD, 0); + const pv_db_pv_difficulty* diff = task_pv_db_get_pv_difficulty( + pv_id, PV_DIFFICULTY_HARD, PV_EDITION_ORIGINAL); if (pv_id > 0 && diff && dsc_file_handler.get_data()) { pv_data.reset(); pv_data.dsc.parse(dsc_file_handler.get_data(), dsc_file_handler.get_size(), DSC_FT); diff --git a/src/ReDIVA/pv_game/pv_game.cpp b/src/ReDIVA/pv_game/pv_game.cpp index 24195513..4ec1fb36 100644 --- a/src/ReDIVA/pv_game/pv_game.cpp +++ b/src/ReDIVA/pv_game/pv_game.cpp @@ -2402,7 +2402,7 @@ bool pv_game::load() { } case 1: { if (sub_14013C8C0()->sub_1400E7910() < 4) { - pv_id = sub_14013C8C0()->pv; + pv_id = sub_14013C8C0()->pv_id; const pv_db_pv* pv = task_pv_db_get_pv(pv_id); if (pv) data.pv = pv; @@ -2925,7 +2925,7 @@ bool pv_game::load() { sub_14013C8C0()->difficulty, sub_14013C8C0()->edition); if (diff) { data.field_data.reserve(diff->field.data.size()); - light_param_data_storage_data_set_pv_id(sub_14013C8C0()->pv); + light_param_data_storage_data_set_pv_id(sub_14013C8C0()->pv_id); for (const pv_db_pv_field& i : diff->field.data) { pv_game_field field; @@ -5095,7 +5095,7 @@ life_gauge_safety_time(), life_gauge_border(), stage_index(), modules(), items() void pv_game_init_data::reset() { pv_id = 0; difficulty = PV_DIFFICULTY_EASY; - edition = 0; + edition = PV_EDITION_ORIGINAL; score_percentage_clear = 0; life_gauge_safety_time = 0; life_gauge_border = 0; @@ -5111,10 +5111,12 @@ void pv_game_init_data::reset() { i = {}; } -struc_14::struc_14() : edition(), pv(), field_10(), field_11(), field_12(), +struc_14::struc_14() : field_10(), field_11(), field_12(), field_13(), field_14(), field_18(), field_1C(), field_24(), field_25(), field_26() { type = 8; difficulty = PV_DIFFICULTY_NORMAL; + edition = PV_EDITION_ORIGINAL; + pv_id = 0; field_20 = 1.0f; } @@ -5436,7 +5438,7 @@ void TaskPvGame::load(TaskPvGame::Data& data) { #endif sub_14013C8C0()->sub_1400E79E0(data.type); - sub_14013C8C0()->pv = data.init_data.pv_id; + sub_14013C8C0()->pv_id = data.init_data.pv_id; sub_14013C8C0()->difficulty = data.init_data.difficulty; sub_14013C8C0()->edition = data.init_data.edition; @@ -5498,7 +5500,7 @@ PVGameSelector::PVGameSelector() : charas(), modules(), start(), exit() { pv_id = 600; pv = task_pv_db_get_pv(pv_id); difficulty = PV_DIFFICULTY_HARD; - edition = 0; + edition = PV_EDITION_ORIGINAL; success = true; reset_chara(); @@ -5579,7 +5581,7 @@ void PVGameSelector::window() { pv_id = i.id; pv = &i; difficulty = PV_DIFFICULTY_HARD; - edition = 0; + edition = PV_EDITION_ORIGINAL; success = true; reset_chara(); @@ -5607,7 +5609,7 @@ void PVGameSelector::window() { || ImGui::ItemKeyPressed(ImGuiKey_Enter) || (ImGui::IsItemFocused() && difficulty != i)) { difficulty = (pv_difficulty)i; - edition = 0; + edition = PV_EDITION_ORIGINAL; success = true; reset_chara(); @@ -5854,7 +5856,7 @@ void task_pv_game_init_pv() { TaskPvGame::Args args; args.init_data.pv_id = max_def(v2->field_2C.pv_id, 0); args.init_data.difficulty = v2->field_2C.difficulty; - args.init_data.edition = max_def(v2->field_2C.edition, 0); + args.init_data.edition = (pv_edition)max_def(v2->field_2C.edition, PV_EDITION_ORIGINAL); args.init_data.score_percentage_clear = v2->field_2C.score_percentage_clear / 100; args.init_data.life_gauge_safety_time = v2->field_2C.life_gauge_safety_time; args.init_data.life_gauge_border = v2->field_2C.life_gauge_border; @@ -5986,7 +5988,7 @@ void task_pv_game_init_test_pv() { TaskPvGame::Args args; args.init_data.pv_id = 999; args.init_data.difficulty = PV_DIFFICULTY_NORMAL; - args.init_data.edition = 0; + args.init_data.edition = PV_EDITION_ORIGINAL; args.init_data.score_percentage_clear = 50; args.init_data.life_gauge_safety_time = 40; args.init_data.life_gauge_border = 30; diff --git a/src/ReDIVA/pv_game/pv_game.hpp b/src/ReDIVA/pv_game/pv_game.hpp index a8b97135..f4807fbd 100644 --- a/src/ReDIVA/pv_game/pv_game.hpp +++ b/src/ReDIVA/pv_game/pv_game.hpp @@ -479,7 +479,7 @@ struct pv_game { struct pv_game_init_data { int32_t pv_id; pv_difficulty difficulty; - int32_t edition; + pv_edition edition; int32_t score_percentage_clear; int32_t life_gauge_safety_time; int32_t life_gauge_border; @@ -496,8 +496,8 @@ struct pv_game_init_data { struct struc_14 { int32_t type; pv_difficulty difficulty; - int32_t edition; - int32_t pv; + pv_edition edition; + int32_t pv_id; int8_t field_10; int8_t field_11; int8_t field_12; @@ -857,7 +857,7 @@ public: int32_t pv_id; const pv_db_pv* pv; pv_difficulty difficulty; - int32_t edition; + pv_edition edition; bool success; chara_index charas[ROB_CHARA_COUNT]; int32_t modules[ROB_CHARA_COUNT]; diff --git a/src/ReDIVA/pv_game/pv_game_play_data.cpp b/src/ReDIVA/pv_game/pv_game_play_data.cpp index 252349cd..82e2bf87 100644 --- a/src/ReDIVA/pv_game/pv_game_play_data.cpp +++ b/src/ReDIVA/pv_game/pv_game_play_data.cpp @@ -1327,7 +1327,7 @@ void pv_game_play_data::init_aet_level_info() { aet_manager_free_aet_object_reset(&aet_ids[PV_GAME_AET_LEVEL_INFO]); pv_difficulty difficulty = sub_14013C8C0()->difficulty; - int32_t edition = sub_14013C8C0()->edition; + pv_edition edition = sub_14013C8C0()->edition; const pv_db_pv_difficulty* diff = pv_game_get()->data.pv->get_difficulty(difficulty, edition); if (!diff)