mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-14 12:34:05 +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 width = App.fontGame.getWidth(zoomText)
|
||||||
override var height = App.fontGame.lineHeight.toInt()
|
override var height = App.fontGame.lineHeight.toInt()
|
||||||
|
|
||||||
override var openCloseTime = COMMON_OPEN_CLOSE
|
override var openCloseTime = 0.25f
|
||||||
|
|
||||||
override val mouseUp = false
|
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
|
val controlHelpHeight = App.fontGame.lineHeight
|
||||||
|
|
||||||
private var panelTransitionLocked = false
|
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 shadeBoxCopy = it.shadeBoxList.subList(0, it.shadeBoxList.size) // make copy to prevent ConcurrentModificationException
|
||||||
val scale = it.scale
|
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) ->
|
lightBoxCopy.forEach { (lightBox, colour) ->
|
||||||
val lightBoxX = it.hitbox.startX + (lightBox.startX * scale)
|
val lightBoxX = it.hitbox.startX + (lightBox.startX * scale)
|
||||||
val lightBoxY = it.hitbox.startY + (lightBox.startY * scale)
|
val lightBoxY = it.hitbox.startY + (lightBox.startY * scale)
|
||||||
val lightBoxW = lightBox.width * scale
|
val lightBoxW = lightBox.width * scale - 1
|
||||||
val lightBoxH = lightBox.height * scale
|
val lightBoxH = lightBox.height * scale - 1
|
||||||
for (y in lightBoxY.div(TILE_SIZE).floorInt()
|
for (y in lightBoxY.div(TILE_SIZE).floorInt()
|
||||||
..lightBoxY.plus(lightBoxH).div(TILE_SIZE).floorInt()) {
|
..lightBoxY.plus(lightBoxH).div(TILE_SIZE).floorInt()) {
|
||||||
for (x in lightBoxX.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) ->
|
shadeBoxCopy.forEach { (shadeBox, colour) ->
|
||||||
val lightBoxX = it.hitbox.startX + (shadeBox.startX * scale)
|
val lightBoxX = it.hitbox.startX + (shadeBox.startX * scale)
|
||||||
val lightBoxY = it.hitbox.startY + (shadeBox.startY * scale)
|
val lightBoxY = it.hitbox.startY + (shadeBox.startY * scale)
|
||||||
val lightBoxW = shadeBox.width * scale
|
val lightBoxW = shadeBox.width * scale - 1
|
||||||
val lightBoxH = shadeBox.height * scale
|
val lightBoxH = shadeBox.height * scale - 1
|
||||||
for (y in lightBoxY.div(TILE_SIZE).floorInt()
|
for (y in lightBoxY.div(TILE_SIZE).floorInt()
|
||||||
..lightBoxY.plus(lightBoxH).div(TILE_SIZE).floorInt()) {
|
..lightBoxY.plus(lightBoxH).div(TILE_SIZE).floorInt()) {
|
||||||
for (x in lightBoxX.div(TILE_SIZE).floorInt()
|
for (x in lightBoxX.div(TILE_SIZE).floorInt()
|
||||||
|
|||||||
Reference in New Issue
Block a user