mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 12:21:52 +09:00
fps aware tilemap update rate
This commit is contained in:
@@ -1178,8 +1178,8 @@ internal object BlocksDrawer {
|
||||
|
||||
private val doTilemapUpdate: Boolean
|
||||
get() {
|
||||
val rate = ((2f * TILE_SIZEF) / maxOf(WorldCamera.deltaX.abs(), WorldCamera.deltaY.abs()).coerceAtLeast(1)).roundToInt().coerceIn(1, 4)
|
||||
// App.debugTimers.put("Renderer.tilemapUpdateDivider", rate.toLong())
|
||||
val rate = (((Gdx.graphics.framesPerSecond / 60f) * TILE_SIZEF) / maxOf(WorldCamera.deltaX.abs(), WorldCamera.deltaY.abs()).coerceAtLeast(1)).roundToInt().coerceIn(1, 4)
|
||||
App.debugTimers.put("Renderer.tilemapUpdateDivider", rate.toLong())
|
||||
return (!world.layerTerrain.ptrDestroyed && App.GLOBAL_RENDER_TIMER % rate == 0L)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user