mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-18 11:54:59 -04:00
fix fallback texture reading
This commit is contained in:
parent
a218082a37
commit
bd5094c609
@ -102,7 +102,6 @@ object OpenGLTextureUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun InputStream.readFallbackTexture(): Pair<Vec2i, ByteBuffer> {
|
private fun InputStream.readFallbackTexture(): Pair<Vec2i, ByteBuffer> {
|
||||||
// ToDo: This somehow crashes with some resource packs
|
|
||||||
val image: BufferedImage = ImageIO.read(this)
|
val image: BufferedImage = ImageIO.read(this)
|
||||||
val rgb = image.getRGB(0, 0, image.width, image.height, null, 0, image.width)
|
val rgb = image.getRGB(0, 0, image.width, image.height, null, 0, image.width)
|
||||||
|
|
||||||
@ -126,6 +125,7 @@ object OpenGLTextureUtil {
|
|||||||
|
|
||||||
Pair(Vec2i(decoder.width, decoder.height), data)
|
Pair(Vec2i(decoder.width, decoder.height), data)
|
||||||
} catch (exception: Throwable) {
|
} catch (exception: Throwable) {
|
||||||
|
this.reset()
|
||||||
readFallbackTexture()
|
readFallbackTexture()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user