somehow fixed a consolewin bug

- It would read a key even if it's closed
This commit is contained in:
minjaesong
2017-10-18 03:52:11 +09:00
parent 06db25fb1a
commit 0004240c52
6 changed files with 98 additions and 8 deletions

View File

@@ -561,10 +561,14 @@ object LightmapRenderer {
}
fun resize(width: Int, height: Int) {
fun resize(screenW: Int, screenH: Int) {
// make sure the BlocksDrawer is resized first!
lightBuffer = Pixmap(BlocksDrawer.tilesInHorizontal, BlocksDrawer.tilesInVertical, Pixmap.Format.RGBA8888)
// copied from BlocksDrawer, duh!
val tilesInHorizontal = (screenW.toFloat() / TILE_SIZE).ceilInt() + 1
val tilesInVertical = (screenH.toFloat() / TILE_SIZE).ceilInt() + 1
lightBuffer = Pixmap(tilesInHorizontal, tilesInVertical, Pixmap.Format.RGBA8888)