summaryrefslogtreecommitdiff
path: root/Oneko.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Oneko.cs')
-rw-r--r--Oneko.cs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Oneko.cs b/Oneko.cs
index 7a1e3ac..f158024 100644
--- a/Oneko.cs
+++ b/Oneko.cs
@@ -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);
}
}