QDENGINE: Use ConfMan.flushToDisk() to persist values

Signed-off-by: kunxl-gg <tiwari.25@iitj.ac.in>
This commit is contained in:
kunxl-gg 2024-08-26 02:26:26 +05:30 committed by Eugene Sandulenko
parent 42a8150e41
commit 50b30e254c

View File

@ -263,16 +263,19 @@ int QDEngineEngine::engineMain() {
ConfMan.setFloat("game_speed", speed);
sndD->set_frequency_coeff(speed);
resD.set_speed(ConfMan.getFloat("game_speed"));
ConfMan.flushToDisk();
} else if (event.kbd.keycode == Common::KEYCODE_PAGEUP) {
float speed = ConfMan.getFloat("game_speed") * 1.1f;
if (speed > 10.0f) speed = 10.0f;
ConfMan.setFloat("game_speed", speed);
sndD->set_frequency_coeff(speed);
resD.set_speed(ConfMan.getFloat("game_speed"));
ConfMan.flushToDisk();
} else if (event.kbd.keycode == Common::KEYCODE_HOME) {
ConfMan.setFloat("game_speed", 1.0f);
sndD->set_frequency_coeff(1.0f);
resD.set_speed(ConfMan.getFloat("game_speed"));
ConfMan.flushToDisk();
} else if (event.kbd.ascii == 'g')
qdGameConfig::get_config().toggle_show_grid();
#endif