diff --git a/src/net/torvald/terrarum/serialise/WriteSavegame.kt b/src/net/torvald/terrarum/serialise/WriteSavegame.kt index a8de24cf7..fc78760ab 100644 --- a/src/net/torvald/terrarum/serialise/WriteSavegame.kt +++ b/src/net/torvald/terrarum/serialise/WriteSavegame.kt @@ -53,8 +53,8 @@ object WriteSavegame { val w = 960 val h = 640 - val cx = WorldCamera.x % 2 - val cy = WorldCamera.y % 2 + val cx = (1 - WorldCamera.x % 2) + val cy = (1 - WorldCamera.y % 2) val x = (fb.width - w) - cx // force the even-numbered position val y = (fb.height - h) - cy // force the even-numbered position diff --git a/src/net/torvald/terrarum/worlddrawer/LightmapRenderer.kt b/src/net/torvald/terrarum/worlddrawer/LightmapRenderer.kt index d81163045..9a03b628a 100644 --- a/src/net/torvald/terrarum/worlddrawer/LightmapRenderer.kt +++ b/src/net/torvald/terrarum/worlddrawer/LightmapRenderer.kt @@ -341,9 +341,10 @@ object LightmapRenderer { for (x in lightBoxX.div(TILE_SIZE).floorInt() ..lightBoxX.plus(lightBoxW).div(TILE_SIZE).floorInt()) { - val normalisedCvec = it.color//.cpy().mul(DIV_FLOAT) + val oldLight = lanternMap[LandUtil.getBlockAddr(world, x, y)] ?: Cvec(0) // if two or more luminous actors share the same block, mix the light + val actorLight = it.color - lanternMap[LandUtil.getBlockAddr(world, x, y)] = normalisedCvec + lanternMap[LandUtil.getBlockAddr(world, x, y)] = oldLight.maxAndAssign(actorLight) } } }