sprites can be rendered across the world seam

This commit is contained in:
minjaesong
2021-09-17 22:54:55 +09:00
parent 58be058b86
commit 575ed4410b
47 changed files with 150 additions and 166 deletions

View File

@@ -4,10 +4,7 @@ import com.badlogic.gdx.Gdx
import com.badlogic.gdx.graphics.Camera
import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import net.torvald.terrarum.App
import net.torvald.terrarum.Terrarum
import net.torvald.terrarum.TitleScreen
import net.torvald.terrarum.blendNormal
import net.torvald.terrarum.*
import net.torvald.terrarum.modulebasegame.TerrarumIngame
import net.torvald.terrarum.modulebasegame.ui.UIInventoryFull.Companion.INVENTORY_CELLS_OFFSET_Y
import net.torvald.terrarum.modulebasegame.ui.UIInventoryFull.Companion.INVENTORY_CELLS_UI_HEIGHT
@@ -86,7 +83,7 @@ class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
full.handler.lockToggle()
full.lockTransition()
// save the game
WriteSavegame(Terrarum.ingame!!.savegameArchive, File(App.defaultSaveDir, "${App.getTIME_T()}"), Terrarum.ingame!! as TerrarumIngame) {
WriteSavegame(INGAME.savegameArchive, File(App.defaultSaveDir, "${App.getTIME_T()}"), Terrarum.ingame!! as TerrarumIngame) {
// callback:
System.gc()
screen = 0

View File

@@ -27,7 +27,7 @@ class UIInventoryFull(
) : UICanvas(toggleKeyLiteral, toggleButtonLiteral, customPositioning, doNotWarnConstant) {
val actor: ActorHumanoid
get() = Terrarum.ingame!!.actorNowPlaying!!
get() = INGAME.actorNowPlaying!!
override var width: Int = App.scr.width
override var height: Int = App.scr.height

View File

@@ -34,7 +34,7 @@ class UIInventoryMinimap(val full: UIInventoryFull) : UICanvas() {
private val minimapRerenderInterval = .5f
override fun updateUI(delta: Float) {
MinimapComposer.setWorld(Terrarum.ingame!!.world)
MinimapComposer.setWorld(INGAME.world)
MinimapComposer.update()
minimapRerenderTimer += Gdx.graphics.deltaTime
}

View File

@@ -90,7 +90,7 @@ class UIItemInventoryEquippedView(
// sprite
val sprite = Terrarum.ingame!!.actorNowPlaying?.sprite
val sprite = INGAME.actorNowPlaying?.sprite
sprite?.let {
blendNormal(batch)
@@ -119,7 +119,7 @@ class UIItemInventoryEquippedView(
internal fun rebuild() {
rebuildList = false
Terrarum.ingame!!.actorNowPlaying?.inventory?.let {
INGAME.actorNowPlaying?.inventory?.let {
// sort by equip position
// fill the grid from fastest index, make no gap in-between of slots

View File

@@ -37,7 +37,7 @@ class UITierOneWatch() : UICanvas() {
//get() = if (ELon) lcdLitColELon else lcdLitColELoff
private val worldTime: WorldTime
get() = Terrarum.ingame!!.world.worldTime
get() = INGAME.world.worldTime
override fun updateUI(delta: Float) {

View File

@@ -63,8 +63,8 @@ class UIVitalMetre(
/*if (vitalGetterVal() != null && vitalGetterMax() != null && player != null) {
g.translate(
Terrarum.ingame!!.screenZoom * (player.centrePosPoint.x.toFloat() - (WorldCamera.x)),
Terrarum.ingame!!.screenZoom * (player.centrePosPoint.y.toFloat() - (WorldCamera.y))
INGAME.screenZoom * (player.centrePosPoint.x.toFloat() - (WorldCamera.x)),
INGAME.screenZoom * (player.centrePosPoint.y.toFloat() - (WorldCamera.y))
)