This commit is contained in:
DBotThePony 2022-09-08 21:44:02 +07:00
parent 3c0bd56b0a
commit 19cf788d87
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -38,12 +38,12 @@ interface ILayeredRenderer {
fun renderLayeredList(transform: Matrix4fStack, potentialRenderers: List<ILayeredRenderer>): Int {
val renderers = ArrayList<ILayeredRenderer>(potentialRenderers.size)
var bottomMost = -1
var bottomMost = Int.MIN_VALUE
for (render in potentialRenderers) {
val zLevel = render.bottomMostZLevel()
if (zLevel >= 0) {
if (zLevel > Int.MIN_VALUE) {
bottomMost = bottomMost.coerceAtLeast(zLevel)
renderers.add(render)
}
@ -52,7 +52,7 @@ fun renderLayeredList(transform: Matrix4fStack, potentialRenderers: List<ILayere
var lastBottom = bottomMost
var renderCalls = 0
while (lastBottom > 0 && renderers.isNotEmpty()) {
while (lastBottom != Int.MIN_VALUE && renderers.isNotEmpty()) {
var newBottom = Int.MIN_VALUE
for (i in renderers.size - 1 downTo 0) {