diff --git a/config_colemak.json b/config_colemak.json index 9e89936ab..09f68c662 100644 --- a/config_colemak.json +++ b/config_colemak.json @@ -1,8 +1,8 @@ { "displayfps": 0, "usevsync": false, - "screenwidth": 1110, - "screenheight": 740, + "screenwidth": 1280, + "screenheight": 720, "language": "enUS", "notificationshowuptime": 4000, "multithread": true, diff --git a/src/net/torvald/UnsafePtr.kt b/src/net/torvald/UnsafePtr.kt index 36d784dcb..62265df97 100644 --- a/src/net/torvald/UnsafePtr.kt +++ b/src/net/torvald/UnsafePtr.kt @@ -94,12 +94,11 @@ internal class UnsafePtr(pointer: Long, allocSize: Long) { } private inline fun checkNullPtr(index: Long) { // ignore what IDEA says and do inline this - // commenting out because of the suspected (or minor?) performance impact. - // You may break the glass and use this tool when some fucking incomprehensible bugs ("vittujen vitun bugit") - // appear (e.g. getting garbage values when it fucking shouldn't) - assert(!destroyed) { throw NullPointerException("The pointer is already destroyed ($this)") } + //// commenting out because of the suspected (or minor?) performance impact. + //// You may break the glass and use this tool when some fucking incomprehensible bugs ("vittujen vitun bugit") + //// appear (e.g. getting garbage values when it fucking shouldn't) - // OOB Check: debugging purposes only -- comment out for the production + //assert(!destroyed) { throw NullPointerException("The pointer is already destroyed ($this)") } //if (index !in 0 until size) throw IndexOutOfBoundsException("Index: $index; alloc size: $size") } diff --git a/src/net/torvald/gdx/graphics/UnsafeCvecArray.kt b/src/net/torvald/gdx/graphics/UnsafeCvecArray.kt index 498f82d4d..bbd6639ef 100644 --- a/src/net/torvald/gdx/graphics/UnsafeCvecArray.kt +++ b/src/net/torvald/gdx/graphics/UnsafeCvecArray.kt @@ -12,9 +12,8 @@ import net.torvald.UnsafeHelper */ internal class UnsafeCvecArray(val width: Int, val height: Int) { - val TOTAL_SIZE_IN_BYTES = 16L * width * height - - val array = UnsafeHelper.allocate(TOTAL_SIZE_IN_BYTES) + private val TOTAL_SIZE_IN_BYTES = 16L * (width + 1) * (height + 1) + private val array = UnsafeHelper.allocate(TOTAL_SIZE_IN_BYTES) private inline fun toAddr(x: Int, y: Int) = 16L * (y * width + x) diff --git a/src/net/torvald/terrarum/AppLoader.java b/src/net/torvald/terrarum/AppLoader.java index e06cf9715..711529df3 100644 --- a/src/net/torvald/terrarum/AppLoader.java +++ b/src/net/torvald/terrarum/AppLoader.java @@ -208,10 +208,10 @@ public class AppLoader implements ApplicationListener { public static ArrayListMap debugTimers = new ArrayListMap(); - public static final int defaultW = 1116; - public static final int defaultH = 744; - public static final int minimumW = 1080; - public static final int minimumH = 722; + public static final int defaultW = 1280; + public static final int defaultH = 720; + public static final int minimumW = 800; + public static final int minimumH = 600; public static final String FONT_DIR = "assets/graphics/fonts/terrarum-sans-bitmap"; diff --git a/src/net/torvald/terrarum/modulebasegame/IngameRenderer.kt b/src/net/torvald/terrarum/modulebasegame/IngameRenderer.kt index 52633044d..01da3f60e 100644 --- a/src/net/torvald/terrarum/modulebasegame/IngameRenderer.kt +++ b/src/net/torvald/terrarum/modulebasegame/IngameRenderer.kt @@ -51,10 +51,10 @@ object IngameRenderer : Disposable { val shaderAtoGrey: ShaderProgram val shaderPassthru = SpriteBatch.createDefaultShader() - private val width = AppLoader.screenW - private val height = AppLoader.screenH - private val widthf = width.toFloat() - private val heightf = height.toFloat() + private val WIDTH = AppLoader.screenW + private val HEIGHT = AppLoader.screenH + private val WIDTHF = WIDTH.toFloat() + private val HEIGHTF = HEIGHT.toFloat() private var initDone = false @@ -586,13 +586,13 @@ object IngameRenderer : Disposable { private fun invokeInit() { if (!initDone) { batch = SpriteBatch() - camera = OrthographicCamera(widthf, heightf) + camera = OrthographicCamera(WIDTHF, HEIGHTF) - camera.setToOrtho(true, widthf, heightf) + camera.setToOrtho(true, WIDTHF, HEIGHTF) camera.update() - Gdx.gl20.glViewport(0, 0, width, height) + Gdx.gl20.glViewport(0, 0, WIDTH, HEIGHT) - resize(width, height) + resize(WIDTH, HEIGHT) initDone = true }