mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-14 12:34:05 +09:00
lightmap draw shift fixed; game will properly resize
This commit is contained in:
@@ -802,6 +802,10 @@ object BlocksDrawer {
|
||||
|
||||
oldScreenW = screenW
|
||||
oldScreenH = screenH
|
||||
|
||||
|
||||
println("[BlocksDrawerNew] Resize event")
|
||||
|
||||
}
|
||||
|
||||
fun clampH(x: Int): Int {
|
||||
|
||||
@@ -118,8 +118,8 @@ object LightmapRenderer {
|
||||
}
|
||||
|
||||
fun fireRecalculateEvent() {
|
||||
for_x_start = WorldCamera.x / TILE_SIZE - 1 // fix for premature lightmap rendering
|
||||
for_y_start = WorldCamera.y / TILE_SIZE - 1 // on topmost/leftmost side
|
||||
for_x_start = WorldCamera.x / TILE_SIZE // fix for premature lightmap rendering
|
||||
for_y_start = WorldCamera.y / TILE_SIZE // on topmost/leftmost side
|
||||
|
||||
for_x_end = for_x_start + WorldCamera.width / TILE_SIZE + 3
|
||||
for_y_end = for_y_start + WorldCamera.height / TILE_SIZE + 2 // same fix as above
|
||||
@@ -565,6 +565,10 @@ object LightmapRenderer {
|
||||
// make sure the BlocksDrawer is resized first!
|
||||
|
||||
lightBuffer = Pixmap(BlocksDrawer.tilesInHorizontal, BlocksDrawer.tilesInVertical, Pixmap.Format.RGBA8888)
|
||||
|
||||
|
||||
|
||||
println("[LightmapRendererNew] Resize event")
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user