Add pack texture size check method

This commit is contained in:
Soggy_Pancake 2026-03-14 13:43:33 -07:00
parent 4b2b9094d2
commit 025e93b582
2 changed files with 17 additions and 0 deletions

View file

@ -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());