1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-19 21:10:12 +02:00

Minor fix to resolve clipping rect issue from previous commit;

This commit is contained in:
Fay 2015-01-31 19:05:25 +01:00
parent dbedf245a0
commit b59189ae6f

View File

@ -732,8 +732,8 @@ SDL_Rect CMapHandler::CMapWorldViewBlitter::clip(SDL_Surface * targetSurf) const
// (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->x + info->drawBounds->w, parent->sizes.x * tileSize),
std::min(info->drawBounds->y + info->drawBounds->h, parent->sizes.y * tileSize));
std::min(info->drawBounds->w, parent->sizes.x * tileSize),
std::min(info->drawBounds->h, parent->sizes.y * tileSize));
SDL_GetClipRect(targetSurf, &prevClip);
SDL_SetClipRect(targetSurf, &clipRect); //preventing blitting outside of that rect
return prevClip;