Merge pull request #4234 from Mailaender/minimap-utility

Added a minimap renderer to OpenRA.Utility.exe
This commit is contained in:
Paul Chote
2013-12-06 11:52:19 -08:00
4 changed files with 34 additions and 13 deletions

View File

@@ -113,7 +113,7 @@ namespace OpenRA.Graphics
{
var mapX = x + map.Bounds.Left;
var mapY = y + map.Bounds.Top;
var custom = map.CustomTerrain[mapX,mapY];
var custom = map.CustomTerrain[mapX, mapY];
if (custom == null)
continue;
*(c + (y * bitmapData.Stride >> 2) + x) = world.TileSet.Terrain[custom].Color.ToArgb();
@@ -185,9 +185,9 @@ namespace OpenRA.Graphics
return bitmap;
}
public static Bitmap RenderMapPreview(Map map)
public static Bitmap RenderMapPreview(Map map, bool actualSize)
{
Bitmap terrain = TerrainBitmap(map);
Bitmap terrain = TerrainBitmap(map, actualSize);
return AddStaticResources(map, terrain);
}
}

View File

@@ -170,7 +170,7 @@ namespace OpenRA.Widgets
uid = cacheUids.Peek();
}
var bitmap = Minimap.RenderMapPreview(Game.modData.AvailableMaps[uid]);
var bitmap = Minimap.RenderMapPreview(Game.modData.AvailableMaps[uid], false);
lock (syncRoot)
{
// TODO: We should add previews to a sheet here (with multiple previews per sheet)