Shift the hard work into Tick

This commit is contained in:
Paul Chote
2010-07-22 21:41:30 +12:00
parent 5198ced5aa
commit 37a55715d0

View File

@@ -124,11 +124,6 @@ namespace OpenRA.Widgets
// Don't draw the radar if the tray is moving
if (radarAnimationFrame >= radarSlideAnimationLength)
{
// Build the radar image
var custom = Minimap.AddCustomTerrain(world,terrainBitmap);
var final = Minimap.AddActors(world, custom);
radarSheet.Texture.SetData(final);
Game.Renderer.RgbaSpriteRenderer.DrawSprite( radarSprite,
new float2(mapRect.Location.X, mapRect.Location.Y + world.Map.Height * previewScale * (1 - radarMinimapHeight)/2),
"chrome",
@@ -147,6 +142,14 @@ namespace OpenRA.Widgets
hasRadar = hasRadarNew;
if (hasRadar)
{
// Build the radar image
var custom = Minimap.AddCustomTerrain(world,terrainBitmap);
var final = Minimap.AddActors(world, custom);
radarSheet.Texture.SetData(final);
}
if (!radarAnimating)
return;