lightmap draw shift fixed; game will properly resize

This commit is contained in:
minjaesong
2017-10-16 22:47:16 +09:00
parent 676be82f7f
commit 9cf694b5d7
7 changed files with 60 additions and 38 deletions

View File

@@ -802,6 +802,10 @@ object BlocksDrawer {
oldScreenW = screenW
oldScreenH = screenH
println("[BlocksDrawerNew] Resize event")
}
fun clampH(x: Int): Int {

View File

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