mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 03:24:06 +09:00
it's not zipping correctly; some fixes on readlayer
This commit is contained in:
@@ -3,10 +3,10 @@ package net.torvald.terrarum.modulebasegame.console
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.console.ConsoleCommand
|
||||
import net.torvald.terrarum.console.Echo
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.serialise.ReadLayerData
|
||||
import net.torvald.terrarum.modulebasegame.gameworld.GameWorldExtension
|
||||
import net.torvald.terrarum.serialise.ReadLayerDataZip
|
||||
import net.torvald.terrarum.worlddrawer.FeaturesDrawer
|
||||
import java.io.FileInputStream
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2017-07-18.
|
||||
@@ -18,14 +18,15 @@ object ImportLayerData : ConsoleCommand {
|
||||
return
|
||||
}
|
||||
|
||||
//val fis = GZIPInputStream(FileInputStream(args[1])) // this gzip is kaput
|
||||
val fis = FileInputStream(args[1])
|
||||
(Terrarum.ingame!!.world) = ReadLayerData(fis)
|
||||
(Terrarum.ingame!! as Ingame).actorNowPlaying?.setPosition(
|
||||
val file = File(args[1])
|
||||
val layerData = ReadLayerDataZip(file)
|
||||
|
||||
|
||||
Terrarum.ingame!!.world = GameWorldExtension(1, layerData)
|
||||
Terrarum.ingame!!.actorNowPlaying?.setPosition(
|
||||
(Terrarum.ingame!!.world).spawnY * FeaturesDrawer.TILE_SIZE.toDouble(),
|
||||
(Terrarum.ingame!!.world).spawnX * FeaturesDrawer.TILE_SIZE.toDouble()
|
||||
)
|
||||
fis.close()
|
||||
Echo("Successfully loaded ${args[1]}")
|
||||
}
|
||||
|
||||
|
||||
@@ -2,12 +2,17 @@ package net.torvald.terrarum.modulebasegame.gameworld
|
||||
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import net.torvald.terrarum.gameworld.*
|
||||
import net.torvald.terrarum.serialise.ReadLayerDataZip
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2018-07-03.
|
||||
*/
|
||||
class GameWorldExtension(worldIndex: Int, width: Int, height: Int): GameWorld(worldIndex, width, height) {
|
||||
class GameWorldExtension: GameWorld {
|
||||
|
||||
constructor(worldIndex: Int, width: Int, height: Int) : super(worldIndex, width, height)
|
||||
internal constructor(worldIndex: Int, layerData: ReadLayerDataZip.LayerData) : super(worldIndex, layerData)
|
||||
|
||||
|
||||
val time: WorldTime
|
||||
val economy = GameEconomy()
|
||||
|
||||
@@ -115,8 +115,8 @@ open class UIRemoCon(treeRepresentation: QNDTreeNode<String>) : UICanvas() {
|
||||
printdbg(this, 1)
|
||||
|
||||
val ingame = Ingame(Terrarum.batch)
|
||||
//ingame.gameLoadInfoPayload = Ingame.NewWorldParameters(2400, 800, HQRNG().nextLong())
|
||||
ingame.gameLoadInfoPayload = Ingame.NewWorldParameters(8192, 2048, 0x51621DL)
|
||||
ingame.gameLoadInfoPayload = Ingame.NewWorldParameters(2400, 800, HQRNG().nextLong())
|
||||
//ingame.gameLoadInfoPayload = Ingame.NewWorldParameters(8192, 2048, 0x51621DL)
|
||||
ingame.gameLoadMode = Ingame.GameLoadMode.CREATE_NEW
|
||||
|
||||
printdbg(this, 2)
|
||||
|
||||
Reference in New Issue
Block a user