mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-30 01:48:15 +03:00
De-duplicate reading/writing main game telesave/quicksave
The game has four different functions for the same XML schema: Game::loadtele(), Game::savetele(), Game::loadquick(), and Game::savequick(). This essentially means one XML schema has been copy-pasted three different times. I can at least trim that number down to being copy-pasted only one time by de-duplicating the reading and writing part. So both Game::loadtele() and Game::loadquick() now use Game::readmaingamesave(), and Game::savetele() and Game::savequick() now use Game::writemaingamesave(). This will make it take less work to add XML forwards compatibility (#373).
This commit is contained in:
@@ -5,6 +5,9 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
// Forward decl without including all of <tinyxml2.h>
|
||||
namespace tinyxml2 { class XMLDocument; }
|
||||
|
||||
struct MenuOption
|
||||
{
|
||||
char text[161]; // 40 chars (160 bytes) covers the entire screen, + 1 more for null terminator
|
||||
@@ -152,6 +155,9 @@ public:
|
||||
|
||||
void loadsummary();
|
||||
|
||||
void readmaingamesave(tinyxml2::XMLDocument& doc);
|
||||
std::string writemaingamesave(tinyxml2::XMLDocument& doc);
|
||||
|
||||
void initteleportermode();
|
||||
|
||||
std::string saveFilePath;
|
||||
|
||||
Reference in New Issue
Block a user