From 46dfbe3252d150c152a6d0ad11dce457d39278d5 Mon Sep 17 00:00:00 2001 From: Moritz Zwerger Date: Thu, 23 Nov 2023 17:31:11 +0100 Subject: [PATCH] remove debug TextureArray::dump --- .../dummy/texture/DummyStaticTextureArray.kt | 2 -- .../base/texture/array/StaticTextureArray.kt | 3 --- .../system/opengl/texture/OpenGLTextureArray.kt | 16 ---------------- 3 files changed, 21 deletions(-) diff --git a/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/system/dummy/texture/DummyStaticTextureArray.kt b/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/system/dummy/texture/DummyStaticTextureArray.kt index 549ac1a870..ba98dfc331 100644 --- a/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/system/dummy/texture/DummyStaticTextureArray.kt +++ b/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/system/dummy/texture/DummyStaticTextureArray.kt @@ -23,7 +23,6 @@ import de.bixilon.minosoft.gui.rendering.system.base.texture.array.StaticTexture import de.bixilon.minosoft.gui.rendering.system.base.texture.array.TextureArrayStates import de.bixilon.minosoft.gui.rendering.system.base.texture.sprite.SpriteAnimator import de.bixilon.minosoft.gui.rendering.system.base.texture.texture.Texture -import java.nio.ByteBuffer class DummyStaticTextureArray(renderSystem: RenderSystem) : StaticTextureArray { private val textures: MutableMap = synchronizedMapOf() @@ -54,5 +53,4 @@ class DummyStaticTextureArray(renderSystem: RenderSystem) : StaticTextureArray { } override fun use(shader: NativeShader, name: String) = Unit - override fun dump(texture: Texture): ByteBuffer = throw UnsupportedOperationException() } diff --git a/src/main/java/de/bixilon/minosoft/gui/rendering/system/base/texture/array/StaticTextureArray.kt b/src/main/java/de/bixilon/minosoft/gui/rendering/system/base/texture/array/StaticTextureArray.kt index 9b090306d9..f1fc4e4924 100644 --- a/src/main/java/de/bixilon/minosoft/gui/rendering/system/base/texture/array/StaticTextureArray.kt +++ b/src/main/java/de/bixilon/minosoft/gui/rendering/system/base/texture/array/StaticTextureArray.kt @@ -18,7 +18,6 @@ import de.bixilon.minosoft.data.registries.identified.ResourceLocation import de.bixilon.minosoft.gui.rendering.system.base.texture.sprite.SpriteAnimator import de.bixilon.minosoft.gui.rendering.system.base.texture.texture.Texture import de.bixilon.minosoft.gui.rendering.system.base.texture.texture.file.PNGTexture -import java.nio.ByteBuffer interface StaticTextureArray : TextureArray { val animator: SpriteAnimator @@ -31,6 +30,4 @@ interface StaticTextureArray : TextureArray { fun createTexture(resourceLocation: ResourceLocation, mipmaps: Boolean = true, properties: Boolean = true, default: (mipmaps: Boolean) -> Texture = { PNGTexture(resourceLocation, mipmaps = it) }): Texture fun load(latch: AbstractLatch) - - fun dump(texture: Texture): ByteBuffer } diff --git a/src/main/java/de/bixilon/minosoft/gui/rendering/system/opengl/texture/OpenGLTextureArray.kt b/src/main/java/de/bixilon/minosoft/gui/rendering/system/opengl/texture/OpenGLTextureArray.kt index 5dce5e61a1..601ae35cda 100644 --- a/src/main/java/de/bixilon/minosoft/gui/rendering/system/opengl/texture/OpenGLTextureArray.kt +++ b/src/main/java/de/bixilon/minosoft/gui/rendering/system/opengl/texture/OpenGLTextureArray.kt @@ -41,12 +41,10 @@ import de.bixilon.minosoft.util.json.Jackson import de.bixilon.minosoft.util.logging.Log import de.bixilon.minosoft.util.logging.LogLevels import de.bixilon.minosoft.util.logging.LogMessageType -import org.lwjgl.BufferUtils import org.lwjgl.opengl.GL12.* import org.lwjgl.opengl.GL13.GL_TEXTURE0 import org.lwjgl.opengl.GL13.glActiveTexture import org.lwjgl.opengl.GL30.GL_TEXTURE_2D_ARRAY -import org.lwjgl.opengl.GL45.glGetTextureSubImage import java.nio.ByteBuffer import java.util.concurrent.atomic.AtomicInteger @@ -247,20 +245,6 @@ class OpenGLTextureArray( } } - override fun dump(texture: Texture): ByteBuffer { - val shaderId = texture.shaderId - val level = 0 - - val buffer = BufferUtils.createByteBuffer(texture.array.size * texture.array.size * 4) - - // glBindTexture(GL_TEXTURE_2D_ARRAY, shaderId shr 28) - - glGetTextureSubImage(textureIds[TEXTURE_RESOLUTION_ID_MAP.indexOf(texture.array.size)], 0, 0, 0, (shaderId shr 12) and 0xFFFFF, texture.array.size shr level, texture.array.size shr level, 1, GL_RGBA, GL_UNSIGNED_BYTE, buffer) - - return buffer - } - - companion object { const val TEXTURE_MAX_RESOLUTION = 2048 val TEXTURE_RESOLUTION_ID_MAP = intArrayOf(16, 32, 64, 128, 256, 512, 1024, TEXTURE_MAX_RESOLUTION) // A 12x12 texture will be saved in texture id 0 (in 0 are only 16x16 textures). Animated textures get split