world generator progress graphics fix

This commit is contained in:
minjaesong
2024-01-19 00:33:10 +09:00
parent 5dae539402
commit 79bf88f0e8
3 changed files with 6 additions and 4 deletions

View File

@@ -97,7 +97,7 @@ open class FancyWorldReadLoadScreen(screenToBeLoaded: IngameInstance, private va
super.render(delta) super.render(delta)
} }
private val totalChunkCount = (worldwidth / CHUNK_W) * (worldheight / CHUNK_H) val totalChunkCount = (worldwidth / CHUNK_W) * (worldheight / CHUNK_H)
protected open fun getProgress(): Double { protected open fun getProgress(): Double {
return progress.get().toDouble() / totalChunkCount * previewWidth return progress.get().toDouble() / totalChunkCount * previewWidth
} }
@@ -121,8 +121,10 @@ open class FancyWorldReadLoadScreen(screenToBeLoaded: IngameInstance, private va
class FancyWorldgenLoadScreen(screenToBeLoaded: IngameInstance, private val worldwidth: Int, private val worldheight: Int) : FancyWorldReadLoadScreen(screenToBeLoaded, worldwidth, worldheight, {}) { class FancyWorldgenLoadScreen(screenToBeLoaded: IngameInstance, private val worldwidth: Int, private val worldheight: Int) : FancyWorldReadLoadScreen(screenToBeLoaded, worldwidth, worldheight, {}) {
private val chunks = (worldwidth / CHUNK_W) * 8
override fun getProgress(): Double { override fun getProgress(): Double {
return progress.get().toDouble() / worldwidth * previewWidth return progress.get().toDouble() / chunks * previewWidth
} }
override fun getStage(): Int { override fun getStage(): Int {

View File

@@ -24,7 +24,7 @@ class OregenAutotiling(world: GameWorld, isFinal: Boolean, seed: Long, val tilin
override fun getDone(loadscreen: LoadScreenBase?) { override fun getDone(loadscreen: LoadScreenBase?) {
Worldgen.threadExecutor.renew() Worldgen.threadExecutor.renew()
submitJob(loadscreen) submitJob(null)
Worldgen.threadExecutor.join() Worldgen.threadExecutor.join()
} }

View File

@@ -134,7 +134,7 @@ object Worldgen {
val eqPow = 0.396 // use google sheet to get trend line equation val eqPow = 0.396 // use google sheet to get trend line equation
val f = eqMult * (width.toDouble() * height).pow(eqPow) val f = eqMult * (width.toDouble() * height).pow(eqPow)
return (1.2 * (testMachineBogoFlops.toDouble() / bogoflops) * f * (testMachineThreads.toDouble() / THREAD_COUNT)).roundToLong() return (1.3 * (testMachineBogoFlops.toDouble() / bogoflops) * f * (testMachineThreads.toDouble() / THREAD_COUNT)).roundToLong()
} }
/** /**