1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-01 18:43:33 +02:00

Move LOAD_ARRAY[_RENAME] macros to before loadcustomlevelstats()

In order to be able to use the LOAD_ARRAY() and LOAD_ARRAY_RENAME()
macros in Game::loadcustomlevelstats(), they have to be moved to earlier
in the file.
This commit is contained in:
Misa 2021-02-12 12:13:54 -08:00 committed by Ethan Lee
parent 3fcdc084d0
commit 6dc423e78e

View File

@ -442,6 +442,22 @@ void Game::updatecustomlevelstats(std::string clevel, int cscore)
savecustomlevelstats();
}
#define LOAD_ARRAY_RENAME(ARRAY_NAME, DEST) \
if (pKey == #ARRAY_NAME) \
{ \
std::string TextString = pText; \
if (TextString.length()) \
{ \
std::vector<std::string> values = split(TextString, ','); \
for (int i = 0; i < VVV_min(SDL_arraysize(DEST), values.size()); i++) \
{ \
DEST[i] = help.Int(values[i].c_str()); \
} \
} \
}
#define LOAD_ARRAY(ARRAY_NAME) LOAD_ARRAY_RENAME(ARRAY_NAME, ARRAY_NAME)
void Game::loadcustomlevelstats()
{
//testing
@ -4421,22 +4437,6 @@ void Game::unlocknum( int t )
#endif
}
#define LOAD_ARRAY_RENAME(ARRAY_NAME, DEST) \
if (pKey == #ARRAY_NAME) \
{ \
std::string TextString = pText; \
if (TextString.length()) \
{ \
std::vector<std::string> values = split(TextString, ','); \
for (int i = 0; i < VVV_min(SDL_arraysize(DEST), values.size()); i++) \
{ \
DEST[i] = help.Int(values[i].c_str()); \
} \
} \
}
#define LOAD_ARRAY(ARRAY_NAME) LOAD_ARRAY_RENAME(ARRAY_NAME, ARRAY_NAME)
void Game::loadstats(ScreenSettings* screen_settings)
{
tinyxml2::XMLDocument doc;