mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-15 18:34:56 -04:00
chunk meshing: don't interrupt whole chunk when only section changes
This commit is contained in:
parent
6f8eca6a30
commit
37c3c81d83
@ -203,10 +203,10 @@ class ChunkRenderer(
|
||||
lock.lock()
|
||||
|
||||
loaded.unload(position.position, false)
|
||||
culledQueue.remove(position.position.chunkPosition, false)
|
||||
culledQueue.remove(position.position, false)
|
||||
meshingQueue.remove(position, false)
|
||||
loadingQueue.abort(position, false)
|
||||
meshingQueue.tasks.interrupt(position.position.chunkPosition)
|
||||
meshingQueue.tasks.interrupt(position.position)
|
||||
|
||||
lock.unlock()
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ import de.bixilon.kutil.concurrent.lock.RWLock
|
||||
import de.bixilon.minosoft.data.world.chunk.chunk.Chunk
|
||||
import de.bixilon.minosoft.data.world.positions.ChunkPosition
|
||||
import de.bixilon.minosoft.data.world.positions.SectionHeight
|
||||
import de.bixilon.minosoft.data.world.positions.SectionPosition
|
||||
import de.bixilon.minosoft.gui.rendering.chunk.ChunkRenderer
|
||||
import it.unimi.dsi.fastutil.ints.IntOpenHashSet
|
||||
|
||||
@ -66,12 +67,12 @@ class CulledQueue(
|
||||
if (lock) unlock()
|
||||
}
|
||||
|
||||
fun remove(position: ChunkPosition, height: SectionHeight, lock: Boolean) {
|
||||
fun remove(position: SectionPosition, lock: Boolean) {
|
||||
if (lock) lock()
|
||||
|
||||
queue[position]?.let {
|
||||
if (it.remove(height) && it.isEmpty()) {
|
||||
queue -= position
|
||||
queue[position.chunkPosition]?.let {
|
||||
if (it.remove(position.y) && it.isEmpty()) {
|
||||
queue -= position.chunkPosition
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user