mirror of
https://github.com/vcmi/vcmi.git
synced 2025-04-15 11:46:56 +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));
|
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
|
// 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)
|
// (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),
|
Rect clipRect(std::max<int>(info->drawBounds->x, info->drawBounds->x - topTile.x * tileSize),
|
||||||
std::max(info->drawBounds->y, info->drawBounds->y - topTile.y * tileSize),
|
std::max<int>(info->drawBounds->y, info->drawBounds->y - topTile.y * tileSize),
|
||||||
std::min(info->drawBounds->w, parent->sizes.x * tileSize),
|
std::min<int>(info->drawBounds->w, parent->sizes.x * tileSize),
|
||||||
std::min(info->drawBounds->h, parent->sizes.y * tileSize));
|
std::min<int>(info->drawBounds->h, parent->sizes.y * tileSize));
|
||||||
SDL_GetClipRect(targetSurf, &prevClip);
|
SDL_GetClipRect(targetSurf, &prevClip);
|
||||||
SDL_SetClipRect(targetSurf, &clipRect); //preventing blitting outside of that rect
|
SDL_SetClipRect(targetSurf, &clipRect); //preventing blitting outside of that rect
|
||||||
return prevClip;
|
return prevClip;
|
||||||
|
@ -612,8 +612,8 @@ void CMinimap::showAll(SDL_Surface * to)
|
|||||||
if (adventureInt->mode == EAdvMapMode::WORLD_VIEW)
|
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)
|
// 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.x = std::min<int>(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.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)
|
if (radar.x < pos.x && radar.y < pos.y)
|
||||||
return; // whole map is visible at once, no point in redrawing border
|
return; // whole map is visible at once, no point in redrawing border
|
||||||
|
Loading…
x
Reference in New Issue
Block a user