mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-13 03:54:06 +09:00
writeworldinfo tested to be working
This commit is contained in:
@@ -66,7 +66,7 @@ internal object ReadLayerData {
|
||||
|
||||
// create world out of tiles data
|
||||
|
||||
val retWorld = inWorld ?: GameWorldExtension(1, worldWidth, worldHeight)
|
||||
val retWorld = inWorld ?: GameWorldExtension(1, worldWidth, worldHeight, 0, 0, 0) // FIXME null TIME_T for the (partial) test to pass
|
||||
|
||||
retWorld.layerTerrain.data = terrainLayerMSB
|
||||
retWorld.layerWall.data = wallLayerMSB
|
||||
|
||||
@@ -15,8 +15,6 @@ import java.io.FileOutputStream
|
||||
|
||||
object WriteWorldInfo {
|
||||
|
||||
// FIXME UNTESTED
|
||||
|
||||
val META_MAGIC = "TESV".toByteArray(Charsets.UTF_8)
|
||||
val NULL = 0.toByte()
|
||||
|
||||
@@ -108,9 +106,10 @@ object WriteWorldInfo {
|
||||
metaOut.write(timeNow.toLittle48())
|
||||
|
||||
// get playtime and save it
|
||||
val timeToAdd = timeNow - world.loadTime
|
||||
metaOut.write(world.lastPlayTime.plus(timeToAdd).toInt().toLittle())
|
||||
val timeToAdd = (timeNow - world.loadTime).toInt()
|
||||
metaOut.write((world.totalPlayTime + timeToAdd).toLittle())
|
||||
world.lastPlayTime = timeNow
|
||||
world.totalPlayTime += timeToAdd
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user