Tweaks to minimap preview

This commit is contained in:
Paul Chote
2010-09-16 22:54:49 +12:00
parent 482129499d
commit d4182b1929
3 changed files with 27 additions and 19 deletions

View File

@@ -21,10 +21,22 @@ namespace OpenRA.Graphics
public class Minimap
{
public static Bitmap TerrainBitmap(Map map)
{
return TerrainBitmap(map, false);
}
public static Bitmap TerrainBitmap(Map map, bool actualSize)
{
var tileset = Rules.TileSets[map.Tileset];
var size = Util.NextPowerOf2(Math.Max(map.Width, map.Height));
Bitmap terrain = new Bitmap(size, size);
var width = map.Width;
var height = map.Height;
if (!actualSize)
{
width = height = Util.NextPowerOf2(Math.Max(map.Width, map.Height));
}
Bitmap terrain = new Bitmap(width, height);
var bitmapData = terrain.LockBits(new Rectangle(0, 0, terrain.Width, terrain.Height),
ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb);