mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
Remove map.finalx/y and map.customx/y
These variables basically serve no purpose. map.customx and map.customy are clearly never used. map.finalx and map.finaly, on the other hand, are basically always game.roomx and game.roomy respectively if map.finalmode is on, and if it's off, then they don't matter. Also, there are some weird and redundant variable assignments going on with these; most notably in map.gotoroom(), where rx/ry (local variables) get assigned to finalx/finaly, then finalx/finaly get assigned to game.roomx/game.roomy, then finalx/finaly get assigned to rx/ry. If finalx/finaly made a difference, then there'd be no need to assign finalx/finaly back to rx/ry. So it makes the code clearer to remove these weird bits of code.
This commit is contained in:
@@ -3229,8 +3229,6 @@ void Game::updatestate()
|
||||
map.final_mapcol = 0;
|
||||
map.final_colorframe = 0;
|
||||
map.finalstretch = false;
|
||||
map.finalx = 100;
|
||||
map.finaly = 100;
|
||||
|
||||
graphics.cutscenebarspos = 320;
|
||||
graphics.oldcutscenebarspos = 320;
|
||||
@@ -5289,15 +5287,7 @@ void Game::readmaingamesave(tinyxml2::XMLDocument& doc)
|
||||
map.finalstretch = help.Int(pText);
|
||||
}
|
||||
|
||||
if (pKey == "finalx")
|
||||
{
|
||||
map.finalx = help.Int(pText);
|
||||
}
|
||||
else if (pKey == "finaly")
|
||||
{
|
||||
map.finaly = help.Int(pText);
|
||||
}
|
||||
else if (pKey == "savex")
|
||||
if (pKey == "savex")
|
||||
{
|
||||
savex = help.Int(pText);
|
||||
}
|
||||
@@ -5492,15 +5482,7 @@ void Game::customloadquick(std::string savfile)
|
||||
}
|
||||
|
||||
|
||||
if (pKey == "finalx")
|
||||
{
|
||||
map.finalx = help.Int(pText);
|
||||
}
|
||||
else if (pKey == "finaly")
|
||||
{
|
||||
map.finaly = help.Int(pText);
|
||||
}
|
||||
else if (pKey == "savex")
|
||||
if (pKey == "savex")
|
||||
{
|
||||
savex = help.Int(pText);
|
||||
}
|
||||
@@ -5885,10 +5867,6 @@ std::string Game::writemaingamesave(tinyxml2::XMLDocument& doc)
|
||||
|
||||
//Position
|
||||
|
||||
xml::update_tag(msgs, "finalx", map.finalx);
|
||||
|
||||
xml::update_tag(msgs, "finaly", map.finaly);
|
||||
|
||||
xml::update_tag(msgs, "savex", savex);
|
||||
|
||||
xml::update_tag(msgs, "savey", savey);
|
||||
@@ -6016,10 +5994,6 @@ bool Game::customsavequick(std::string savfile)
|
||||
|
||||
//Position
|
||||
|
||||
xml::update_tag(msgs, "finalx", map.finalx);
|
||||
|
||||
xml::update_tag(msgs, "finaly", map.finaly);
|
||||
|
||||
xml::update_tag(msgs, "savex", savex);
|
||||
|
||||
xml::update_tag(msgs, "savey", savey);
|
||||
|
||||
Reference in New Issue
Block a user