mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-24 03:47:18 +02:00
Compilation fixes.
This commit is contained in:
parent
860c61def1
commit
1d34d15983
@ -730,10 +730,10 @@ SDL_Rect CMapHandler::CMapWorldViewBlitter::clip(SDL_Surface * targetSurf) const
|
||||
SDL_FillRect(targetSurf, info->drawBounds, SDL_MapRGB(targetSurf->format, 0, 0, 0));
|
||||
// makes the clip area smaller if the map is smaller than the screen frame
|
||||
// (actually, it could be made 1 tile bigger so that overlay icons on edge tiles could be drawn partly outside)
|
||||
Rect clipRect(std::max(info->drawBounds->x, info->drawBounds->x - topTile.x * tileSize),
|
||||
std::max(info->drawBounds->y, info->drawBounds->y - topTile.y * tileSize),
|
||||
std::min(info->drawBounds->w, parent->sizes.x * tileSize),
|
||||
std::min(info->drawBounds->h, parent->sizes.y * tileSize));
|
||||
Rect clipRect(std::max<int>(info->drawBounds->x, info->drawBounds->x - topTile.x * tileSize),
|
||||
std::max<int>(info->drawBounds->y, info->drawBounds->y - topTile.y * tileSize),
|
||||
std::min<int>(info->drawBounds->w, parent->sizes.x * tileSize),
|
||||
std::min<int>(info->drawBounds->h, parent->sizes.y * tileSize));
|
||||
SDL_GetClipRect(targetSurf, &prevClip);
|
||||
SDL_SetClipRect(targetSurf, &clipRect); //preventing blitting outside of that rect
|
||||
return prevClip;
|
||||
|
@ -612,8 +612,8 @@ void CMinimap::showAll(SDL_Surface * to)
|
||||
if (adventureInt->mode == EAdvMapMode::WORLD_VIEW)
|
||||
{
|
||||
// adjusts radar so that it doesn't go out of map in world view mode (since there's no frame)
|
||||
radar.x = std::min(std::max(pos.x, radar.x), pos.x + pos.w - radar.w);
|
||||
radar.y = std::min(std::max(pos.y, radar.y), pos.y + pos.h - radar.h);
|
||||
radar.x = std::min<int>(std::max(pos.x, radar.x), pos.x + pos.w - radar.w);
|
||||
radar.y = std::min<int>(std::max(pos.y, radar.y), pos.y + pos.h - radar.h);
|
||||
|
||||
if (radar.x < pos.x && radar.y < pos.y)
|
||||
return; // whole map is visible at once, no point in redrawing border
|
||||
|
Loading…
x
Reference in New Issue
Block a user