瀏覽代碼

Compilation fixes.

DjWarmonger 10 年之前
父節點
當前提交
1d34d15983
共有 2 個文件被更改,包括 6 次插入6 次删除
  1. 4 4
      client/mapHandler.cpp
  2. 2 2
      client/widgets/AdventureMapClasses.cpp

+ 4 - 4
client/mapHandler.cpp

@@ -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;

+ 2 - 2
client/widgets/AdventureMapClasses.cpp

@@ -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