mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 03:24:06 +09:00
no more context fuckups on apploader
This commit is contained in:
@@ -318,7 +318,7 @@ class BuildingMaker(batch: SpriteBatch) : IngameInstance(batch) {
|
||||
private var updateAkku = 0.0
|
||||
|
||||
override fun render(delta: Float) {
|
||||
Gdx.graphics.setTitle(Ingame.getCanonicalTitle())
|
||||
Gdx.graphics.setTitle(TerrarumIngame.getCanonicalTitle())
|
||||
|
||||
|
||||
// ASYNCHRONOUS UPDATE AND RENDER //
|
||||
@@ -590,7 +590,7 @@ class MovableWorldCamera(val parent: BuildingMaker) : ActorHumanoid(0, usePhysic
|
||||
|
||||
class YamlCommandExit : YamlInvokable {
|
||||
override fun invoke(args: Array<Any>) {
|
||||
Terrarum.setScreen(TitleScreen(Terrarum.batch))
|
||||
AppLoader.setScreen(TitleScreen(Terrarum.batch))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,10 +39,12 @@ import java.util.concurrent.locks.ReentrantLock
|
||||
|
||||
|
||||
/**
|
||||
* Ingame instance for the game Terrarum.
|
||||
*
|
||||
* Created by minjaesong on 2017-06-16.
|
||||
*/
|
||||
|
||||
open class Ingame(batch: SpriteBatch) : IngameInstance(batch) {
|
||||
open class TerrarumIngame(batch: SpriteBatch) : IngameInstance(batch) {
|
||||
|
||||
private val ACTOR_UPDATE_RANGE = 4096
|
||||
|
||||
@@ -240,7 +242,7 @@ open class Ingame(batch: SpriteBatch) : IngameInstance(batch) {
|
||||
printdbg(this, "loaded successfully.")
|
||||
}
|
||||
else {
|
||||
LoadScreen.addMessage("${Terrarum.NAME} version ${AppLoader.getVERSION_STRING()}")
|
||||
LoadScreen.addMessage("${AppLoader.GAME_NAME} version ${AppLoader.getVERSION_STRING()}")
|
||||
LoadScreen.addMessage("Creating new world")
|
||||
|
||||
|
||||
@@ -416,7 +418,7 @@ open class Ingame(batch: SpriteBatch) : IngameInstance(batch) {
|
||||
///////////////
|
||||
// prod code //
|
||||
///////////////
|
||||
private class ThreadIngameUpdate(val ingame: Ingame): Runnable {
|
||||
private class ThreadIngameUpdate(val terrarumIngame: TerrarumIngame): Runnable {
|
||||
override fun run() {
|
||||
TODO()
|
||||
}
|
||||
@@ -425,6 +427,8 @@ open class Ingame(batch: SpriteBatch) : IngameInstance(batch) {
|
||||
private var updateAkku = 0.0
|
||||
|
||||
override fun render(delta: Float) {
|
||||
println("Vitun Perkeleen TerrarumIngame")
|
||||
|
||||
// Q&D solution for LoadScreen and Ingame, where while LoadScreen is working, Ingame now no longer has GL Context
|
||||
// there's still things to load which needs GL context to be present
|
||||
if (!gameFullyLoaded) {
|
||||
@@ -660,12 +664,12 @@ open class Ingame(batch: SpriteBatch) : IngameInstance(batch) {
|
||||
if (false) { // don't multithread this for now, it's SLOWER //if (Terrarum.MULTITHREAD && actorContainerActive.size > Terrarum.THREADS) {
|
||||
val actors = actorContainerActive.size.toFloat()
|
||||
// set up indices
|
||||
for (i in 0..Terrarum.THREADS - 1) {
|
||||
for (i in 0..AppLoader.THREADS - 1) {
|
||||
ThreadParallel.map(
|
||||
i, "ActorUpdate",
|
||||
ThreadActorUpdate(
|
||||
actors.div(Terrarum.THREADS).times(i).roundInt(),
|
||||
actors.div(Terrarum.THREADS).times(i + 1).roundInt() - 1
|
||||
actors.div(AppLoader.THREADS).times(i).roundInt(),
|
||||
actors.div(AppLoader.THREADS).times(i + 1).roundInt() - 1
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.console.ConsoleCommand
|
||||
import net.torvald.terrarum.console.Echo
|
||||
import net.torvald.terrarum.console.EchoError
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
import net.torvald.terrarum.modulebasegame.debuggerapp.ActorValueTracker
|
||||
import java.util.*
|
||||
|
||||
@@ -16,7 +16,7 @@ internal object AVTracker : ConsoleCommand {
|
||||
|
||||
override fun execute(args: Array<String>) {
|
||||
if (args.size < 2) {
|
||||
jPanelInstances.add(ActorValueTracker((Terrarum.ingame!! as Ingame).actorNowPlaying))
|
||||
jPanelInstances.add(ActorValueTracker((Terrarum.ingame!! as TerrarumIngame).actorNowPlaying))
|
||||
}
|
||||
else {
|
||||
try {
|
||||
|
||||
@@ -4,7 +4,7 @@ import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.console.ConsoleCommand
|
||||
import net.torvald.terrarum.console.Echo
|
||||
import net.torvald.terrarum.debuggerapp.ActorsLister
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
@@ -15,8 +15,8 @@ internal object ActorsList : ConsoleCommand {
|
||||
|
||||
override fun execute(args: Array<String>) {
|
||||
jPanelInstances.add(ActorsLister(
|
||||
(Terrarum.ingame!! as Ingame).actorContainerActive,
|
||||
(Terrarum.ingame!! as Ingame).actorContainerInactive)
|
||||
(Terrarum.ingame!! as TerrarumIngame).actorContainerActive,
|
||||
(Terrarum.ingame!! as TerrarumIngame).actorContainerInactive)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@ package net.torvald.terrarum.modulebasegame.console
|
||||
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.console.ConsoleCommand
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
|
||||
object CheatWarnTest : ConsoleCommand {
|
||||
|
||||
override fun execute(args: Array<String>) {
|
||||
(Terrarum.ingame as? Ingame)?.uiCheatMotherfuckerNootNoot?.setAsOpen()
|
||||
(Terrarum.ingame as? TerrarumIngame)?.uiCheatMotherfuckerNootNoot?.setAsOpen()
|
||||
}
|
||||
|
||||
override fun printUsage() {
|
||||
|
||||
@@ -5,7 +5,7 @@ import net.torvald.terrarum.utils.JsonWriter
|
||||
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.modulebasegame.TerrarumIngame
|
||||
|
||||
import java.io.IOException
|
||||
|
||||
@@ -16,7 +16,7 @@ internal object ExportAV : ConsoleCommand {
|
||||
override fun execute(args: Array<String>) {
|
||||
if (args.size == 2) {
|
||||
try {
|
||||
val player = (Terrarum.ingame!! as Ingame).actorNowPlaying
|
||||
val player = (Terrarum.ingame!! as TerrarumIngame).actorNowPlaying
|
||||
if (player == null) return
|
||||
|
||||
JsonWriter.writeToFile(
|
||||
|
||||
@@ -5,7 +5,7 @@ import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.console.ConsoleCommand
|
||||
import net.torvald.terrarum.console.Echo
|
||||
import net.torvald.terrarum.console.EchoError
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2016-01-19.
|
||||
@@ -14,8 +14,8 @@ internal object GetAV : ConsoleCommand {
|
||||
|
||||
override fun execute(args: Array<String>) {
|
||||
try {
|
||||
val ingame = Terrarum.ingame!! as Ingame
|
||||
val player = (Terrarum.ingame!! as Ingame).actorNowPlaying
|
||||
val ingame = Terrarum.ingame!! as TerrarumIngame
|
||||
val player = (Terrarum.ingame!! as TerrarumIngame).actorNowPlaying
|
||||
if (player == null) return
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import net.torvald.terrarum.AppLoader
|
||||
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.modulebasegame.TerrarumIngame
|
||||
import net.torvald.terrarum.utils.JsonWriter
|
||||
import java.io.BufferedWriter
|
||||
import java.io.FileWriter
|
||||
@@ -20,7 +20,7 @@ internal object GsonTest : ConsoleCommand {
|
||||
val jsonBuilder = JsonWriter.getJsonBuilder()
|
||||
|
||||
|
||||
val jsonString = jsonBuilder.toJson((Terrarum.ingame!! as Ingame).actorNowPlaying)
|
||||
val jsonString = jsonBuilder.toJson((Terrarum.ingame!! as TerrarumIngame).actorNowPlaying)
|
||||
|
||||
//val avelem = Gson().toJson((Terrarum.ingame!! as Ingame).actorNowPlaying)
|
||||
//val jsonString = avelem.toString()
|
||||
|
||||
@@ -5,7 +5,7 @@ import net.torvald.terrarum.console.ConsoleCommand
|
||||
import net.torvald.terrarum.console.Echo
|
||||
import net.torvald.terrarum.console.EchoError
|
||||
import net.torvald.terrarum.itemproperties.ItemCodex
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.Pocketed
|
||||
|
||||
/**
|
||||
@@ -13,7 +13,7 @@ import net.torvald.terrarum.modulebasegame.gameactors.Pocketed
|
||||
*/
|
||||
internal object Inventory : ConsoleCommand {
|
||||
|
||||
private var target: Pocketed? = (Terrarum.ingame!! as Ingame).actorNowPlaying
|
||||
private var target: Pocketed? = (Terrarum.ingame!! as TerrarumIngame).actorNowPlaying
|
||||
|
||||
override fun execute(args: Array<String>) {
|
||||
if (args.size == 1) {
|
||||
|
||||
@@ -4,7 +4,6 @@ import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.console.ConsoleCommand
|
||||
import net.torvald.terrarum.console.Echo
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2016-06-16.
|
||||
|
||||
@@ -5,7 +5,7 @@ import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.console.ConsoleCommand
|
||||
import net.torvald.terrarum.console.Echo
|
||||
import net.torvald.terrarum.console.EchoError
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2016-01-15.
|
||||
@@ -63,7 +63,7 @@ internal object SetAV : ConsoleCommand {
|
||||
return
|
||||
}
|
||||
|
||||
val player = (Terrarum.ingame!! as Ingame).actorNowPlaying
|
||||
val player = (Terrarum.ingame!! as TerrarumIngame).actorNowPlaying
|
||||
if (player == null) {
|
||||
EchoError("Player does not exist")
|
||||
println("[SetAV] Player does not exist")
|
||||
|
||||
@@ -2,7 +2,7 @@ package net.torvald.terrarum.modulebasegame.console
|
||||
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.console.ConsoleCommand
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2016-01-23.
|
||||
@@ -11,7 +11,7 @@ internal object SetBulletin : ConsoleCommand {
|
||||
override fun execute(args: Array<String>) {
|
||||
//send(Lang["ERROR_SAVE_CORRUPTED"], Lang["MENU_LABEL_CONTINUE_QUESTION"])
|
||||
|
||||
(Terrarum.ingame!! as Ingame).sendNotification(args.sliceArray(1..args.lastIndex))
|
||||
(Terrarum.ingame!! as TerrarumIngame).sendNotification(args.sliceArray(1..args.lastIndex))
|
||||
println("sent notifinator")
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.console.ConsoleCommand
|
||||
import net.torvald.terrarum.console.Echo
|
||||
import net.torvald.terrarum.console.EchoError
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
import net.torvald.terrarum.gameactors.ActorWBMovable
|
||||
|
||||
/**
|
||||
@@ -14,7 +14,7 @@ internal object SetScale : ConsoleCommand {
|
||||
override fun execute(args: Array<String>) {
|
||||
if (args.size == 2 || args.size == 3) {
|
||||
try {
|
||||
val player = (Terrarum.ingame!! as Ingame).actorNowPlaying
|
||||
val player = (Terrarum.ingame!! as TerrarumIngame).actorNowPlaying
|
||||
if (player == null) return
|
||||
|
||||
|
||||
|
||||
@@ -4,14 +4,14 @@ import net.torvald.terrarum.modulebasegame.gameworld.WorldTime
|
||||
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.modulebasegame.TerrarumIngame
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2016-03-20.
|
||||
*/
|
||||
internal object SetTime : ConsoleCommand {
|
||||
override fun execute(args: Array<String>) {
|
||||
val world = (Terrarum.ingame!! as Ingame).gameworld
|
||||
val world = (Terrarum.ingame!! as TerrarumIngame).gameworld
|
||||
|
||||
|
||||
if (args.size == 2) {
|
||||
|
||||
@@ -3,7 +3,7 @@ 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.modulebasegame.TerrarumIngame
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2016-03-20.
|
||||
@@ -13,7 +13,7 @@ internal object SetTimeDelta : ConsoleCommand {
|
||||
val HARD_LIMIT = 60
|
||||
|
||||
override fun execute(args: Array<String>) {
|
||||
val world = (Terrarum.ingame!! as Ingame).gameworld
|
||||
val world = (Terrarum.ingame!! as TerrarumIngame).gameworld
|
||||
|
||||
|
||||
if (args.size == 2) {
|
||||
|
||||
@@ -4,7 +4,6 @@ import net.torvald.terrarum.modulebasegame.gameactors.PhysTestBall
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.console.ConsoleCommand
|
||||
import net.torvald.terrarum.console.Echo
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import org.dyn4j.geometry.Vector2
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,6 @@ 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.modulebasegame.gameactors.PhysTestLuarLander
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,6 @@ 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.modulebasegame.gameactors.FixtureTikiTorch
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,7 +5,7 @@ import net.torvald.terrarum.console.ConsoleCommand
|
||||
import net.torvald.terrarum.console.Echo
|
||||
import net.torvald.terrarum.console.EchoError
|
||||
import net.torvald.terrarum.gameactors.ActorWBMovable
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
import net.torvald.terrarum.worlddrawer.CreateTileAtlas
|
||||
|
||||
/**
|
||||
@@ -27,7 +27,7 @@ internal object Teleport : ConsoleCommand {
|
||||
return
|
||||
}
|
||||
|
||||
(Terrarum.ingame!! as Ingame).actorNowPlaying?.setPosition(x.toDouble(), y.toDouble())
|
||||
(Terrarum.ingame!! as TerrarumIngame).actorNowPlaying?.setPosition(x.toDouble(), y.toDouble())
|
||||
}
|
||||
else if (args.size == 4) {
|
||||
if (args[2].toLowerCase() != "to") {
|
||||
@@ -39,7 +39,7 @@ internal object Teleport : ConsoleCommand {
|
||||
try {
|
||||
val fromActorID = args[1].toInt()
|
||||
val targetActorID = if (args[3].toLowerCase() == "player") {
|
||||
val player = (Terrarum.ingame!! as Ingame).actorNowPlaying
|
||||
val player = (Terrarum.ingame!! as TerrarumIngame).actorNowPlaying
|
||||
if (player == null) {
|
||||
EchoError("Player does not exist")
|
||||
return
|
||||
|
||||
@@ -3,14 +3,14 @@ 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.modulebasegame.TerrarumIngame
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2016-01-19.
|
||||
*/
|
||||
internal object ToggleNoClip : ConsoleCommand {
|
||||
override fun execute(args: Array<String>) {
|
||||
val player = (Terrarum.ingame!! as Ingame).actorNowPlaying
|
||||
val player = (Terrarum.ingame!! as TerrarumIngame).actorNowPlaying
|
||||
if (player == null) return
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import net.torvald.terrarum.console.Echo
|
||||
import net.torvald.terrarum.gameactors.Actor
|
||||
import net.torvald.terrarum.gameactors.ActorValue
|
||||
import net.torvald.terrarum.gameactors.ActorWBMovable
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
import net.torvald.terrarum.modulebasegame.console.SetAV
|
||||
import net.torvald.terrarum.worlddrawer.CreateTileAtlas
|
||||
import java.awt.BorderLayout
|
||||
@@ -86,7 +86,7 @@ class ActorValueTracker constructor() : JFrame() {
|
||||
buttonChangeActor.addMouseListener(object : MouseAdapter() {
|
||||
override fun mousePressed(e: MouseEvent?) {
|
||||
if (actorIDField.text.toLowerCase() == "player") {
|
||||
actor = (Terrarum.ingame!! as Ingame).actorNowPlaying
|
||||
actor = (Terrarum.ingame!! as TerrarumIngame).actorNowPlaying
|
||||
actorValue = actor!!.actorValue
|
||||
}
|
||||
else if (actorIDField.text.isNotBlank()) {
|
||||
|
||||
@@ -11,7 +11,7 @@ import net.torvald.terrarum.gameitem.GameItem
|
||||
import net.torvald.terrarum.gameworld.GameWorld
|
||||
import net.torvald.terrarum.itemproperties.ItemCodex
|
||||
import net.torvald.terrarum.itemproperties.Material
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
import net.torvald.terrarum.modulebasegame.ui.UIInventoryFull
|
||||
import net.torvald.terrarum.realestate.LandUtil
|
||||
import net.torvald.terrarum.worlddrawer.LightmapRenderer
|
||||
@@ -588,8 +588,8 @@ open class ActorHumanoid(
|
||||
|
||||
// force update inventory UI, but when the pie menu is not open (pie menu constantly writes to the actorvalue, which will rebuildList()
|
||||
try {
|
||||
if (!(Terrarum.ingame!! as Ingame).uiPieMenu.isVisible) {
|
||||
((Terrarum.ingame!! as Ingame).uiInventoryPlayer as UIInventoryFull).rebuildList()
|
||||
if (!(Terrarum.ingame!! as TerrarumIngame).uiPieMenu.isVisible) {
|
||||
((Terrarum.ingame!! as TerrarumIngame).uiInventoryPlayer as UIInventoryFull).rebuildList()
|
||||
}
|
||||
}
|
||||
catch (LateInitMyArse: kotlin.UninitializedPropertyAccessException) {
|
||||
|
||||
@@ -11,7 +11,7 @@ import net.torvald.terrarum.itemproperties.ItemCodex.ITEM_DYNAMIC
|
||||
import net.torvald.terrarum.itemproperties.ItemCodex.ITEM_WALLS
|
||||
import net.torvald.terrarum.gameitem.ItemID
|
||||
import net.torvald.terrarum.lock
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
import net.torvald.terrarum.modulebasegame.ui.UIQuickslotBar
|
||||
import java.util.*
|
||||
import java.util.concurrent.locks.ReentrantLock
|
||||
@@ -67,8 +67,8 @@ class ActorInventory(@Transient val actor: Pocketed, var maxCapacity: Int, var c
|
||||
"These commands are NOT INTERCHANGEABLE; they handle things differently according to the context.")
|
||||
if (item.originalID == Terrarum.PLAYER_REF_ID || item.originalID == 0x51621D) // do not delete this magic
|
||||
throw IllegalArgumentException("Attempted to put human player into the inventory.")
|
||||
if (((Terrarum.ingame as? Ingame)?.gameFullyLoaded ?: false) &&
|
||||
(item.originalID == (Terrarum.ingame as? Ingame)?.actorNowPlaying?.referenceID))
|
||||
if (((Terrarum.ingame as? TerrarumIngame)?.gameFullyLoaded ?: false) &&
|
||||
(item.originalID == (Terrarum.ingame as? TerrarumIngame)?.actorNowPlaying?.referenceID))
|
||||
throw IllegalArgumentException("Attempted to put active player into the inventory.")
|
||||
if ((!item.stackable || item.dynamicID in ITEM_DYNAMIC) && count > 1)
|
||||
throw IllegalArgumentException("Attempting to adding stack of item but the item is not stackable; item: $item, count: $count")
|
||||
|
||||
@@ -3,7 +3,7 @@ package net.torvald.terrarum.modulebasegame.gameactors
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.gameactors.AVKey
|
||||
import net.torvald.terrarum.gameactors.Actor
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2016-02-03.
|
||||
@@ -11,7 +11,7 @@ import net.torvald.terrarum.modulebasegame.Ingame
|
||||
object PlayerBuilder {
|
||||
|
||||
operator fun invoke(): Actor {
|
||||
val world = (Terrarum.ingame!! as Ingame).gameworld
|
||||
val world = (Terrarum.ingame!! as TerrarumIngame).gameworld
|
||||
|
||||
val p: Actor = IngamePlayer("lol", "lol_glow", world.worldTime.TIME_T)
|
||||
InjectCreatureRaw(p.actorValue, "basegame", "CreatureHuman.json")
|
||||
|
||||
@@ -5,7 +5,7 @@ import net.torvald.terrarum.modulebasegame.gameactors.HumanoidNPC
|
||||
import net.torvald.terrarum.Second
|
||||
import net.torvald.terrarum.gameactors.Actor
|
||||
import net.torvald.terrarum.gameactors.ai.ActorAI
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
|
||||
/**
|
||||
* Slime's stupid AI but can adjust his jump power to smack you as fast as possible
|
||||
@@ -35,7 +35,7 @@ class SmarterSlimes : ActorAI {
|
||||
|
||||
|
||||
// TEST: just target player
|
||||
val player = (Terrarum.ingame!! as Ingame).actorNowPlaying
|
||||
val player = (Terrarum.ingame!! as TerrarumIngame).actorNowPlaying
|
||||
if (player == null) return
|
||||
|
||||
val playerXPos = player.centrePosPoint.x
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package net.torvald.terrarum.modulebasegame.gameactors.physicssolver
|
||||
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
import net.torvald.terrarum.gameactors.ActorWBMovable
|
||||
import java.util.*
|
||||
|
||||
@@ -39,7 +39,7 @@ object CollisionSolver {
|
||||
collCandidateY.clear()
|
||||
|
||||
// mark list x
|
||||
(Terrarum.ingame!! as Ingame).actorContainerActive.forEach { it ->
|
||||
(Terrarum.ingame!! as TerrarumIngame).actorContainerActive.forEach { it ->
|
||||
if (it is ActorWBMovable) {
|
||||
collListX.add(CollisionMarkings(it.hitbox.hitboxStart.x, STARTPOINT, it))
|
||||
collListX.add(CollisionMarkings(it.hitbox.hitboxEnd.x, ENDPOINT, it))
|
||||
@@ -72,7 +72,7 @@ object CollisionSolver {
|
||||
collCandidateStack.clear()
|
||||
|
||||
// mark list y
|
||||
(Terrarum.ingame!! as Ingame).actorContainerActive.forEach { it ->
|
||||
(Terrarum.ingame!! as TerrarumIngame).actorContainerActive.forEach { it ->
|
||||
if (it is ActorWBMovable) {
|
||||
collListY.add(CollisionMarkings(it.hitbox.hitboxStart.y, STARTPOINT, it))
|
||||
collListY.add(CollisionMarkings(it.hitbox.hitboxEnd.y, ENDPOINT, it))
|
||||
|
||||
@@ -7,7 +7,7 @@ import net.torvald.terrarum.gameactors.ActorWBMovable
|
||||
import net.torvald.terrarum.gameitem.GameItem
|
||||
import net.torvald.terrarum.gameworld.GameWorld
|
||||
import net.torvald.terrarum.itemproperties.ItemCodex
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
import net.torvald.terrarum.modulebasegame.IngameRenderer
|
||||
import net.torvald.terrarum.realestate.LandUtil
|
||||
|
||||
@@ -21,7 +21,7 @@ object BlockBase {
|
||||
* for wire items, otherwise you want it to be true.
|
||||
*/
|
||||
fun blockStartPrimaryUse(gameItem: GameItem, itemID: Int, delta: Float): Boolean {
|
||||
val ingame = Terrarum.ingame!! as Ingame
|
||||
val ingame = Terrarum.ingame!! as TerrarumIngame
|
||||
val mousePoint = Point2d(Terrarum.mouseTileX.toDouble(), Terrarum.mouseTileY.toDouble())
|
||||
val mouseTile = Point2i(Terrarum.mouseTileX, Terrarum.mouseTileY)
|
||||
|
||||
@@ -74,7 +74,7 @@ object BlockBase {
|
||||
}
|
||||
|
||||
fun wireStartPrimaryUse(gameItem: GameItem, wireTypeBit: Int, delta: Float): Boolean {
|
||||
val ingame = Terrarum.ingame!! as Ingame
|
||||
val ingame = Terrarum.ingame!! as TerrarumIngame
|
||||
val mouseTile = Point2i(Terrarum.mouseTileX, Terrarum.mouseTileY)
|
||||
|
||||
// return false if the tile is already there
|
||||
|
||||
@@ -11,7 +11,7 @@ import net.torvald.terrarum.gameitem.GameItem
|
||||
import net.torvald.terrarum.gameitem.ItemID
|
||||
import net.torvald.terrarum.itemproperties.Calculate
|
||||
import net.torvald.terrarum.itemproperties.MaterialCodex
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
import net.torvald.terrarum.modulebasegame.gameitems.PickaxeCore.BASE_MASS_AND_SIZE
|
||||
import net.torvald.terrarum.modulebasegame.gameitems.PickaxeCore.TOOL_DURABILITY_BASE
|
||||
import net.torvald.terrarumsansbitmap.gdx.TextureRegionPack
|
||||
@@ -22,7 +22,7 @@ import kotlin.math.roundToInt
|
||||
*/
|
||||
object PickaxeCore {
|
||||
fun startPrimaryUse(delta: Float, item: GameItem): Boolean {
|
||||
val player = (Terrarum.ingame!! as Ingame).actorNowPlaying
|
||||
val player = (Terrarum.ingame!! as TerrarumIngame).actorNowPlaying
|
||||
if (player == null) return false
|
||||
|
||||
val mouseTileX = Terrarum.mouseTileX
|
||||
@@ -58,7 +58,7 @@ object PickaxeCore {
|
||||
}
|
||||
|
||||
fun endPrimaryUse(delta: Float, item: GameItem): Boolean {
|
||||
val player = (Terrarum.ingame!! as Ingame).actorNowPlaying
|
||||
val player = (Terrarum.ingame!! as TerrarumIngame).actorNowPlaying
|
||||
if (player == null) return false
|
||||
|
||||
item.using = false
|
||||
|
||||
@@ -12,7 +12,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
override var height: Int = 0
|
||||
|
||||
private var fontCol: Color = if (!isBlackVariant) Color.BLACK else Color.WHITE
|
||||
private val GLYPH_HEIGHT = Terrarum.fontGame.lineHeight
|
||||
private val GLYPH_HEIGHT = AppLoader.fontGame.lineHeight
|
||||
|
||||
override var openCloseTime: Second = OPEN_CLOSE_TIME
|
||||
|
||||
@@ -29,7 +29,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
blendNormal(batch)
|
||||
|
||||
val textWidth = messagesList.map { Terrarum.fontGame.getWidth(it) }.sorted()[1]
|
||||
val textWidth = messagesList.map { AppLoader.fontGame.getWidth(it) }.sorted()[1]
|
||||
|
||||
batch.color = Color.WHITE
|
||||
|
||||
@@ -38,7 +38,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
batch.draw(segment.get(2, 0), 2 * LRmargin + textWidth, 0f)
|
||||
|
||||
messagesList.forEachIndexed { index, s ->
|
||||
Terrarum.fontGame.draw(batch, s, segment.tileW + LRmargin, (segment.tileH - Terrarum.fontGame.lineHeight) / 2f)
|
||||
AppLoader.fontGame.draw(batch, s, segment.tileW + LRmargin, (segment.tileH - AppLoader.fontGame.lineHeight) / 2f)
|
||||
}
|
||||
|
||||
AppLoader.printdbg(this, "render")
|
||||
|
||||
@@ -56,15 +56,15 @@ class Notification : UICanvas() {
|
||||
fontCol.a = handler.opacity
|
||||
|
||||
val realTextWidth = 12 + if (message.size == 1)
|
||||
Terrarum.fontGame.getWidth(message[0])
|
||||
AppLoader.fontGame.getWidth(message[0])
|
||||
else
|
||||
message.map { Terrarum.fontGame.getWidth(it) }.sorted().last()
|
||||
message.map { AppLoader.fontGame.getWidth(it) }.sorted().last()
|
||||
val displayedTextWidth = maxOf(240, realTextWidth)
|
||||
|
||||
// force the UI to the centre of the screen
|
||||
this.posX = (Terrarum.WIDTH - displayedTextWidth) / 2
|
||||
|
||||
val textHeight = message.size * Terrarum.fontGame.lineHeight
|
||||
val textHeight = message.size * AppLoader.fontGame.lineHeight
|
||||
|
||||
batch.color = drawColor
|
||||
|
||||
@@ -73,8 +73,8 @@ class Notification : UICanvas() {
|
||||
batch.color = fontCol
|
||||
message.forEachIndexed { index, s ->
|
||||
val xoff = 6 + (displayedTextWidth - realTextWidth) / 2
|
||||
val y = -textHeight + Terrarum.fontGame.lineHeight * index
|
||||
Terrarum.fontGame.draw(batch, s, LRmargin + xoff, y)
|
||||
val y = -textHeight + AppLoader.fontGame.lineHeight * index
|
||||
AppLoader.fontGame.draw(batch, s, LRmargin + xoff, y)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.ActorHumanoid
|
||||
import net.torvald.terrarum.modulebasegame.imagefont.Watch7SegSmall
|
||||
import net.torvald.terrarum.modulebasegame.imagefont.WatchFont
|
||||
@@ -52,7 +52,7 @@ class UIBasicInfo(private val player: ActorHumanoid?) : UICanvas() {
|
||||
get() {
|
||||
if (player != null) {
|
||||
val playerTilePos = player.hIntTilewiseHitbox
|
||||
val tempCelsius = -273f + ((Terrarum.ingame as? Ingame)?.world?.getTemperature(playerTilePos.centeredX.toInt(), playerTilePos.centeredY.toInt()) ?: 288f)
|
||||
val tempCelsius = -273f + ((Terrarum.ingame as? TerrarumIngame)?.world?.getTemperature(playerTilePos.centeredX.toInt(), playerTilePos.centeredY.toInt()) ?: 288f)
|
||||
|
||||
return if (tempCelsius < -10)
|
||||
0
|
||||
|
||||
@@ -3,9 +3,10 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.Second
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.fillRect
|
||||
import net.torvald.terrarum.Second
|
||||
import net.torvald.terrarum.langpack.Lang
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
|
||||
@@ -37,10 +38,10 @@ class UICheatDetected : UICanvas() {
|
||||
|
||||
batch.color = Color.WHITE
|
||||
val txt = Lang["ERROR_GENERIC_CHEATING"]
|
||||
val txtW = Terrarum.fontGame.getWidth(txt)
|
||||
val txtH = Terrarum.fontGame.lineHeight.toInt()
|
||||
val txtW = AppLoader.fontGame.getWidth(txt)
|
||||
val txtH = AppLoader.fontGame.lineHeight.toInt()
|
||||
|
||||
Terrarum.fontGame.draw(batch, txt, width.minus(txtW).ushr(1).toFloat(), height.minus(txtH).ushr(1).toFloat())
|
||||
AppLoader.fontGame.draw(batch, txt, width.minus(txtW).ushr(1).toFloat(), height.minus(txtH).ushr(1).toFloat())
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
|
||||
@@ -47,7 +47,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
val itemStripGutterH = 8
|
||||
val itemInterColGutter = 8
|
||||
|
||||
val controlHelpHeight = Terrarum.fontGame.lineHeight.toInt()
|
||||
val controlHelpHeight = AppLoader.fontGame.lineHeight.toInt()
|
||||
|
||||
val pageButtonExtraGap = 32
|
||||
|
||||
@@ -239,16 +239,16 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
blendNormal()
|
||||
batch.color = defaultTextColour
|
||||
// W - close
|
||||
Terrarum.fontGame.draw(batch, listControlClose, 4f, height - controlHelpHeight.toFloat())
|
||||
AppLoader.fontGame.draw(batch, listControlClose, 4f, height - controlHelpHeight.toFloat())
|
||||
// MouseL - Use ; 1.9 - Register ; T - Drop
|
||||
Terrarum.fontGame.draw(batch, listControlHelp, catButtons.width + 4f, height - controlHelpHeight.toFloat())
|
||||
AppLoader.fontGame.draw(batch, listControlHelp, catButtons.width + 4f, height - controlHelpHeight.toFloat())
|
||||
// encumbrance
|
||||
if (inventory != null) {
|
||||
val encumbranceText = Lang["GAME_INVENTORY_ENCUMBRANCE"]
|
||||
|
||||
Terrarum.fontGame.draw(batch,
|
||||
AppLoader.fontGame.draw(batch,
|
||||
encumbranceText,
|
||||
width - 9 - Terrarum.fontGame.getWidth(encumbranceText) - weightBarWidth,
|
||||
width - 9 - AppLoader.fontGame.getWidth(encumbranceText) - weightBarWidth,
|
||||
height - controlHelpHeight.toFloat()
|
||||
)
|
||||
|
||||
|
||||
@@ -6,22 +6,12 @@ import com.badlogic.gdx.graphics.*
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import com.badlogic.gdx.graphics.glutils.FrameBuffer
|
||||
import com.badlogic.gdx.graphics.glutils.ShapeRenderer
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.AppLoader.IS_DEVELOPMENT_BUILD
|
||||
import net.torvald.terrarum.AppLoader.printdbg
|
||||
import net.torvald.terrarum.AppLoader.gamepadLabelEast
|
||||
import net.torvald.terrarum.AppLoader.gamepadLabelLStick
|
||||
import net.torvald.terrarum.AppLoader.gamepadLabelLT
|
||||
import net.torvald.terrarum.AppLoader.gamepadLabelNorth
|
||||
import net.torvald.terrarum.AppLoader.gamepadLabelRStick
|
||||
import net.torvald.terrarum.AppLoader.gamepadLabelRT
|
||||
import net.torvald.terrarum.AppLoader.gamepadLabelStart
|
||||
import net.torvald.terrarum.AppLoader.gamepadLabelWest
|
||||
import net.torvald.terrarum.AppLoader.*
|
||||
import net.torvald.terrarum.blockstats.MinimapComposer
|
||||
import net.torvald.terrarum.gameactors.ActorWBMovable
|
||||
import net.torvald.terrarum.langpack.Lang
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.ActorInventory.Companion.CAPACITY_MODE_NO_ENCUMBER
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.Pocketed
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
@@ -87,7 +77,7 @@ class UIInventoryFull(
|
||||
else
|
||||
"$gamepadLabelStart ${Lang["GAME_ACTION_CLOSE"]}$SP" +
|
||||
"$gamepadLabelLT ${Lang["GAME_INVENTORY"]}"
|
||||
val controlHelpHeight = Terrarum.fontGame.lineHeight
|
||||
val controlHelpHeight = AppLoader.fontGame.lineHeight
|
||||
|
||||
private var encumbrancePerc = 0f
|
||||
private var isEncumbered = false
|
||||
@@ -194,7 +184,7 @@ class UIInventoryFull(
|
||||
// make gameMenuButtons work
|
||||
gameMenuButtons.selectionChangeListener = { old, new ->
|
||||
if (new == 0) {
|
||||
Terrarum.setScreen(TitleScreen(Terrarum.batch))
|
||||
AppLoader.setScreen(TitleScreen(Terrarum.batch))
|
||||
}
|
||||
else if (new == 1) {
|
||||
Gdx.app.exit()
|
||||
@@ -441,7 +431,7 @@ class UIInventoryFull(
|
||||
batch.begin()
|
||||
|
||||
|
||||
Terrarum.fontSmallNumbers.draw(batch, "$minimapPanX, $minimapPanY; x$minimapZoom", minimapScrOffX + (Terrarum.WIDTH - MINIMAP_WIDTH) / 2, -10f + itemList.posY)
|
||||
AppLoader.fontSmallNumbers.draw(batch, "$minimapPanX, $minimapPanY; x$minimapZoom", minimapScrOffX + (Terrarum.WIDTH - MINIMAP_WIDTH) / 2, -10f + itemList.posY)
|
||||
|
||||
|
||||
batch.projectionMatrix = camera.combined
|
||||
@@ -451,7 +441,7 @@ class UIInventoryFull(
|
||||
|
||||
// control hints
|
||||
batch.color = Color.WHITE
|
||||
Terrarum.fontGame.draw(batch, minimapControlHelp, offsetX + minimapScrOffX, yEnd - 20)
|
||||
AppLoader.fontGame.draw(batch, minimapControlHelp, offsetX + minimapScrOffX, yEnd - 20)
|
||||
|
||||
// the minimap
|
||||
batch.draw(minimapFBO.colorBufferTexture, minimapScrOffX + (Terrarum.WIDTH - MINIMAP_WIDTH) / 2, itemList.posY.toFloat())
|
||||
@@ -461,7 +451,7 @@ class UIInventoryFull(
|
||||
// control hints
|
||||
blendNormal(batch)
|
||||
batch.color = Color.WHITE
|
||||
Terrarum.fontGame.draw(batch, gameMenuControlHelp, offsetX + menuScrOffX, yEnd - 20)
|
||||
AppLoader.fontGame.draw(batch, gameMenuControlHelp, offsetX + menuScrOffX, yEnd - 20)
|
||||
|
||||
// text buttons
|
||||
gameMenuButtons.render(batch, camera)
|
||||
@@ -475,15 +465,15 @@ class UIInventoryFull(
|
||||
// control hints
|
||||
blendNormal(batch)
|
||||
batch.color = Color.WHITE
|
||||
Terrarum.fontGame.draw(batch, listControlHelp, offsetX + inventoryScrOffX, yEnd - 20)
|
||||
AppLoader.fontGame.draw(batch, listControlHelp, offsetX + inventoryScrOffX, yEnd - 20)
|
||||
|
||||
|
||||
// encumbrance meter
|
||||
val encumbranceText = Lang["GAME_INVENTORY_ENCUMBRANCE"]
|
||||
|
||||
Terrarum.fontGame.draw(batch,
|
||||
AppLoader.fontGame.draw(batch,
|
||||
encumbranceText,
|
||||
xEnd - 6 - Terrarum.fontGame.getWidth(encumbranceText) - weightBarWidth + inventoryScrOffX,
|
||||
xEnd - 6 - AppLoader.fontGame.getWidth(encumbranceText) - weightBarWidth + inventoryScrOffX,
|
||||
yEnd-20
|
||||
)
|
||||
|
||||
@@ -514,7 +504,7 @@ class UIInventoryFull(
|
||||
if (IS_DEVELOPMENT_BUILD) {
|
||||
AppLoader.fontSmallNumbers.draw(batch,
|
||||
"${actor.inventory.capacity}/${actor.inventory.maxCapacity}",
|
||||
xEnd - 6 - Terrarum.fontGame.getWidth(encumbranceText) - weightBarWidth + inventoryScrOffX,
|
||||
xEnd - 6 - AppLoader.fontGame.getWidth(encumbranceText) - weightBarWidth + inventoryScrOffX,
|
||||
yEnd-20 + 3f + controlHelpHeight - 4f
|
||||
)
|
||||
}
|
||||
@@ -554,18 +544,18 @@ class UIInventoryFull(
|
||||
|
||||
|
||||
override fun doOpening(delta: Float) {
|
||||
(Terrarum.ingame as? Ingame)?.setTooltipMessage(null)
|
||||
(Terrarum.ingame as? TerrarumIngame)?.setTooltipMessage(null)
|
||||
}
|
||||
|
||||
override fun doClosing(delta: Float) {
|
||||
(Terrarum.ingame as? Ingame)?.setTooltipMessage(null)
|
||||
(Terrarum.ingame as? TerrarumIngame)?.setTooltipMessage(null)
|
||||
}
|
||||
|
||||
override fun endOpening(delta: Float) {
|
||||
}
|
||||
|
||||
override fun endClosing(delta: Float) {
|
||||
(Terrarum.ingame as? Ingame)?.setTooltipMessage(null) // required!
|
||||
(Terrarum.ingame as? TerrarumIngame)?.setTooltipMessage(null) // required!
|
||||
|
||||
MinimapComposer.revalidateAll()
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.gameworld.fmod
|
||||
import net.torvald.terrarum.gameitem.GameItem
|
||||
import net.torvald.terrarum.itemproperties.ItemCodex
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.ActorInventory
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.InventoryPair
|
||||
import net.torvald.terrarum.modulebasegame.ui.ItemSlotImageFactory.CELLCOLOUR_BLACK
|
||||
@@ -287,7 +287,7 @@ class UIItemInventoryDynamicList(
|
||||
|
||||
// set tooltip accordingly
|
||||
if (isCompactMode && it.mouseUp && !tooltipSet) {
|
||||
(Terrarum.ingame as? Ingame)?.setTooltipMessage(
|
||||
(Terrarum.ingame as? TerrarumIngame)?.setTooltipMessage(
|
||||
if (AppLoader.IS_DEVELOPMENT_BUILD) {
|
||||
it.item?.name + "/Mat: ${it.item?.material?.identifier}"
|
||||
}
|
||||
@@ -300,7 +300,7 @@ class UIItemInventoryDynamicList(
|
||||
}
|
||||
|
||||
if (!tooltipSet) {
|
||||
(Terrarum.ingame as? Ingame)?.setTooltipMessage(null)
|
||||
(Terrarum.ingame as? TerrarumIngame)?.setTooltipMessage(null)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,10 +2,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.blendNormal
|
||||
import net.torvald.terrarum.blendScreen
|
||||
import net.torvald.terrarum.fillRect
|
||||
import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.langpack.Lang
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.IngamePlayer
|
||||
import net.torvald.terrarum.serialise.ReadWorldInfo
|
||||
@@ -45,7 +42,7 @@ class UIItemPlayerInfoCell(
|
||||
private val backColInactive = ItemSlotImageFactory.CELLCOLOUR_BLACK
|
||||
private val backColActive = ItemSlotImageFactory.CELLCOLOUR_BLACK_ACTIVE
|
||||
|
||||
private val textRow1 = (((height / 2) - Terrarum.fontGame.lineHeight) / 2).toFloat()
|
||||
private val textRow1 = (((height / 2) - AppLoader.fontGame.lineHeight) / 2).toFloat()
|
||||
private val textRow2 = textRow1 + (height / 2)
|
||||
|
||||
private val creationTimeStr: String
|
||||
@@ -69,7 +66,7 @@ class UIItemPlayerInfoCell(
|
||||
|
||||
|
||||
worldCountStr = Lang["CONTEXT_WORLD_COUNT"] + saveInfo.worldCount
|
||||
worldCountStrWidth = Terrarum.fontGame.getWidth(worldCountStr)
|
||||
worldCountStrWidth = AppLoader.fontGame.getWidth(worldCountStr)
|
||||
}
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: Camera) {
|
||||
@@ -109,15 +106,15 @@ class UIItemPlayerInfoCell(
|
||||
|
||||
// name
|
||||
batch.color = Color.WHITE
|
||||
Terrarum.fontGame.draw(batch, saveInfo.playerName, spriteAreaWidth + spriteToNameAreaGap.toFloat(), textRow1)
|
||||
AppLoader.fontGame.draw(batch, saveInfo.playerName, spriteAreaWidth + spriteToNameAreaGap.toFloat(), textRow1)
|
||||
// creation and modification time
|
||||
Terrarum.fontGame.draw(batch, "$creationTimeStr/$modificationTimeStr", spriteAreaWidth + spriteToNameAreaGap.toFloat(), textRow2)
|
||||
AppLoader.fontGame.draw(batch, "$creationTimeStr/$modificationTimeStr", spriteAreaWidth + spriteToNameAreaGap.toFloat(), textRow2)
|
||||
// world count
|
||||
Terrarum.fontGame.draw(batch, worldCountStr, width - (edgeGap + worldCountStrWidth).toFloat(), textRow1)
|
||||
AppLoader.fontGame.draw(batch, worldCountStr, width - (edgeGap + worldCountStrWidth).toFloat(), textRow1)
|
||||
// wallet
|
||||
val walletStr = "¤ " + (ingamePlayer?.inventory?.wallet ?: saveInfo.playerWallet)
|
||||
val walletStrWidth = Terrarum.fontGame.getWidth(walletStr)
|
||||
Terrarum.fontGame.draw(batch, walletStr, width - (edgeGap + walletStrWidth).toFloat(), textRow2)
|
||||
val walletStrWidth = AppLoader.fontGame.getWidth(walletStr)
|
||||
AppLoader.fontGame.draw(batch, walletStr, width - (edgeGap + walletStrWidth).toFloat(), textRow2)
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
import net.torvald.terrarum.ui.UIItem
|
||||
@@ -24,7 +25,7 @@ class UIItemSavegameInfoCell(
|
||||
override var oldPosX = posX
|
||||
override var oldPosY = posY
|
||||
|
||||
override val height: Int = Terrarum.fontGame.lineHeight.toInt() * 2
|
||||
override val height: Int = AppLoader.fontGame.lineHeight.toInt() * 2
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: Camera) {
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.Pixmap
|
||||
import com.badlogic.gdx.graphics.Texture
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.blendNormal
|
||||
import net.torvald.terrarum.blockproperties.Block
|
||||
import net.torvald.terrarum.fillRect
|
||||
@@ -26,7 +26,7 @@ class UIPaletteSelector(val parent: BuildingMaker) : UICanvas() {
|
||||
|
||||
val LINE_HEIGHT = 24
|
||||
val TEXT_OFFSETX = 3f
|
||||
val TEXT_OFFSETY = (LINE_HEIGHT - Terrarum.fontGame.lineHeight) / 2f
|
||||
val TEXT_OFFSETY = (LINE_HEIGHT - AppLoader.fontGame.lineHeight) / 2f
|
||||
|
||||
fun mouseOnTitleBar() =
|
||||
relativeMouseX in 0 until width && relativeMouseY in 0 until LINE_HEIGHT
|
||||
@@ -78,7 +78,7 @@ class UIPaletteSelector(val parent: BuildingMaker) : UICanvas() {
|
||||
|
||||
// draw "Pal."
|
||||
batch.color = UINSMenu.DEFAULT_TITLETEXTCOL
|
||||
Terrarum.fontGame.draw(batch, titleText, TEXT_OFFSETX, TEXT_OFFSETY)
|
||||
AppLoader.fontGame.draw(batch, titleText, TEXT_OFFSETX, TEXT_OFFSETY)
|
||||
|
||||
// draw background
|
||||
batch.color = CELLCOLOUR_BLACK
|
||||
@@ -89,7 +89,7 @@ class UIPaletteSelector(val parent: BuildingMaker) : UICanvas() {
|
||||
// TODO carve the overlap
|
||||
batch.draw(ItemCodex.getItemImage(back), 14f, 41f)
|
||||
batch.draw(ItemCodex.getItemImage(fore), 6f, 33f)
|
||||
Terrarum.fontSmallNumbers.draw(batch, fore.toString(), 3f, 61f)
|
||||
AppLoader.fontSmallNumbers.draw(batch, fore.toString(), 3f, 61f)
|
||||
|
||||
// draw swap icon
|
||||
batch.color = Color.WHITE
|
||||
|
||||
@@ -2,12 +2,11 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.random.HQRNG
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.LoadScreen
|
||||
import net.torvald.terrarum.Second
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.modulebasegame.BuildingMaker
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
|
||||
/**
|
||||
@@ -35,9 +34,9 @@ class UIProxyNewBuildingMaker : UICanvas() {
|
||||
override fun endOpening(delta: Float) {
|
||||
val ingame = BuildingMaker(Terrarum.batch)
|
||||
|
||||
Terrarum.ingame = ingame
|
||||
Terrarum.setCurrentIngameInstance(ingame)
|
||||
LoadScreen.screenToLoad = ingame
|
||||
Terrarum.setScreen(LoadScreen)
|
||||
AppLoader.setScreen(LoadScreen)
|
||||
}
|
||||
|
||||
override fun endClosing(delta: Float) {
|
||||
|
||||
@@ -3,10 +3,12 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.random.HQRNG
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.AppLoader.printdbg
|
||||
import net.torvald.terrarum.LoadScreen
|
||||
import net.torvald.terrarum.Second
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
|
||||
/**
|
||||
@@ -32,14 +34,17 @@ class UIProxyNewRandomGame : UICanvas() {
|
||||
}
|
||||
|
||||
override fun endOpening(delta: Float) {
|
||||
val ingame = Ingame(Terrarum.batch)
|
||||
ingame.gameLoadInfoPayload = Ingame.NewWorldParameters(2400, 800, HQRNG().nextLong())
|
||||
//ingame.gameLoadInfoPayload = Ingame.NewWorldParameters(8192, 2048, 0x51621DL)
|
||||
ingame.gameLoadMode = Ingame.GameLoadMode.CREATE_NEW
|
||||
printdbg(this, "endOpening")
|
||||
|
||||
Terrarum.ingame = ingame
|
||||
|
||||
val ingame = TerrarumIngame(AppLoader.batch)
|
||||
ingame.gameLoadInfoPayload = TerrarumIngame.NewWorldParameters(2400, 800, HQRNG().nextLong())
|
||||
//ingame.gameLoadInfoPayload = Ingame.NewWorldParameters(8192, 2048, 0x51621DL)
|
||||
ingame.gameLoadMode = TerrarumIngame.GameLoadMode.CREATE_NEW
|
||||
|
||||
Terrarum.setCurrentIngameInstance(ingame)
|
||||
LoadScreen.screenToLoad = ingame
|
||||
Terrarum.setScreen(LoadScreen)
|
||||
AppLoader.setScreen(LoadScreen)
|
||||
}
|
||||
|
||||
override fun endClosing(delta: Float) {
|
||||
|
||||
@@ -3,12 +3,13 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.Second
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.gameactors.AVKey
|
||||
import net.torvald.terrarum.gameworld.fmod
|
||||
import net.torvald.terrarum.itemproperties.ItemCodex
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
|
||||
/**
|
||||
@@ -21,15 +22,15 @@ class UIQuickslotBar : UICanvas() {
|
||||
|
||||
private val gutter = 10 - 6 // do -6 to get a gutter size of not-enlarged cells
|
||||
override var width: Int = cellSize * SLOT_COUNT + gutter * (SLOT_COUNT - 1) // 452
|
||||
override var height: Int = ItemSlotImageFactory.slotImage.tileH + 4 + Terrarum.fontGame.lineHeight.toInt()
|
||||
override var height: Int = ItemSlotImageFactory.slotImage.tileH + 4 + AppLoader.fontGame.lineHeight.toInt()
|
||||
/**
|
||||
* In milliseconds
|
||||
*/
|
||||
override var openCloseTime: Second = COMMON_OPEN_CLOSE
|
||||
|
||||
private var selection: Int
|
||||
get() = (Terrarum.ingame!! as Ingame).actorNowPlaying?.actorValue?.getAsInt(AVKey.__PLAYER_QUICKSLOTSEL) ?: 0
|
||||
set(value) { (Terrarum.ingame!! as Ingame).actorNowPlaying?.actorValue?.set(AVKey.__PLAYER_QUICKSLOTSEL, value.fmod(SLOT_COUNT)) }
|
||||
get() = (Terrarum.ingame!! as TerrarumIngame).actorNowPlaying?.actorValue?.getAsInt(AVKey.__PLAYER_QUICKSLOTSEL) ?: 0
|
||||
set(value) { (Terrarum.ingame!! as TerrarumIngame).actorNowPlaying?.actorValue?.set(AVKey.__PLAYER_QUICKSLOTSEL, value.fmod(SLOT_COUNT)) }
|
||||
|
||||
|
||||
companion object {
|
||||
@@ -47,7 +48,7 @@ class UIQuickslotBar : UICanvas() {
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
|
||||
for (i in 0..SLOT_COUNT - 1) {
|
||||
val item = ItemCodex[(Terrarum.ingame!! as Ingame).actorNowPlaying?.inventory?.getQuickslot(i)?.item]
|
||||
val item = ItemCodex[(Terrarum.ingame!! as TerrarumIngame).actorNowPlaying?.inventory?.getQuickslot(i)?.item]
|
||||
|
||||
val image = if (i == selection)
|
||||
ItemSlotImageFactory.produceLarge(false, (i + 1) % SLOT_COUNT, item)
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.badlogic.gdx.Input
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.AppLoader.printdbgerr
|
||||
import net.torvald.terrarum.QNDTreeNode
|
||||
import net.torvald.terrarum.Terrarum
|
||||
@@ -299,6 +300,6 @@ open class UIRemoCon(treeRepresentation: QNDTreeNode<String>) : UICanvas() {
|
||||
val remoConWidth = 304
|
||||
fun getRemoConHeight(menu: ArrayList<String>) = DEFAULT_LINE_HEIGHT * menu.size.plus(1)
|
||||
fun getRemoConHeight(menu: Array<String>) = DEFAULT_LINE_HEIGHT * menu.size.plus(1)
|
||||
val menubarOffY: Int; get() = Terrarum.HEIGHT / 2 - (Terrarum.fontGame.lineHeight * 1.5).toInt()
|
||||
val menubarOffY: Int; get() = Terrarum.HEIGHT / 2 - (AppLoader.fontGame.lineHeight * 1.5).toInt()
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
val remoConWidth = 240
|
||||
fun getRemoConHeight(menu: ArrayList<String>) = 36 * menu.size.plus(1)
|
||||
fun getRemoConHeight(menu: Array<String>) = 36 * menu.size.plus(1)
|
||||
val menubarOffY: Int; get() = Terrarum.HEIGHT / 2 - (Terrarum.fontGame.lineHeight * 1.5).toInt()
|
||||
val menubarOffY: Int; get() = Terrarum.HEIGHT / 2 - (AppLoader.fontGame.lineHeight * 1.5).toInt()
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
(Terrarum.ingame!! as Ingame).gameLoadInfoPayload = Ingame.NewWorldParameters(2400, 800, HQRNG().nextLong())
|
||||
(Terrarum.ingame!! as Ingame).gameLoadMode = Ingame.GameLoadMode.CREATE_NEW
|
||||
LoadScreen.screenToLoad = (Terrarum.ingame!! as Ingame)
|
||||
Terrarum.setScreen(LoadScreen)
|
||||
AppLoader.setScreen(LoadScreen)
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
val maker = BuildingMaker(Terrarum.batch)
|
||||
Terrarum.ingame = maker
|
||||
Terrarum.setScreen(maker)
|
||||
AppLoader.setScreen(maker)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.Second
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
@@ -20,7 +21,7 @@ class UITooltip : UICanvas() {
|
||||
msgWidth = font.getWidth(value)
|
||||
}
|
||||
|
||||
private val font = Terrarum.fontGame
|
||||
private val font = AppLoader.fontGame
|
||||
private var msgWidth = 0
|
||||
|
||||
val textMarginX = 4
|
||||
|
||||
@@ -8,7 +8,7 @@ import net.torvald.terrarum.Second
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.gameactors.AVKey
|
||||
import net.torvald.terrarum.itemproperties.ItemCodex
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
import net.torvald.terrarum.modulebasegame.ui.UIQuickslotBar.Companion.COMMON_OPEN_CLOSE
|
||||
import net.torvald.terrarum.modulebasegame.ui.UIQuickslotBar.Companion.SLOT_COUNT
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
@@ -40,8 +40,8 @@ class uiQuickslotPie : UICanvas() {
|
||||
var selection: Int = -1
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
if (selection >= 0 && (Terrarum.ingame!! as Ingame).actorNowPlaying != null)
|
||||
(Terrarum.ingame!! as Ingame).actorNowPlaying!!.actorValue[AVKey.__PLAYER_QUICKSLOTSEL] =
|
||||
if (selection >= 0 && (Terrarum.ingame!! as TerrarumIngame).actorNowPlaying != null)
|
||||
(Terrarum.ingame!! as TerrarumIngame).actorNowPlaying!!.actorValue[AVKey.__PLAYER_QUICKSLOTSEL] =
|
||||
selection % slotCount
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ class uiQuickslotPie : UICanvas() {
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
// draw radial thingies
|
||||
for (i in 0..slotCount - 1) {
|
||||
val item = ItemCodex[(Terrarum.ingame!! as Ingame).actorNowPlaying?.inventory?.getQuickslot(i)?.item]
|
||||
val item = ItemCodex[(Terrarum.ingame!! as TerrarumIngame).actorNowPlaying?.inventory?.getQuickslot(i)?.item]
|
||||
|
||||
// set position
|
||||
val angle = Math.PI * 2.0 * (i.toDouble() / slotCount) + Math.PI // 180 deg monitor-wise
|
||||
|
||||
@@ -12,7 +12,7 @@ import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.gameactors.ActorWithBody
|
||||
import net.torvald.terrarum.gamecontroller.KeyToggler
|
||||
import net.torvald.terrarum.gameworld.GameWorld
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
import net.torvald.terrarum.modulebasegame.IngameRenderer
|
||||
import net.torvald.terrarum.modulebasegame.RNGConsumer
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.ParticleMegaRain
|
||||
@@ -96,7 +96,7 @@ internal object WeatherMixer : RNGConsumer {
|
||||
|
||||
|
||||
// test rain toggled by F2
|
||||
if (KeyToggler.isOn(Input.Keys.F2) && Terrarum.ingame is Ingame) {
|
||||
if (KeyToggler.isOn(Input.Keys.F2) && Terrarum.ingame is TerrarumIngame) {
|
||||
val playerPosX = player.hitbox.centeredX
|
||||
val playerPosY = player.hitbox.centeredY
|
||||
kotlin.repeat(7) {
|
||||
@@ -104,7 +104,7 @@ internal object WeatherMixer : RNGConsumer {
|
||||
playerPosX + HQRNG().nextInt(Terrarum.WIDTH) - Terrarum.HALFW,
|
||||
playerPosY - Terrarum.HEIGHT
|
||||
)
|
||||
(Terrarum.ingame!! as Ingame).addParticle(rainParticle)
|
||||
(Terrarum.ingame!! as TerrarumIngame).addParticle(rainParticle)
|
||||
}
|
||||
//globalLightNow.set(getGlobalLightOfTime((Terrarum.ingame!!.world).time.todaySeconds).mul(0.3f, 0.3f, 0.3f, 0.58f))
|
||||
}
|
||||
|
||||
@@ -4,9 +4,9 @@ import com.jme3.math.FastMath
|
||||
import com.sudoplay.joise.Joise
|
||||
import com.sudoplay.joise.module.*
|
||||
import net.torvald.random.HQRNG
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.AppLoader.printdbg
|
||||
import net.torvald.terrarum.LoadScreen
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.blockproperties.Block
|
||||
import net.torvald.terrarum.blockproperties.BlockCodex
|
||||
import net.torvald.terrarum.concurrent.ThreadParallel
|
||||
@@ -774,14 +774,14 @@ object WorldGenerator {
|
||||
}
|
||||
|
||||
private fun processNoiseLayers(noiseRecords: Array<TaggedJoise>) {
|
||||
if (Terrarum.MULTITHREAD) {
|
||||
if (AppLoader.MULTITHREAD) {
|
||||
// set up indices
|
||||
for (i in 0 until Terrarum.THREADS) {
|
||||
for (i in 0 until AppLoader.THREADS) {
|
||||
ThreadParallel.map(
|
||||
i, "SampleJoiseMap",
|
||||
ThreadProcessNoiseLayers(
|
||||
HEIGHT.toFloat().div(Terrarum.THREADS).times(i).roundInt(),
|
||||
HEIGHT.toFloat().div(Terrarum.THREADS).times(i.plus(1)).roundInt() - 1,
|
||||
HEIGHT.toFloat().div(AppLoader.THREADS).times(i).roundInt(),
|
||||
HEIGHT.toFloat().div(AppLoader.THREADS).times(i.plus(1)).roundInt() - 1,
|
||||
noiseRecords
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user