removed visual artefacts caused by the new camera coords

This commit is contained in:
minjaesong
2021-09-16 23:37:26 +09:00
parent c3481fd47d
commit 6e9b388534
2 changed files with 19 additions and 32 deletions

View File

@@ -207,7 +207,7 @@ object IngameRenderer : Disposable {
if (!gamePaused || newWorldLoadedLatch) {
measureDebugTime("Renderer.ApparentLightRun") {
// recalculate for even frames, or if the sign of the cam-x changed
if (App.GLOBAL_RENDER_TIMER % 3 == 0 || WorldCamera.x * oldCamX <= 0 || newWorldLoadedLatch) {
if (App.GLOBAL_RENDER_TIMER % 3 == 0 || Math.abs(WorldCamera.x - oldCamX) >= world.width * 0.85f * TILE_SIZEF || newWorldLoadedLatch) {
LightmapRenderer.fireRecalculateEvent(actorsRenderBehind, actorsRenderFront, actorsRenderMidTop, actorsRenderMiddle, actorsRenderOverlay)
}
oldCamX = WorldCamera.x