fps aware tilemap update rate

This commit is contained in:
minjaesong
2024-09-10 22:24:41 +09:00
parent f50c2a385b
commit 79d0fe3572

View File

@@ -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)
}