actortemplate hax

This commit is contained in:
Chris Forbes
2010-05-10 17:49:11 +12:00
parent 22afe4f80b
commit 0673fc23bf
3 changed files with 24 additions and 6 deletions

View File

@@ -84,12 +84,12 @@ namespace OpenRA.Editor
try
{
var info = Rules.Info[a];
var bitmap = RenderActor(info, tsinfo.First, palette);
var template = RenderActor(info, tsinfo.First, palette);
var ibox = new PictureBox
{
Image = bitmap,
Width = bitmap.Width / 2,
Height = bitmap.Height / 2,
Image = template.Bitmap,
Width = template.Bitmap.Width / 2,
Height = template.Bitmap.Height / 2,
SizeMode = PictureBoxSizeMode.StretchImage
};
@@ -160,7 +160,7 @@ namespace OpenRA.Editor
return bitmap;
}
static Bitmap RenderActor(ActorInfo info, string ext, Palette p)
static ActorTemplate RenderActor(ActorInfo info, string ext, Palette p)
{
var image = info.Traits.Get<RenderSimpleInfo>().Image ?? info.Name;
using (var s = FileSystem.OpenWithExts(image, "." + ext, ".shp"))
@@ -183,7 +183,7 @@ namespace OpenRA.Editor
}
bitmap.UnlockBits(data);
return bitmap;
return new ActorTemplate { Bitmap = bitmap, Info = info, Centered = !info.Traits.Contains<Building>() };
}
}