diff --git a/src/Game.cpp b/src/Game.cpp index 6c2235a5..521791c4 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -2093,7 +2093,7 @@ inline void Game::drawMapDebugAreas(int left, int top, int right, int bot, int s } } -inline void Game::drawMapBuilding(int x, int y, int gid, int viewportX, int viewportY, int localTeam, Uint32 drawOptions) +inline void Game::drawMapBuilding(int x, int y, int gid, int localTeam, Uint32 drawOptions) { Building *building = teams[Building::GIDtoTeam(gid)]->myBuildings[Building::GIDtoID(gid)]; assert(building); @@ -2292,9 +2292,11 @@ inline void Game::drawMapGroundBuildings(int left, int top, int right, int bot, || (building->seenByMask & visibleTeams) || map.isFOWDiscovered(x+viewportX, y+viewportY, visibleTeams)) { - int px,py; + int px, py; map.mapCaseToDisplayable(building->posXLocal, building->posYLocal, &px, &py, viewportX, viewportY); - drawMapBuilding(px, py, gid, viewportX, viewportY, localTeam, drawOptions); + for (;py >> 5 < bot; py += map.h * 32) + for (;px >> 5 < right; px += map.w * 32) + drawMapBuilding(px, py, gid, localTeam, drawOptions); drawnBuildings.insert(building); } } diff --git a/src/Game.h b/src/Game.h index 443b7c2b..bdbdacf8 100644 --- a/src/Game.h +++ b/src/Game.h @@ -205,7 +205,7 @@ class Game ///draws debug information. switched in the code. inline void drawMapDebugAreas(int left, int top, int right, int bot, int sw, int sh, int viewportX, int viewportY, int localTeam, Uint32 drawOptions); inline void drawMapGroundBuildings(int left, int top, int right, int bot, int sw, int sh, int viewportX, int viewportY, int localTeam, Uint32 drawOptions, std::set *visibleBuildings); - inline void drawMapBuilding(int x, int y, int gid, int viewportX, int viewportY, int localTeam, Uint32 drawOptions); + inline void drawMapBuilding(int x, int y, int gid, int localTeam, Uint32 drawOptions); inline void drawMapAreas(int left, int top, int right, int bot, int sw, int sh, int viewportX, int viewportY, int localTeam, Uint32 drawOptions); inline void drawMapArea(int left, int top, int right, int bot, int sw, int sh, int viewportX, int viewportY, int localTeam, Uint32 drawOptions, Map * map, bool (Map::*mapIs)(int, int) const, int areaAnimationTick, AreaType areaType); inline void drawMapAirUnits(int left, int top, int right, int bot, int sw, int sh, int viewportX, int viewportY, int localTeam, Uint32 drawOptions);