fixed a bug where actors lightbox won't follow the actor's scale

This commit is contained in:
minjaesong
2022-02-25 14:36:36 +09:00
parent 6d3a577e46
commit dc86de139c
3 changed files with 17 additions and 16 deletions

View File

@@ -348,10 +348,10 @@ object LightmapRenderer {
// put lanterns to the area the luminantBox is occupying
lightBoxCopy.forEach { (lightBox, colour) ->
val lightBoxX = it.hitbox.startX + lightBox.startX
val lightBoxY = it.hitbox.startY + lightBox.startY
val lightBoxW = lightBox.width
val lightBoxH = lightBox.height
val lightBoxX = it.hitbox.startX + (lightBox.startX * it.scale)
val lightBoxY = it.hitbox.startY + (lightBox.startY * it.scale)
val lightBoxW = lightBox.width * it.scale
val lightBoxH = lightBox.height * it.scale
for (y in lightBoxY.div(TILE_SIZE).floorInt()
..lightBoxY.plus(lightBoxH).div(TILE_SIZE).floorInt()) {
for (x in lightBoxX.div(TILE_SIZE).floorInt()
@@ -367,10 +367,10 @@ object LightmapRenderer {
// put shades to the area the luminantBox is occupying
shadeBoxCopy.forEach { (shadeBox, colour) ->
val lightBoxX = it.hitbox.startX + shadeBox.startX
val lightBoxY = it.hitbox.startY + shadeBox.startY
val lightBoxW = shadeBox.width
val lightBoxH = shadeBox.height
val lightBoxX = it.hitbox.startX + (shadeBox.startX * it.scale)
val lightBoxY = it.hitbox.startY + (shadeBox.startY * it.scale)
val lightBoxW = shadeBox.width * it.scale
val lightBoxH = shadeBox.height * it.scale
for (y in lightBoxY.div(TILE_SIZE).floorInt()
..lightBoxY.plus(lightBoxH).div(TILE_SIZE).floorInt()) {
for (x in lightBoxX.div(TILE_SIZE).floorInt()