mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-03-08 23:05:13 +01: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:
parent
3fcdc084d0
commit
6dc423e78e
1 changed files with 16 additions and 16 deletions
|
@ -442,6 +442,22 @@ void Game::updatecustomlevelstats(std::string clevel, int cscore)
|
||||||
savecustomlevelstats();
|
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()
|
void Game::loadcustomlevelstats()
|
||||||
{
|
{
|
||||||
//testing
|
//testing
|
||||||
|
@ -4421,22 +4437,6 @@ void Game::unlocknum( int t )
|
||||||
#endif
|
#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)
|
void Game::loadstats(ScreenSettings* screen_settings)
|
||||||
{
|
{
|
||||||
tinyxml2::XMLDocument doc;
|
tinyxml2::XMLDocument doc;
|
||||||
|
|
Loading…
Add table
Reference in a new issue