diff --git a/src/net/torvald/terrarum/Terrarum.kt b/src/net/torvald/terrarum/Terrarum.kt index 94971da70..7d4196b13 100644 --- a/src/net/torvald/terrarum/Terrarum.kt +++ b/src/net/torvald/terrarum/Terrarum.kt @@ -167,13 +167,11 @@ object Terrarum : Disposable { val RENDER_FPS = getConfigInt("displayfps") val USE_VSYNC = getConfigBoolean("usevsync") - var VSYNC = USE_VSYNC val VSYNC_TRIGGER_THRESHOLD = 56 val GL_VERSION: Int get() = Gdx.graphics.glVersion.majorVersion * 100 + Gdx.graphics.glVersion.minorVersion * 10 + Gdx.graphics.glVersion.releaseVersion - val MINIMAL_GL_VERSION = 210 /*val GL_MAX_TEXTURE_SIZE: Int get() { val intBuffer = BufferUtils.createIntBuffer(16) // size must be at least 16, or else LWJGL complains @@ -695,7 +693,6 @@ fun AppUpdateListOfSavegames() { println("${index+1}.\t${it.diskFile.absolutePath}") it.rebuild() // disk skimmer was created without initialisation, so do it now - // TODO write simple and dumb SAX parser for JSON val jsonFile = it.getFile(-1L)!! val json = JsonReader().parse(ByteArray64Reader(jsonFile.bytes, Common.CHARSET).readText()) val worldUUID = UUID.fromString(json.getString("worldIndex")) @@ -722,7 +719,6 @@ fun AppUpdateListOfSavegames() { println("${index+1}.\t${it.diskFile.absolutePath}") it.rebuild() // disk skimmer was created without initialisation, so do it now - // TODO write simple and dumb SAX parser for JSON val jsonFile = it.getFile(-1L)!! val json = JsonReader().parse(ByteArray64Reader(jsonFile.bytes, Common.CHARSET).readText()) val playerUUID = UUID.fromString(json.getString("uuid")) diff --git a/src/net/torvald/terrarum/TerrarumGLinfo.kt b/src/net/torvald/terrarum/TerrarumGLinfo.kt index fa42e3f4c..ec0b2e82c 100644 --- a/src/net/torvald/terrarum/TerrarumGLinfo.kt +++ b/src/net/torvald/terrarum/TerrarumGLinfo.kt @@ -7,8 +7,7 @@ import org.lwjgl.opengl.GL11 class TerrarumGLinfo { private var _initialised = false - // some JVMs don't have this property, but they probably don't have "sun.misc.Unsafe" either, so it's no big issue \_(ツ)_/ - val MINIMAL_GL_VERSION = 320 + val MINIMAL_GL_VERSION = 430 var GL_VERSION = -1; private set get() = if (_initialised) field else throw UninitializedPropertyAccessException() @@ -31,7 +30,7 @@ class TerrarumGLinfo { if (GL_VERSION < MINIMAL_GL_VERSION) { // TODO notify properly - throw GdxRuntimeException("Graphics device not capable -- device's GL_VERSION: $GL_VERSION, required: $MINIMAL_GL_VERSION") + throw GdxRuntimeException("Graphics device not capable -- device's GL_VERSION: $GL_VERSION, required version: $MINIMAL_GL_VERSION") } GL_MAX_TEXTURE_SIZE = GL11.glGetInteger(GL11.GL_MAX_TEXTURE_SIZE) diff --git a/src/net/torvald/terrarum/savegame/VirtualDisk.kt b/src/net/torvald/terrarum/savegame/VirtualDisk.kt index 9c81e18c3..f3b69f431 100644 --- a/src/net/torvald/terrarum/savegame/VirtualDisk.kt +++ b/src/net/torvald/terrarum/savegame/VirtualDisk.kt @@ -1,5 +1,7 @@ package net.torvald.terrarum.savegame +import net.torvald.terrarum.App.printdbg +import net.torvald.terrarum.serialise.Common import java.io.IOException import java.nio.charset.Charset import java.util.* @@ -152,6 +154,9 @@ class VirtualDisk( // make sure to write root directory first entries[0L]!!.let { rootDir -> rootDir.serialize().forEach { buffer.add(it) } + + printdbg(this, "Writing disk ${getDiskName(Common.CHARSET)}") + printdbg(this, "Root creation: ${rootDir.creationDate}, modified: ${rootDir.modificationDate}") } entries.forEach { if (it.key != 0L) { diff --git a/src/net/torvald/terrarum/serialise/GameSavingThread.kt b/src/net/torvald/terrarum/serialise/GameSavingThread.kt index e5e9aa985..f2fe7cc42 100644 --- a/src/net/torvald/terrarum/serialise/GameSavingThread.kt +++ b/src/net/torvald/terrarum/serialise/GameSavingThread.kt @@ -136,7 +136,6 @@ class WorldSavingThread( Echo("Writing file to disk...") - disk.entries[0]!!.creationDate = creation_t disk.entries[0]!!.modificationDate = time_t // entry zero MUST NOT be used to get lastPlayDate, but we'll update it anyway // use entry -1 for that purpose! @@ -180,6 +179,7 @@ class PlayerSavingThread( Echo("Writing The Player...") WritePlayer(ingame.actorGamer, disk, ingame, time_t) + disk.entries[0]!!.modificationDate = time_t VDUtil.dumpToRealMachine(disk, outFile) callback()