mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03: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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user