Make ISpriteLoader aware of the source file name.
This commit is contained in:
@@ -28,7 +28,7 @@ namespace OpenRA.Mods.Common.SpriteLoaders
|
||||
return isDds;
|
||||
}
|
||||
|
||||
public bool TryParseSprite(Stream s, out ISpriteFrame[] frames, out TypeDictionary metadata)
|
||||
public bool TryParseSprite(Stream s, string filename, out ISpriteFrame[] frames, out TypeDictionary metadata)
|
||||
{
|
||||
metadata = null;
|
||||
if (!IsDds(s))
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace OpenRA.Mods.Common.SpriteLoaders
|
||||
public bool DisableExportPadding => false;
|
||||
}
|
||||
|
||||
public bool TryParseSprite(Stream s, out ISpriteFrame[] frames, out TypeDictionary metadata)
|
||||
public bool TryParseSprite(Stream s, string filename, out ISpriteFrame[] frames, out TypeDictionary metadata)
|
||||
{
|
||||
metadata = null;
|
||||
frames = null;
|
||||
|
||||
@@ -146,7 +146,7 @@ namespace OpenRA.Mods.Common.SpriteLoaders
|
||||
return frames;
|
||||
}
|
||||
|
||||
public bool TryParseSprite(Stream s, out ISpriteFrame[] frames, out TypeDictionary metadata)
|
||||
public bool TryParseSprite(Stream s, string filename, out ISpriteFrame[] frames, out TypeDictionary metadata)
|
||||
{
|
||||
metadata = null;
|
||||
if (!IsShpTS(s))
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace OpenRA.Mods.Common.SpriteLoaders
|
||||
}
|
||||
}
|
||||
|
||||
public bool TryParseSprite(Stream s, out ISpriteFrame[] frames, out TypeDictionary metadata)
|
||||
public bool TryParseSprite(Stream s, string filename, out ISpriteFrame[] frames, out TypeDictionary metadata)
|
||||
{
|
||||
metadata = null;
|
||||
if (!IsTga(s))
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
for (var i = 0; i < Palette.Size; i++)
|
||||
palColors[i] = palette.GetColor(i);
|
||||
|
||||
var frames = FrameLoader.GetFrames(File.OpenRead(src), modData.SpriteLoaders, out _);
|
||||
var frames = FrameLoader.GetFrames(File.OpenRead(src), modData.SpriteLoaders, src, out _);
|
||||
|
||||
var usePadding = !args.Contains("--nopadding");
|
||||
var count = 0;
|
||||
|
||||
Reference in New Issue
Block a user