diff --git a/Minecraft.Client/AbstractTexturePack.cpp b/Minecraft.Client/AbstractTexturePack.cpp index 52a3b31f..fed4ea7b 100644 --- a/Minecraft.Client/AbstractTexturePack.cpp +++ b/Minecraft.Client/AbstractTexturePack.cpp @@ -327,6 +327,21 @@ void AbstractTexturePack::loadName() { } +void AbstractTexturePack::checkTexSize() { + BufferedImage* img = getImageResource(L"dirt.png", true); + if (img != NULL) { + int width = img->getWidth(); + int height = img->getHeight(); + if (width != height) { + app.DebugPrintf("Warning: Texture pack contains texture with bad size: %d x %d\n", width, height); + } else + texSize = width; + delete img; + } else { + texSize = 16; + } +} + InputStream *AbstractTexturePack::getResource(const wstring &name, bool allowFallback) //throws IOException { app.DebugPrintf("texture - %ls\n",name.c_str()); diff --git a/Minecraft.Client/AbstractTexturePack.h b/Minecraft.Client/AbstractTexturePack.h index 9de7ae36..5fb39d86 100644 --- a/Minecraft.Client/AbstractTexturePack.h +++ b/Minecraft.Client/AbstractTexturePack.h @@ -14,6 +14,7 @@ public: private: const DWORD id; const wstring name; + int texSize; protected: File *file; @@ -50,6 +51,7 @@ protected: virtual void loadComparison(); virtual void loadDescription(); virtual void loadName(); + void checkTexSize(); public: virtual InputStream *getResource(const wstring &name, bool allowFallback); //throws IOException