From 82955b51dd659f96d2d7193418a3aa7cdf017b61 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Wed, 29 Mar 2023 12:39:07 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9E=D1=82=D0=B4=D0=B5=D0=BB=D1=8C=D0=BD?= =?UTF-8?q?=D1=8B=D0=B5=20=D0=BF=D0=BE=D1=82=D0=BE=D0=BA=D0=B8=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20=D1=87=D0=B8=D1=81=D1=82=D0=BA=D0=B8=20=D0=BA?= =?UTF-8?q?=D0=B5=D1=88=D0=B0=20=D0=BD=D0=B5=20=D0=BD=D1=83=D0=B6=D0=BD?= =?UTF-8?q?=D1=8B,=20=D0=BE=D0=BD=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C?= =?UTF-8?q?=D0=B7=D1=83=D0=B5=D1=82=20ForkJoinPool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ru/dbotthepony/kstarbound/Starbound.kt | 17 ---------------- .../kstarbound/client/gl/GLStateTracker.kt | 20 ------------------- 2 files changed, 37 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/Starbound.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/Starbound.kt index 2895ee5c..d74bef1c 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/Starbound.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/Starbound.kt @@ -233,23 +233,6 @@ class Starbound : ISBFileLocator { .maximumWeight(1_024L * 1_024L * 256L /* 256 МиБ */) .build() - init { - val ref = WeakReference(imageCache) - - val worker = Runnable { - while (true) { - val get = ref.get() ?: break - get.cleanUp() - LockSupport.parkNanos(1_000_000_000L) - } - } - - Thread(worker, "Image Data Cache Cleaner for $this").also { - it.isDaemon = true - it.start() - } - } - fun item(name: String): ItemStack { return ItemStack(items[name] ?: return ItemStack.EMPTY) } diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/client/gl/GLStateTracker.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/client/gl/GLStateTracker.kt index d7fdc1e7..f57ce4e2 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/client/gl/GLStateTracker.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/client/gl/GLStateTracker.kt @@ -442,26 +442,6 @@ class GLStateTracker(val client: StarboundClient) { .weakValues() .build() - init { - val ref0 = WeakReference(named2DTextures0) - val ref1 = WeakReference(named2DTextures1) - - val worker = Runnable { - while (true) { - val get0 = ref0.get() ?: break - get0.cleanUp() - val get1 = ref1.get() ?: break - get1.cleanUp() - LockSupport.parkNanos(1_000_000_000L) - } - } - - Thread(worker, "OpenGL Texture Cache Cleaner for $this").also { - it.isDaemon = true - it.start() - } - } - private val missingTexture: GLTexture2D by lazy { newTexture(missingTexturePath).upload(client.starbound.readDirect(missingTexturePath), GL_RGBA, GL_RGBA).generateMips().also { it.textureMinFilter = GL_NEAREST