mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 20:31:51 +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()) {
|
||||
sprite!!.render(g,
|
||||
(hitbox.posX - hitboxTranslateX * scale).toFloat(),
|
||||
(hitbox.posY + hitboxTranslateY * scale).toFloat(),
|
||||
(scale).toFloat()
|
||||
)
|
||||
// Q&D fix for Roundworld anomaly
|
||||
sprite!!.render(g,
|
||||
(hitbox.posX - hitboxTranslateX * scale).toFloat() + world.width * TILE_SIZE,
|
||||
(hitbox.posY + hitboxTranslateY * scale).toFloat(),
|
||||
(scale).toFloat()
|
||||
)
|
||||
sprite!!.render(g,
|
||||
(hitbox.posX - hitboxTranslateX * scale).toFloat() - world.width * TILE_SIZE,
|
||||
(hitbox.posY + hitboxTranslateY * scale).toFloat(),
|
||||
(scale).toFloat()
|
||||
)
|
||||
if (MapCamera.xCentre > halfWorldW && centrePosPoint.x < halfWorldW) {
|
||||
// camera center neg, actor center pos
|
||||
sprite!!.render(g,
|
||||
(hitbox.posX - hitboxTranslateX * scale).toFloat() + world.width * TILE_SIZE,
|
||||
(hitbox.posY + hitboxTranslateY * scale).toFloat(),
|
||||
(scale).toFloat()
|
||||
)
|
||||
}
|
||||
else if (MapCamera.xCentre < halfWorldW && centrePosPoint.x >= halfWorldW) {
|
||||
// camera center pos, actor center neg
|
||||
sprite!!.render(g,
|
||||
(hitbox.posX - hitboxTranslateX * scale).toFloat() - world.width * TILE_SIZE,
|
||||
(hitbox.posY + hitboxTranslateY * scale).toFloat(),
|
||||
(scale).toFloat()
|
||||
)
|
||||
}
|
||||
else {
|
||||
sprite!!.render(g,
|
||||
(hitbox.posX - hitboxTranslateX * scale).toFloat(),
|
||||
(hitbox.posY + hitboxTranslateY * scale).toFloat(),
|
||||
(scale).toFloat()
|
||||
)
|
||||
}
|
||||
}
|
||||
else {
|
||||
sprite!!.render(g,
|
||||
(hitbox.posX - scale).toFloat(),
|
||||
(hitbox.posY + hitboxTranslateY * scale).toFloat(),
|
||||
(scale).toFloat()
|
||||
)
|
||||
// Q&D fix for Roundworld anomaly
|
||||
sprite!!.render(g,
|
||||
(hitbox.posX - scale).toFloat() + world.width * TILE_SIZE,
|
||||
(hitbox.posY + hitboxTranslateY * scale).toFloat(),
|
||||
(scale).toFloat()
|
||||
)
|
||||
sprite!!.render(g,
|
||||
(hitbox.posX - scale).toFloat() - world.width * TILE_SIZE,
|
||||
(hitbox.posY + hitboxTranslateY * scale).toFloat(),
|
||||
(scale).toFloat()
|
||||
)
|
||||
if (MapCamera.xCentre > halfWorldW && centrePosPoint.x < halfWorldW) {
|
||||
// camera center neg, actor center pos
|
||||
sprite!!.render(g,
|
||||
(hitbox.posX - scale).toFloat() + world.width * TILE_SIZE,
|
||||
(hitbox.posY + hitboxTranslateY * scale).toFloat(),
|
||||
(scale).toFloat()
|
||||
)
|
||||
}
|
||||
else if (MapCamera.xCentre < halfWorldW && centrePosPoint.x >= halfWorldW) {
|
||||
// camera center pos, actor center neg
|
||||
sprite!!.render(g,
|
||||
(hitbox.posX - scale).toFloat() - world.width * TILE_SIZE,
|
||||
(hitbox.posY + hitboxTranslateY * 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