mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-16 16:46:07 +09:00
replaced quick and dirty fix into proper fix
Former-commit-id: ee305ad1bb84716a0bb8c17e9aa873eafb0baa6e Former-commit-id: a9d7e6495bbfdea42b253070f66a0978463a8814
This commit is contained in:
@@ -1060,40 +1060,54 @@ open class ActorWithSprite(renderOrder: ActorOrder, physics: Boolean = true) : A
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!sprite!!.flippedHorizontal()) {
|
if (!sprite!!.flippedHorizontal()) {
|
||||||
sprite!!.render(g,
|
if (MapCamera.xCentre > halfWorldW && centrePosPoint.x < halfWorldW) {
|
||||||
(hitbox.posX - hitboxTranslateX * scale).toFloat(),
|
// camera center neg, actor center pos
|
||||||
(hitbox.posY + hitboxTranslateY * scale).toFloat(),
|
sprite!!.render(g,
|
||||||
(scale).toFloat()
|
(hitbox.posX - hitboxTranslateX * scale).toFloat() + world.width * TILE_SIZE,
|
||||||
)
|
(hitbox.posY + hitboxTranslateY * scale).toFloat(),
|
||||||
// Q&D fix for Roundworld anomaly
|
(scale).toFloat()
|
||||||
sprite!!.render(g,
|
)
|
||||||
(hitbox.posX - hitboxTranslateX * scale).toFloat() + world.width * TILE_SIZE,
|
}
|
||||||
(hitbox.posY + hitboxTranslateY * scale).toFloat(),
|
else if (MapCamera.xCentre < halfWorldW && centrePosPoint.x >= halfWorldW) {
|
||||||
(scale).toFloat()
|
// camera center pos, actor center neg
|
||||||
)
|
sprite!!.render(g,
|
||||||
sprite!!.render(g,
|
(hitbox.posX - hitboxTranslateX * scale).toFloat() - world.width * TILE_SIZE,
|
||||||
(hitbox.posX - hitboxTranslateX * scale).toFloat() - world.width * TILE_SIZE,
|
(hitbox.posY + hitboxTranslateY * scale).toFloat(),
|
||||||
(hitbox.posY + hitboxTranslateY * scale).toFloat(),
|
(scale).toFloat()
|
||||||
(scale).toFloat()
|
)
|
||||||
)
|
}
|
||||||
|
else {
|
||||||
|
sprite!!.render(g,
|
||||||
|
(hitbox.posX - hitboxTranslateX * scale).toFloat(),
|
||||||
|
(hitbox.posY + hitboxTranslateY * scale).toFloat(),
|
||||||
|
(scale).toFloat()
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sprite!!.render(g,
|
if (MapCamera.xCentre > halfWorldW && centrePosPoint.x < halfWorldW) {
|
||||||
(hitbox.posX - scale).toFloat(),
|
// camera center neg, actor center pos
|
||||||
(hitbox.posY + hitboxTranslateY * scale).toFloat(),
|
sprite!!.render(g,
|
||||||
(scale).toFloat()
|
(hitbox.posX - scale).toFloat() + world.width * TILE_SIZE,
|
||||||
)
|
(hitbox.posY + hitboxTranslateY * scale).toFloat(),
|
||||||
// Q&D fix for Roundworld anomaly
|
(scale).toFloat()
|
||||||
sprite!!.render(g,
|
)
|
||||||
(hitbox.posX - scale).toFloat() + world.width * TILE_SIZE,
|
}
|
||||||
(hitbox.posY + hitboxTranslateY * scale).toFloat(),
|
else if (MapCamera.xCentre < halfWorldW && centrePosPoint.x >= halfWorldW) {
|
||||||
(scale).toFloat()
|
// camera center pos, actor center neg
|
||||||
)
|
sprite!!.render(g,
|
||||||
sprite!!.render(g,
|
(hitbox.posX - scale).toFloat() - world.width * TILE_SIZE,
|
||||||
(hitbox.posX - scale).toFloat() - world.width * TILE_SIZE,
|
(hitbox.posY + hitboxTranslateY * scale).toFloat(),
|
||||||
(hitbox.posY + hitboxTranslateY * scale).toFloat(),
|
(scale).toFloat()
|
||||||
(scale).toFloat()
|
)
|
||||||
)
|
}
|
||||||
|
else {
|
||||||
|
sprite!!.render(g,
|
||||||
|
(hitbox.posX - scale).toFloat(),
|
||||||
|
(hitbox.posY + hitboxTranslateY * scale).toFloat(),
|
||||||
|
(scale).toFloat()
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user