mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-08 04:41:51 +09:00
world generator progress graphics fix
This commit is contained in:
@@ -97,7 +97,7 @@ open class FancyWorldReadLoadScreen(screenToBeLoaded: IngameInstance, private va
|
||||
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 {
|
||||
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, {}) {
|
||||
|
||||
private val chunks = (worldwidth / CHUNK_W) * 8
|
||||
|
||||
override fun getProgress(): Double {
|
||||
return progress.get().toDouble() / worldwidth * previewWidth
|
||||
return progress.get().toDouble() / chunks * previewWidth
|
||||
}
|
||||
|
||||
override fun getStage(): Int {
|
||||
|
||||
@@ -24,7 +24,7 @@ class OregenAutotiling(world: GameWorld, isFinal: Boolean, seed: Long, val tilin
|
||||
|
||||
override fun getDone(loadscreen: LoadScreenBase?) {
|
||||
Worldgen.threadExecutor.renew()
|
||||
submitJob(loadscreen)
|
||||
submitJob(null)
|
||||
Worldgen.threadExecutor.join()
|
||||
}
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ object Worldgen {
|
||||
val eqPow = 0.396 // use google sheet to get trend line equation
|
||||
|
||||
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()
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user