mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-15 21:14:04 +09:00
fix: jittery cam on titlescreen
This commit is contained in:
@@ -1176,7 +1176,11 @@ internal object BlocksDrawer {
|
||||
private val occlusionIntensity = 0.25f // too low value and dark-coloured walls won't darken enough
|
||||
|
||||
private val doTilemapUpdate: Boolean
|
||||
get() = (!world.layerTerrain.ptrDestroyed && App.GLOBAL_RENDER_TIMER % 3 == 0L)
|
||||
get() {
|
||||
// TODO adaptive rate control via cam delta
|
||||
val rate = 4
|
||||
return (!world.layerTerrain.ptrDestroyed && App.GLOBAL_RENDER_TIMER % rate == 0L)
|
||||
}
|
||||
|
||||
private var camTransX = 0
|
||||
private var camTransY = 0
|
||||
|
||||
@@ -79,6 +79,9 @@ object WorldCamera {
|
||||
inline val camVector: com.badlogic.gdx.math.Vector2
|
||||
get() = com.badlogic.gdx.math.Vector2(gdxCamX, gdxCamY)
|
||||
|
||||
/**
|
||||
* Must be called on RENDER, not UPDATE, before the IngameRenderer invocation.
|
||||
*/
|
||||
fun update(world: GameWorld, player: ActorWithBody?) {
|
||||
if (player == null) return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user