Remove SaveSystem::Fixup and UnFixup
MODIFY
generator/csv/setup.csv
generator/csv/setup.csv
@@ -14,7 +14,5 @@ SaveMapInfo,void Fixup(const rpg::MapInfo& map),"lcf/rpg/mapinfo.h"
SaveMapInfo,void UnFixup(const rpg::Map& map),
SaveMapInfo,void UnFixup(const rpg::MapInfo& map),
SaveSystem,void Setup(),
-SaveSystem,void Fixup(),
-SaveSystem,void UnFixup(),
Parameters,void Setup(int final_level),
System,void Init(),

MODIFY
src/generated/lcf/rpg/savesystem.h
src/generated/lcf/rpg/savesystem.h
Binary files a/src/generated/lcf/rpg/savesystem.h and b/src/generated/lcf/rpg/savesystem.h differ

MODIFY
src/lsd_reader.cpp
src/lsd_reader.cpp
@@ -138,7 +138,6 @@ std::unique_ptr<rpg::Save> LSD_Reader::LoadXml(std::istream& filestream) {
rpg::Save LSD_Reader::ClearDefaults(const rpg::Save& save_in, const rpg::MapInfo& map_info, const rpg::Map& map) {
auto save = save_in;
- save.system.UnFixup();
for (auto& actor: save.actors) {
actor.UnFixup();
}

MODIFY
src/rpg_fixup.cpp
src/rpg_fixup.cpp
@@ -79,144 +79,6 @@ void rpg::SaveActor::UnFixup() {
}
}
-void rpg::SaveSystem::Fixup() {
- const rpg::System& system = lcf::Data::system;
-
- switches.reserve(lcf::Data::switches.size());
- variables.reserve(lcf::Data::variables.size());
- if (battle_music.name.empty()) {
- battle_music = system.battle_music;
- }
- if (battle_end_music.name.empty()) {
- battle_end_music = system.battle_end_music;
- }
- if (inn_music.name.empty()) {
- inn_music = system.inn_music;
- }
- if (title_music.name.empty()) {
- title_music = system.title_music;
- }
- if (boat_music.name.empty()) {
- boat_music = system.boat_music;
- }
- if (ship_music.name.empty()) {
- ship_music = system.ship_music;
- }
- if (airship_music.name.empty()) {
- airship_music = system.airship_music;
- }
- if (gameover_music.name.empty()) {
- gameover_music = system.gameover_music;
- }
- if (cursor_se.name.empty()) {
- cursor_se = system.cursor_se;
- }
- if (decision_se.name.empty()) {
- decision_se = system.decision_se;
- }
- if (cancel_se.name.empty()) {
- cancel_se = system.cancel_se;
- }
- if (buzzer_se.name.empty()) {
- buzzer_se = system.buzzer_se;
- }
- if (battle_se.name.empty()) {
- battle_se = system.battle_se;
- }
- if (escape_se.name.empty()) {
- escape_se = system.escape_se;
- }
- if (enemy_attack_se.name.empty()) {
- enemy_attack_se = system.enemy_attack_se;
- }
- if (enemy_damaged_se.name.empty()) {
- enemy_damaged_se = system.enemy_damaged_se;
- }
- if (actor_damaged_se.name.empty()) {
- actor_damaged_se = system.actor_damaged_se;
- }
- if (dodge_se.name.empty()) {
- dodge_se = system.dodge_se;
- }
- if (enemy_death_se.name.empty()) {
- enemy_death_se = system.enemy_death_se;
- }
- if (item_se.name.empty()) {
- item_se = system.item_se;
- }
-}
-
-void rpg::SaveSystem::UnFixup() {
- const rpg::System& system = lcf::Data::system;
-
- auto reset_audio = [](auto& s) {
- s = {};
- s.name.clear();
- };
-
- if (battle_music == system.battle_music) {
- reset_audio(battle_music);
- }
- if (battle_end_music == system.battle_end_music) {
- reset_audio(battle_end_music);
- }
- if (inn_music == system.inn_music) {
- reset_audio(inn_music);
- }
- if (title_music == system.title_music) {
- reset_audio(title_music);
- }
- if (boat_music == system.boat_music) {
- reset_audio(boat_music);
- }
- if (ship_music == system.ship_music) {
- reset_audio(ship_music);
- }
- if (airship_music == system.airship_music) {
- reset_audio(airship_music);
- }
- if (gameover_music == system.gameover_music) {
- reset_audio(gameover_music);
- }
- if (cursor_se == system.cursor_se) {
- reset_audio(cursor_se);
- }
- if (decision_se == system.decision_se) {
- reset_audio(decision_se);
- }
- if (cancel_se == system.cancel_se) {
- reset_audio(cancel_se);
- }
- if (buzzer_se == system.buzzer_se) {
- reset_audio(buzzer_se);
- }
- if (battle_se == system.battle_se) {
- reset_audio(battle_se);
- }
- if (escape_se == system.escape_se) {
- reset_audio(escape_se);
- }
- if (enemy_attack_se == system.enemy_attack_se) {
- reset_audio(enemy_attack_se);
- }
- if (enemy_damaged_se == system.enemy_damaged_se) {
- reset_audio(enemy_damaged_se);
- }
- if (actor_damaged_se == system.actor_damaged_se) {
- reset_audio(actor_damaged_se);
- }
- if (dodge_se == system.dodge_se) {
- reset_audio(dodge_se);
- }
- if (enemy_death_se == system.enemy_death_se) {
- reset_audio(enemy_death_se);
- }
- if (item_se == system.item_se) {
- reset_audio(item_se);
- }
-}
-
-
void rpg::SaveMapInfo::Fixup(const rpg::Map& map) {
FixInt(chipset_id, map.chipset_id);
}

Remove SaveSystem::Fixup and UnFixup