Add pack texture size check method
This commit is contained in:
parent
4b2b9094d2
commit
025e93b582
2 changed files with 17 additions and 0 deletions
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue