diff options
Diffstat (limited to 'Oneko.cs')
| -rw-r--r-- | Oneko.cs | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -17,6 +17,8 @@ abstract class Oneko : Drawable public string Name = "Oneko"; + protected readonly static byte[] FallbackImg = EmbeddedResources.GetResource("nekos.oneko.png"); + public Oneko() : base() { Size = new(32,32); @@ -25,10 +27,10 @@ abstract class Oneko : Drawable string SpriteSheetPath = OnekoOnline.Config.GetValue("SpriteSheetPath", "nekos/oneko.png"); if (File.Exists(SpriteSheetPath) && new FileInfo(SpriteSheetPath).Length < 128*256*3) { - SpriteSheet = Bitmap.FromPNGMemory(File.ReadAllBytes(SpriteSheetPath)); + SpriteSheet = Bitmap.FromPNGMemory(File.ReadAllBytes(SpriteSheetPath), 256, 128); } else { Console.WriteLine("Path to spritesheet was invalid or the file was too big, using the default."); - SpriteSheet = Bitmap.FromPNGMemory(EmbeddedResources.GetResource("nekos.oneko.png")); + SpriteSheet = Bitmap.FromPNGMemory(FallbackImg, 256, 128); } } |
