1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 01:29:43 +01:00

Apply PR review changes

Co-authored-by: Misa Elizabeth Kai <infoteddy@infoteddy.info>
This commit is contained in:
mothbeanie 2024-11-03 14:16:57 -08:00 committed by Misa Elizabeth Kai
parent dedf941b25
commit 1fb0afb99d
3 changed files with 2 additions and 17 deletions

View file

@ -5962,7 +5962,6 @@ void Game::customloadquick(const std::string& savfile)
{ {
map.currentregion = help.Int(pText); map.currentregion = help.Int(pText);
} }
#if !defined(NO_CUSTOM_LEVELS)
else if (SDL_strcmp(pKey, "regions") == 0) else if (SDL_strcmp(pKey, "regions") == 0)
{ {
tinyxml2::XMLElement* pElem2; tinyxml2::XMLElement* pElem2;
@ -6001,7 +6000,6 @@ void Game::customloadquick(const std::string& savfile)
map.setregion(thisid, thisrx, thisry, thisrx2, thisry2); map.setregion(thisid, thisrx, thisry, thisrx2, thisry2);
} }
} }
#endif
} }
} }

View file

@ -501,10 +501,7 @@ void GraphicsResources::destroy(void)
for (size_t i = 0; i < SDL_arraysize(graphics.customminimaps); i++) 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 #undef CLEAR

View file

@ -2301,7 +2301,6 @@ MapRenderData mapclass::get_render_data(void)
void mapclass::setregion(int id, int rx, int ry, int rx2, int ry2) void mapclass::setregion(int id, int rx, int ry, int rx2, int ry2)
{ {
#if !defined(NO_CUSTOM_LEVELS)
if (INBOUNDS_ARR(id, region)) if (INBOUNDS_ARR(id, region))
{ {
region[id].isvalid = true; 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].rx2 = SDL_clamp(rx2, 0, cl.mapwidth - 1);
region[id].ry2 = SDL_clamp(ry2, 0, cl.mapheight - 1); region[id].ry2 = SDL_clamp(ry2, 0, cl.mapheight - 1);
} }
#endif
} }
void mapclass::removeregion(int id) void mapclass::removeregion(int id)
{ {
#if !defined(NO_CUSTOM_LEVELS)
if (INBOUNDS_ARR(id, region)) if (INBOUNDS_ARR(id, region))
{ {
region[id].isvalid = false; SDL_zero(region[id]);
region[id].rx = 0;
region[id].ry = 0;
region[id].rx2 = 0;
region[id].ry2 = 0;
} }
#endif
} }
void mapclass::changeregion(int id) void mapclass::changeregion(int id)
{ {
#if !defined(NO_CUSTOM_LEVELS)
if (INBOUNDS_ARR(id, region)) if (INBOUNDS_ARR(id, region))
{ {
currentregion = id; currentregion = id;
cl.generatecustomminimap(); cl.generatecustomminimap();
} }
#endif
} }