Remove SaveMapInfo::Fixup and LSD_Reader::ClearDefaults
MODIFY
CMakeLists.txt
CMakeLists.txt
@@ -55,7 +55,6 @@ set(LCF_SOURCES
src/reader_struct_impl.h
src/reader_util.cpp
src/reader_xml.cpp
- src/rpg_fixup.cpp
src/rpg_setup.cpp
src/writer_lcf.cpp
src/writer_xml.cpp

MODIFY
Makefile.am
Makefile.am
@@ -63,7 +63,6 @@ liblcf_la_SOURCES = \
src/reader_struct_impl.h \
src/reader_util.cpp \
src/reader_xml.cpp \
- src/rpg_fixup.cpp \
src/rpg_setup.cpp \
src/writer_lcf.cpp \
src/writer_xml.cpp \

MODIFY
generator/csv/functions.csv
generator/csv/functions.csv
@@ -3,8 +3,4 @@ Actor,void Setup(),
Save,void Setup(),
SaveMapInfo,void Setup(),
SaveMapInfo,void Setup(const rpg::Map& map),"""lcf/rpg/map.h"""
-SaveMapInfo,void Fixup(const rpg::Map& map),
-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),
Parameters,void Setup(int final_level),

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

MODIFY
src/lcf/lsd/reader.h
src/lcf/lsd/reader.h
@@ -43,11 +43,6 @@ namespace LSD_Reader {
*/
void PrepareSave(rpg::Save& save, int32_t version = 0);
- /**
- * Returns a copy of the save data with defaults cleared.
- */
- rpg::Save ClearDefaults(const rpg::Save& save, const rpg::MapInfo& map_info, const rpg::Map& map);
-
/**
* Loads Savegame.
*/

MODIFY
src/lsd_reader.cpp
src/lsd_reader.cpp
@@ -135,13 +135,4 @@ std::unique_ptr<rpg::Save> LSD_Reader::LoadXml(std::istream& filestream) {
return std::unique_ptr<rpg::Save>(save);
}
-rpg::Save LSD_Reader::ClearDefaults(const rpg::Save& save_in, const rpg::MapInfo& map_info, const rpg::Map& map) {
- auto save = save_in;
-
- save.map_info.UnFixup(map);
- save.map_info.UnFixup(map_info);
-
- return save;
-}
-
} //namespace lcf

DELETE
src/rpg_fixup.cpp
-/*
- * This file is part of liblcf. Copyright (c) 2020 liblcf authors.
- * https://github.com/EasyRPG/liblcf - https://easyrpg.org
- *
- * liblcf is Free/Libre Open Source Software, released under the MIT License.
- * For the full copyright and license information, please view the COPYING
- * file that was distributed with this source code.
- */
-
-#include "lcf/config.h"
-#include "lcf/rpg/actor.h"
-#include "lcf/rpg/mapinfo.h"
-#include "lcf/rpg/system.h"
-#include "lcf/rpg/save.h"
-#include "lcf/rpg/savemapinfo.h"
-#include "lcf/data.h"
-
-template <typename T, typename U>
-static void FixInt(T& val, U def) {
- if (val < 0) {
- val = def;
- }
-};
-
-template <typename T, typename U>
-void UnFixInt(T& val, U def) {
- if (val == def) {
- val = -1;
- }
-};
-
-namespace lcf {
-
-void rpg::SaveMapInfo::Fixup(const rpg::Map& map) {
- FixInt(chipset_id, map.chipset_id);
-}
-
-void rpg::SaveMapInfo::Fixup(const rpg::MapInfo& map) {
- FixInt(encounter_rate, map.encounter_steps);
-}
-
-void rpg::SaveMapInfo::UnFixup(const rpg::Map& map) {
- UnFixInt(chipset_id, map.chipset_id);
-}
-
-void rpg::SaveMapInfo::UnFixup(const rpg::MapInfo& map) {
- UnFixInt(encounter_rate, map.encounter_steps);
-}
-
-} // namespace lcf

Remove SaveMapInfo::Fixup and LSD_Reader::ClearDefaults