mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-17 22:14:05 +09:00
tilemap update is now done once in every 3 frame
This commit is contained in:
@@ -264,11 +264,14 @@ internal object BlocksDrawer {
|
||||
|
||||
if (doTilemapUpdate) {
|
||||
wrapCamera()
|
||||
|
||||
camTransX = WorldCamera.x fmod TILE_SIZE
|
||||
camTransY = WorldCamera.y fmod TILE_SIZE
|
||||
}
|
||||
else {
|
||||
camTransX += WorldCamera.deltaX
|
||||
camTransY += WorldCamera.deltaY
|
||||
}
|
||||
|
||||
camTransX = WorldCamera.x - camX
|
||||
camTransY = WorldCamera.y - camY
|
||||
|
||||
if (doTilemapUpdate) {
|
||||
// rendering tilemap only updates every three frame
|
||||
measureDebugTime("Renderer.Tiling*") {
|
||||
@@ -1176,7 +1179,7 @@ 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 % 30 == 0L)
|
||||
get() = (!world.layerTerrain.ptrDestroyed && App.GLOBAL_RENDER_TIMER % 3 == 0L)
|
||||
|
||||
private var camTransX = 0
|
||||
private var camTransY = 0
|
||||
|
||||
Reference in New Issue
Block a user