fix: delta d bench was broken

This commit is contained in:
minjaesong
2023-09-19 16:13:29 +09:00
parent 0229cf501c
commit 1b3796b265
3 changed files with 14 additions and 3 deletions

View File

@@ -405,6 +405,7 @@ public class App implements ApplicationListener {
initialiseConfig();
readConfigJson();
setGamepadButtonLabels();
rectifyConfigs();
ShaderProgram.pedantic = false;
@@ -1710,4 +1711,14 @@ public class App implements ApplicationListener {
public static void inputStrobed(TerrarumKeyboardEvent event) {
currentScreen.inputStrobed(event);
}
/**
* Corrects out-of-range config values
*/
private static void rectifyConfigs() {
// force set min autosave interval to 5 minutes
if (getConfigInt("autosaveinterval") < 5 * 60000) {
setConfig("autosaveinterval", 5 * 60000);
}
}
}

View File

@@ -617,7 +617,7 @@ open class TerrarumIngame(batch: FlippingSpriteBatch) : IngameInstance(batch) {
// some sketchy test code here
KeyToggler.forceSet(App.getConfigInt("debug_key_deltat_benchmark"), false)
KeyToggler.forceSet(Input.Keys.F2, false)
}// END enter
@@ -853,7 +853,7 @@ open class TerrarumIngame(batch: FlippingSpriteBatch) : IngameInstance(batch) {
WORLD_UPDATE_TIMER += 1
if (KeyToggler.isOn(App.getConfigInt("debug_key_deltat_benchmark"))) {
if (KeyToggler.isOn(Input.Keys.F2)) {
deltaTeeBenchmarks.appendHead(1f / Gdx.graphics.deltaTime)
if (deltaTeeCleared) deltaTeeCleared = false

View File

@@ -25,7 +25,7 @@ class UIPerformanceControlPanel(remoCon: UIRemoCon?) : UICanvas() {
init {
ControlPanelCommon.register(this, width, "basegame.performancecontrolpanel", arrayOf(
arrayOf("", { Lang["MENU_OPTIONS_GAMEPLAY"] }, "h1"),
arrayOf("autosaveinterval", { Lang["MENU_OPTIONS_AUTOSAVE"] + " (${Lang["CONTEXT_TIME_MINUTE_PLURAL"]})" }, "spinnerimul,1,120,1,60000"),
arrayOf("autosaveinterval", { Lang["MENU_OPTIONS_AUTOSAVE"] + " (${Lang["CONTEXT_TIME_MINUTE_PLURAL"]})" }, "spinnerimul,5,120,5,60000"),
arrayOf("notificationshowuptime", { Lang["MENU_OPTIONS_NOTIFICATION_DISPLAY_DURATION"] + " (${Lang["CONTEXT_TIME_SECOND_PLURAL"]})" }, "spinnerimul,2,10,1,1000"),
arrayOf("", { Lang["MENU_LABEL_GRAPHICS"] }, "h1"),
arrayOf("atlastexsize", { Lang["MENU_OPTIONS_ATLAS_TEXTURE_SIZE"] }, "spinnersel,1024,2048,4096,8192"),