From 1fb0afb99de43a06c746f78f6f78cd925847347c Mon Sep 17 00:00:00 2001 From: mothbeanie Date: Sun, 3 Nov 2024 14:16:57 -0800 Subject: [PATCH] Apply PR review changes Co-authored-by: Misa Elizabeth Kai --- desktop_version/src/Game.cpp | 2 -- desktop_version/src/GraphicsResources.cpp | 5 +---- desktop_version/src/Map.cpp | 12 +----------- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index 3f0d3ad0..0a587d21 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -5962,7 +5962,6 @@ void Game::customloadquick(const std::string& savfile) { map.currentregion = help.Int(pText); } -#if !defined(NO_CUSTOM_LEVELS) else if (SDL_strcmp(pKey, "regions") == 0) { tinyxml2::XMLElement* pElem2; @@ -6001,7 +6000,6 @@ void Game::customloadquick(const std::string& savfile) map.setregion(thisid, thisrx, thisry, thisrx2, thisry2); } } -#endif } } diff --git a/desktop_version/src/GraphicsResources.cpp b/desktop_version/src/GraphicsResources.cpp index 7e25545f..279ee8b1 100644 --- a/desktop_version/src/GraphicsResources.cpp +++ b/desktop_version/src/GraphicsResources.cpp @@ -501,10 +501,7 @@ void GraphicsResources::destroy(void) for (size_t i = 0; i < SDL_arraysize(graphics.customminimaps); i++) { - if (graphics.customminimaps[i] != NULL) - { - CLEAR(graphics.customminimaps[i]); - } + CLEAR(graphics.customminimaps[i]); } #undef CLEAR diff --git a/desktop_version/src/Map.cpp b/desktop_version/src/Map.cpp index ac5a19e7..3c28a070 100644 --- a/desktop_version/src/Map.cpp +++ b/desktop_version/src/Map.cpp @@ -2301,7 +2301,6 @@ MapRenderData mapclass::get_render_data(void) void mapclass::setregion(int id, int rx, int ry, int rx2, int ry2) { -#if !defined(NO_CUSTOM_LEVELS) if (INBOUNDS_ARR(id, region)) { region[id].isvalid = true; @@ -2310,30 +2309,21 @@ void mapclass::setregion(int id, int rx, int ry, int rx2, int ry2) region[id].rx2 = SDL_clamp(rx2, 0, cl.mapwidth - 1); region[id].ry2 = SDL_clamp(ry2, 0, cl.mapheight - 1); } -#endif } void mapclass::removeregion(int id) { -#if !defined(NO_CUSTOM_LEVELS) if (INBOUNDS_ARR(id, region)) { - region[id].isvalid = false; - region[id].rx = 0; - region[id].ry = 0; - region[id].rx2 = 0; - region[id].ry2 = 0; + SDL_zero(region[id]); } -#endif } void mapclass::changeregion(int id) { -#if !defined(NO_CUSTOM_LEVELS) if (INBOUNDS_ARR(id, region)) { currentregion = id; cl.generatecustomminimap(); } -#endif } \ No newline at end of file