mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
audio listener configuration fix
This commit is contained in:
parent
2a77c24414
commit
75e56ebd83
6 changed files with 47 additions and 24 deletions
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
#include "core_defs.h"
|
||||
#include "engine.h"
|
||||
#include "coders/toml.h"
|
||||
#include "files/files.h"
|
||||
#include "files/settings_io.hpp"
|
||||
#include "files/engine_paths.h"
|
||||
|
|
@ -16,9 +15,6 @@
|
|||
#include "window/Events.h"
|
||||
#include "debug/Logger.hpp"
|
||||
|
||||
inline std::string SETTINGS_FILE = "settings.toml";
|
||||
inline std::string CONTROLS_FILE = "controls.json";
|
||||
|
||||
static debug::Logger logger("main");
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
|
|
@ -35,26 +31,10 @@ int main(int argc, char** argv) {
|
|||
try {
|
||||
EngineSettings settings;
|
||||
SettingsHandler handler(settings);
|
||||
|
||||
fs::path settings_file = userfiles/fs::path(SETTINGS_FILE);
|
||||
fs::path controls_file = userfiles/fs::path(CONTROLS_FILE);
|
||||
if (fs::is_regular_file(settings_file)) {
|
||||
logger.info() << "loading settings";
|
||||
std::string text = files::read_string(settings_file);
|
||||
toml::parse(handler, settings_file.string(), text);
|
||||
}
|
||||
corecontent::setup_bindings();
|
||||
Engine engine(settings, handler, &paths);
|
||||
if (fs::is_regular_file(controls_file)) {
|
||||
logger.info() << "loading controls";
|
||||
std::string text = files::read_string(controls_file);
|
||||
Events::loadBindings(controls_file.string(), text);
|
||||
}
|
||||
engine.mainloop();
|
||||
|
||||
logger.info() << "saving settings";
|
||||
files::write_string(settings_file, toml::stringify(handler));
|
||||
files::write_string(controls_file, Events::writeBindings());
|
||||
Engine engine(settings, handler, &paths);
|
||||
|
||||
engine.mainloop();
|
||||
}
|
||||
catch (const initialize_error& err) {
|
||||
logger.error() << "could not to initialize engine\n" << err.what();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue