Use uppercase extensions to support case-sensitive filesystems.

This commit is contained in:
Paul Chote
2013-08-17 20:01:24 +12:00
parent 608ca31f6d
commit 5cb79283be
2 changed files with 4 additions and 4 deletions

View File

@@ -25,7 +25,7 @@ namespace OpenRA.FileFormats
List<byte[]> LoadTemplate(string filename, string[] exts, Cache<string, R8Reader> r8Cache, int[] frames) List<byte[]> LoadTemplate(string filename, string[] exts, Cache<string, R8Reader> r8Cache, int[] frames)
{ {
if (exts.Contains(".r8") && FileSystem.Exists(filename+".r8")) if (exts.Contains(".R8") && FileSystem.Exists(filename+".R8"))
{ {
var data = new List<byte[]>(); var data = new List<byte[]>();
@@ -45,7 +45,7 @@ namespace OpenRA.FileFormats
this.TileSize = tileSize; this.TileSize = tileSize;
templates = new Dictionary<ushort, List<byte[]>>(); templates = new Dictionary<ushort, List<byte[]>>();
var r8Cache = new Cache<string, R8Reader>(s => new R8Reader(FileSystem.OpenWithExts(s, ".r8"))); var r8Cache = new Cache<string, R8Reader>(s => new R8Reader(FileSystem.OpenWithExts(s, ".R8")));
foreach (var t in TileSet.Templates) foreach (var t in TileSet.Templates)
templates.Add(t.Key, LoadTemplate(t.Value.Image, tileset.Extensions, r8Cache, t.Value.Frames)); templates.Add(t.Key, LoadTemplate(t.Value.Image, tileset.Extensions, r8Cache, t.Value.Frames));
} }

View File

@@ -27,7 +27,7 @@ namespace OpenRA.Graphics
Sprite[] LoadTemplate(string filename, string[] exts, Cache<string, R8Reader> r8Cache, int[] frames) Sprite[] LoadTemplate(string filename, string[] exts, Cache<string, R8Reader> r8Cache, int[] frames)
{ {
if (exts.Contains(".r8") && FileSystem.Exists(filename+".r8")) if (exts.Contains(".R8") && FileSystem.Exists(filename+".R8"))
{ {
return frames.Select(f => return frames.Select(f =>
{ {
@@ -60,7 +60,7 @@ namespace OpenRA.Graphics
return new Sheet(new Size(tileset.SheetSize, tileset.SheetSize)); return new Sheet(new Size(tileset.SheetSize, tileset.SheetSize));
}; };
var r8Cache = new Cache<string, R8Reader>(s => new R8Reader(FileSystem.OpenWithExts(s, ".r8"))); var r8Cache = new Cache<string, R8Reader>(s => new R8Reader(FileSystem.OpenWithExts(s, ".R8")));
templates = new Dictionary<ushort, Sprite[]>(); templates = new Dictionary<ushort, Sprite[]>();
sheetBuilder = new SheetBuilder(SheetType.Indexed, allocate); sheetBuilder = new SheetBuilder(SheetType.Indexed, allocate);
foreach (var t in tileset.Templates) foreach (var t in tileset.Templates)