mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-17 19:35:00 -04:00
rendering: don't pause on quit
This fixes a jvm crash when a rendering error occurs
This commit is contained in:
parent
89435bed4b
commit
08c26e8c3d
@ -206,7 +206,7 @@ class RenderWindow(
|
|||||||
inputHandler.init()
|
inputHandler.init()
|
||||||
DefaultKeyCombinations.registerAll(this)
|
DefaultKeyCombinations.registerAll(this)
|
||||||
this::state.observe(this) {
|
this::state.observe(this) {
|
||||||
if (it != RenderingStates.RUNNING) {
|
if (it == RenderingStates.PAUSED || it == RenderingStates.SLOW || it == RenderingStates.STOPPED) {
|
||||||
pause(true)
|
pause(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@ import de.bixilon.minosoft.assets.AssetsManager
|
|||||||
import de.bixilon.minosoft.config.profile.delegate.watcher.SimpleProfileDelegateWatcher.Companion.profileWatchRendering
|
import de.bixilon.minosoft.config.profile.delegate.watcher.SimpleProfileDelegateWatcher.Companion.profileWatchRendering
|
||||||
import de.bixilon.minosoft.config.profile.profiles.rendering.RenderingProfile
|
import de.bixilon.minosoft.config.profile.profiles.rendering.RenderingProfile
|
||||||
import de.bixilon.minosoft.gui.rendering.RenderWindow
|
import de.bixilon.minosoft.gui.rendering.RenderWindow
|
||||||
|
import de.bixilon.minosoft.gui.rendering.events.WindowCloseEvent
|
||||||
import de.bixilon.minosoft.terminal.RunConfiguration
|
import de.bixilon.minosoft.terminal.RunConfiguration
|
||||||
import de.bixilon.minosoft.util.KUtil.toResourceLocation
|
import de.bixilon.minosoft.util.KUtil.toResourceLocation
|
||||||
import de.matthiasmann.twl.utils.PNGDecoder
|
import de.matthiasmann.twl.utils.PNGDecoder
|
||||||
@ -65,7 +66,14 @@ interface BaseWindow {
|
|||||||
|
|
||||||
fun destroy()
|
fun destroy()
|
||||||
|
|
||||||
fun close()
|
fun close() {
|
||||||
|
if (fireGLFWEvent(WindowCloseEvent(renderWindow, window = this))) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
forceClose()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun forceClose()
|
||||||
|
|
||||||
fun swapBuffers()
|
fun swapBuffers()
|
||||||
|
|
||||||
|
@ -247,11 +247,7 @@ class GLFWWindow(
|
|||||||
glfwSetErrorCallback(null)?.free()
|
glfwSetErrorCallback(null)?.free()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun close() {
|
override fun forceClose() {
|
||||||
if (fireGLFWEvent(WindowCloseEvent(renderWindow, window = this))) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
glfwSetWindowShouldClose(window, true)
|
glfwSetWindowShouldClose(window, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user