From 5901d756eebffa7df4dfc2b68bb2dda9c4d5af7d Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sat, 23 Sep 2023 23:05:40 +0700 Subject: [PATCH] Fix missing texture not being properly uploaded to memory --- .../ru/dbotthepony/kstarbound/client/StarboundClient.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/client/StarboundClient.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/client/StarboundClient.kt index f16fe6b1..549fd14d 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/client/StarboundClient.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/client/StarboundClient.kt @@ -397,7 +397,7 @@ class StarboundClient : Closeable { } } - buffer.position() + buffer.position(0) missingTexture.upload(GL_RGB, GL_UNSIGNED_BYTE, buffer) } @@ -477,7 +477,7 @@ class StarboundClient : Closeable { val data = Image.get(it) if (data == null) { - LOGGER.error("Texture $it is not found, falling back to missing texture") + LOGGER.error("Texture $it is not found!") missingTexture } else { val tex = GLTexture2D(data.width, data.height, when (data.amountOfChannels) {