mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 20:31:51 +09:00
fix: light/shadebox would get tilewise size of 2 when their hitbox size is set to 16
This commit is contained in:
@@ -26,7 +26,7 @@ class UIScreenZoom : UICanvas(
|
||||
override var width = App.fontGame.getWidth(zoomText)
|
||||
override var height = App.fontGame.lineHeight.toInt()
|
||||
|
||||
override var openCloseTime = COMMON_OPEN_CLOSE
|
||||
override var openCloseTime = 0.25f
|
||||
|
||||
override val mouseUp = false
|
||||
|
||||
|
||||
@@ -25,11 +25,6 @@ class UIWorldPortal : UICanvas() {
|
||||
|
||||
|
||||
|
||||
val gradStartCol = Color(0x404040_60)
|
||||
val gradEndCol = Color(0x000000_70)
|
||||
val gradHeight = 48f
|
||||
|
||||
|
||||
val controlHelpHeight = App.fontGame.lineHeight
|
||||
|
||||
private var panelTransitionLocked = false
|
||||
|
||||
@@ -349,12 +349,12 @@ object LightmapRenderer {
|
||||
val shadeBoxCopy = it.shadeBoxList.subList(0, it.shadeBoxList.size) // make copy to prevent ConcurrentModificationException
|
||||
val scale = it.scale
|
||||
|
||||
// put lanterns to the area the luminantBox is occupying
|
||||
// put lanterns to the area the lightBox is occupying
|
||||
lightBoxCopy.forEach { (lightBox, colour) ->
|
||||
val lightBoxX = it.hitbox.startX + (lightBox.startX * scale)
|
||||
val lightBoxY = it.hitbox.startY + (lightBox.startY * scale)
|
||||
val lightBoxW = lightBox.width * scale
|
||||
val lightBoxH = lightBox.height * scale
|
||||
val lightBoxW = lightBox.width * scale - 1
|
||||
val lightBoxH = lightBox.height * scale - 1
|
||||
for (y in lightBoxY.div(TILE_SIZE).floorInt()
|
||||
..lightBoxY.plus(lightBoxH).div(TILE_SIZE).floorInt()) {
|
||||
for (x in lightBoxX.div(TILE_SIZE).floorInt()
|
||||
@@ -368,12 +368,12 @@ object LightmapRenderer {
|
||||
}
|
||||
}
|
||||
|
||||
// put shades to the area the luminantBox is occupying
|
||||
// put shades to the area the shadeBox is occupying
|
||||
shadeBoxCopy.forEach { (shadeBox, colour) ->
|
||||
val lightBoxX = it.hitbox.startX + (shadeBox.startX * scale)
|
||||
val lightBoxY = it.hitbox.startY + (shadeBox.startY * scale)
|
||||
val lightBoxW = shadeBox.width * scale
|
||||
val lightBoxH = shadeBox.height * scale
|
||||
val lightBoxW = shadeBox.width * scale - 1
|
||||
val lightBoxH = shadeBox.height * scale - 1
|
||||
for (y in lightBoxY.div(TILE_SIZE).floorInt()
|
||||
..lightBoxY.plus(lightBoxH).div(TILE_SIZE).floorInt()) {
|
||||
for (x in lightBoxX.div(TILE_SIZE).floorInt()
|
||||
|
||||
Reference in New Issue
Block a user