drop CursorSheetBuilder; use normal SheetBuilder for cursors now.
This commit is contained in:
@@ -28,7 +28,7 @@ namespace OpenRA.Graphics
|
|||||||
|
|
||||||
public CursorSequence(string cursorSrc, string palette, MiniYaml info)
|
public CursorSequence(string cursorSrc, string palette, MiniYaml info)
|
||||||
{
|
{
|
||||||
sprites = Game.modData.CursorSheetBuilder.LoadAllSprites(cursorSrc);
|
sprites = Game.modData.SpriteLoader.LoadAllSprites(cursorSrc);
|
||||||
var d = info.NodesDict;
|
var d = info.NodesDict;
|
||||||
|
|
||||||
start = int.Parse(d["start"].Value);
|
start = int.Parse(d["start"].Value);
|
||||||
|
|||||||
@@ -1,37 +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 System;
|
|
||||||
using System.Linq;
|
|
||||||
using OpenRA.FileFormats;
|
|
||||||
|
|
||||||
namespace OpenRA.Graphics
|
|
||||||
{
|
|
||||||
public class CursorSheetBuilder
|
|
||||||
{
|
|
||||||
ModData modData;
|
|
||||||
Cache<string, Sprite[]> cursors;
|
|
||||||
readonly string[] exts = { ".shp" };
|
|
||||||
|
|
||||||
public CursorSheetBuilder( ModData modData )
|
|
||||||
{
|
|
||||||
this.modData = modData;
|
|
||||||
this.cursors = new Cache<string, Sprite[]>( LoadCursors );
|
|
||||||
}
|
|
||||||
|
|
||||||
Sprite[] LoadCursors(string filename)
|
|
||||||
{
|
|
||||||
var shp = new ShpReader(FileSystem.OpenWithExts(filename, exts));
|
|
||||||
return shp.Select(a => modData.SheetBuilder.Add(a.Image, shp.Size)).ToArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Sprite[] LoadAllSprites(string filename) { return cursors[filename]; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -26,7 +26,6 @@ namespace OpenRA
|
|||||||
public readonly WidgetLoader WidgetLoader;
|
public readonly WidgetLoader WidgetLoader;
|
||||||
public ILoadScreen LoadScreen = null;
|
public ILoadScreen LoadScreen = null;
|
||||||
public SheetBuilder SheetBuilder;
|
public SheetBuilder SheetBuilder;
|
||||||
public CursorSheetBuilder CursorSheetBuilder;
|
|
||||||
public SpriteLoader SpriteLoader;
|
public SpriteLoader SpriteLoader;
|
||||||
public HardwarePalette Palette { get; private set; }
|
public HardwarePalette Palette { get; private set; }
|
||||||
IFolder previousMapMount = null;
|
IFolder previousMapMount = null;
|
||||||
@@ -59,7 +58,7 @@ namespace OpenRA
|
|||||||
ChromeMetrics.Initialize(Manifest.ChromeMetrics);
|
ChromeMetrics.Initialize(Manifest.ChromeMetrics);
|
||||||
ChromeProvider.Initialize(Manifest.Chrome);
|
ChromeProvider.Initialize(Manifest.Chrome);
|
||||||
SheetBuilder = new SheetBuilder(TextureChannel.Red);
|
SheetBuilder = new SheetBuilder(TextureChannel.Red);
|
||||||
CursorSheetBuilder = new CursorSheetBuilder(this);
|
SpriteLoader = new SpriteLoader(new string[] { ".shp" }, SheetBuilder);
|
||||||
CursorProvider.Initialize(Manifest.Cursors);
|
CursorProvider.Initialize(Manifest.Cursors);
|
||||||
Palette.Update(new IPaletteModifier[] { });
|
Palette.Update(new IPaletteModifier[] { });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,7 +112,6 @@
|
|||||||
<Compile Include="Graphics\Animation.cs" />
|
<Compile Include="Graphics\Animation.cs" />
|
||||||
<Compile Include="Game.cs" />
|
<Compile Include="Game.cs" />
|
||||||
<Compile Include="Graphics\CursorSequence.cs" />
|
<Compile Include="Graphics\CursorSequence.cs" />
|
||||||
<Compile Include="Graphics\CursorSheetBuilder.cs" />
|
|
||||||
<Compile Include="Graphics\LineRenderer.cs" />
|
<Compile Include="Graphics\LineRenderer.cs" />
|
||||||
<Compile Include="Graphics\WorldRenderer.cs" />
|
<Compile Include="Graphics\WorldRenderer.cs" />
|
||||||
<Compile Include="Orders\IOrderGenerator.cs" />
|
<Compile Include="Orders\IOrderGenerator.cs" />
|
||||||
|
|||||||
Reference in New Issue
Block a user