spoilers: cursor dies

This commit is contained in:
Chris Forbes
2011-03-13 00:39:37 +13:00
parent 911ecb2ffa
commit c9be0f44f4
3 changed files with 6 additions and 31 deletions

View File

@@ -1,28 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using OpenRA.Graphics;
namespace OpenRA
{
public class Cursor
{
CursorSequence sequence;
public Cursor(string cursor)
{
sequence = CursorProvider.GetCursorSequence(cursor);
}
public void Draw(int frame, float2 pos)
{
sequence.GetSprite(frame).DrawAt(pos - sequence.Hotspot, Game.modData.Palette.GetPaletteIndex(sequence.Palette));
}
}
}

View File

@@ -86,8 +86,12 @@ namespace OpenRA.Graphics
wr.Draw();
Widget.DoDraw();
var cursorName = Widget.RootWidget.GetCursorOuter(Viewport.LastMousePos) ?? "default";
new Cursor(cursorName).Draw((int)cursorFrame, Viewport.LastMousePos + Location);
var cursorName = Widget.RootWidget.GetCursorOuter(Viewport.LastMousePos) ?? "default";
var cursorSequence = CursorProvider.GetCursorSequence(cursorName);
cursorSequence.GetSprite((int)cursorFrame).DrawAt(
Viewport.LastMousePos + Location - cursorSequence.Hotspot,
Game.modData.Palette.GetPaletteIndex(cursorSequence.Palette));
renderer.EndFrame( inputHandler );
}

View File

@@ -109,7 +109,6 @@
<Compile Include="Traits\World\SpatialBins.cs" />
<Compile Include="Traits\World\Country.cs" />
<Compile Include="Actor.cs" />
<Compile Include="Cursor.cs" />
<Compile Include="GameRules\Rules.cs" />
<Compile Include="Graphics\Animation.cs" />
<Compile Include="Game.cs" />