mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-12 00:47:26 -04:00
improve entity sorting
This commit is contained in:
parent
f105977d4b
commit
e4c150f407
@ -32,7 +32,7 @@ abstract class EntityRenderFeature(val renderer: EntityRenderer<*>) : Comparable
|
|||||||
abstract fun draw()
|
abstract fun draw()
|
||||||
|
|
||||||
open fun compareByDistance(other: EntityRenderFeature): Int {
|
open fun compareByDistance(other: EntityRenderFeature): Int {
|
||||||
return other.renderer.distance.compareTo(renderer.distance)
|
return renderer.distance.compareTo(other.renderer.distance)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun compareTo(other: EntityRenderFeature): Int {
|
override fun compareTo(other: EntityRenderFeature): Int {
|
||||||
|
@ -108,6 +108,10 @@ open class BillboardTextFeature(
|
|||||||
renderer.renderer.queue += { mesh.unload() }
|
renderer.renderer.queue += { mesh.unload() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun compareByDistance(other: EntityRenderFeature): Int {
|
||||||
|
return -super.compareByDistance(other)
|
||||||
|
}
|
||||||
|
|
||||||
private companion object {
|
private companion object {
|
||||||
val PROPERTIES = TextRenderProperties(allowNewLine = false)
|
val PROPERTIES = TextRenderProperties(allowNewLine = false)
|
||||||
val MAX_SIZE = Vec2(150.0f, PROPERTIES.lineHeight)
|
val MAX_SIZE = Vec2(150.0f, PROPERTIES.lineHeight)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user