From 6dc423e78ef7ebfc2030d3c352549891a2e5c293 Mon Sep 17 00:00:00 2001 From: Misa Date: Fri, 12 Feb 2021 12:13:54 -0800 Subject: [PATCH] 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. --- desktop_version/src/Game.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index 6b2287dc..4712bf4c 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -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 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 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;