mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 20:31:51 +09:00
worldgen estimation change
This commit is contained in:
@@ -17,6 +17,7 @@ import net.torvald.terrarum.App.printdbgerr
|
||||
import net.torvald.terrarum.TerrarumAppConfiguration.TILE_SIZE
|
||||
import net.torvald.terrarum.TerrarumAppConfiguration.TILE_SIZED
|
||||
import net.torvald.terrarum.TerrarumAppConfiguration.TILE_SIZEF
|
||||
import net.torvald.terrarum.clut.Skybox
|
||||
import net.torvald.terrarum.console.CommandDict
|
||||
import net.torvald.terrarum.gameactors.*
|
||||
import net.torvald.terrarum.gameactors.ai.ActorAI
|
||||
@@ -27,7 +28,6 @@ import net.torvald.terrarum.gameworld.GameWorld
|
||||
import net.torvald.terrarum.gameworld.WorldTime
|
||||
import net.torvald.terrarum.gameworld.fmod
|
||||
import net.torvald.terrarum.langpack.Lang
|
||||
import net.torvald.terrarum.clut.Skybox
|
||||
import net.torvald.terrarum.modulebasegame.ui.UILoadGovernor
|
||||
import net.torvald.terrarum.modulebasegame.ui.UIRemoCon
|
||||
import net.torvald.terrarum.modulebasegame.ui.UITitleRemoConYaml
|
||||
@@ -36,8 +36,6 @@ import net.torvald.terrarum.serialise.ReadSimpleWorld
|
||||
import net.torvald.terrarum.ui.Toolkit
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
import net.torvald.terrarum.weather.WeatherMixer
|
||||
import net.torvald.terrarum.weather.WeatherStateBox
|
||||
import net.torvald.terrarum.weather.Weatherbox
|
||||
import net.torvald.terrarum.worlddrawer.WorldCamera
|
||||
import net.torvald.util.CircularArray
|
||||
import java.io.IOException
|
||||
@@ -252,6 +250,20 @@ class TitleScreen(batch: FlippingSpriteBatch) : IngameInstance(batch) {
|
||||
|
||||
|
||||
//loadDone = true
|
||||
|
||||
// measure bogoflops here
|
||||
val st = System.nanoTime()
|
||||
var sc = st
|
||||
var bogoflopf = Math.random()
|
||||
var bogoflops = 0L
|
||||
while (sc - st < 100000000L) {
|
||||
bogoflopf *= Math.random()
|
||||
bogoflops++
|
||||
sc = System.nanoTime()
|
||||
}
|
||||
bogoflops = Math.round(bogoflops.toDouble() * (1000000000.0 / (sc - st)))
|
||||
printdbg(this, "Bogoflops old: ${App.bogoflops} new: $bogoflops")
|
||||
App.bogoflops = maxOf(App.bogoflops, bogoflops)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ class UISystemInfo(val remoCon: UIRemoCon) : UICanvas() {
|
||||
v.add("JRE" to System.getProperty("java.version"))
|
||||
v.add("Gdx" to com.badlogic.gdx.Version.VERSION)
|
||||
v.add("OS" to "${App.OSName} ${App.OSVersion}")
|
||||
v.add("Processor" to App.processor)
|
||||
v.add("Processor" to "${App.THREAD_COUNT}\u2009\u00D7\u2009${App.processor}")
|
||||
v.add("Architecture" to App.systemArch)
|
||||
v.add("CPUID" to App.processorVendor.let { if (it == "null" || it == null) "n/a" else it })
|
||||
v.add("OpenGL" to "${Gdx.graphics.glVersion.majorVersion}.${Gdx.graphics.glVersion.minorVersion}.${Gdx.graphics.glVersion.releaseVersion}")
|
||||
|
||||
@@ -64,7 +64,7 @@ object Worldgen {
|
||||
private data class Work(val loadingScreenName: String, val theWork: Gen)
|
||||
|
||||
fun getEstimationSec(width: Int, height: Int): Long {
|
||||
return (23.05 * 1.25 * (47500000.0 / bogoflops) * ((width * height) / 40095000.0) * (32.0 / THREAD_COUNT)).roundToLong()
|
||||
return (23.05 * 1.25 * (48600000.0 / bogoflops) * ((width * height) / 40095000.0) * (32.0 / THREAD_COUNT)).roundToLong()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -113,8 +113,8 @@ internal class UnsafePtr(pointer: Long, allocSize: Long) {
|
||||
// appear (e.g. getting garbage values when it fucking shouldn't)
|
||||
|
||||
// using ifs instead of assertions: inactive assert statements still slows down the app
|
||||
if (destroyed) { throw DanglingPointerException("The pointer is already destroyed ($this)") }
|
||||
if (index !in 0 until size) { throw AddressOverflowException("Index: $index; alloc size: $size") }
|
||||
// if (destroyed) { throw DanglingPointerException("The pointer is already destroyed ($this)") }
|
||||
// if (index !in 0 until size) { throw AddressOverflowException("Index: $index; alloc size: $size") }
|
||||
}
|
||||
|
||||
operator fun get(index: Long): Byte {
|
||||
|
||||
Reference in New Issue
Block a user