summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/input_default.cpp9
-rwxr-xr-xmain/main.cpp11
2 files changed, 18 insertions, 2 deletions
diff --git a/main/input_default.cpp b/main/input_default.cpp
index 2940f432d5..7cc7521686 100644
--- a/main/input_default.cpp
+++ b/main/input_default.cpp
@@ -319,6 +319,15 @@ void InputDefault::parse_input_event(const Ref<InputEvent> &p_event) {
set_joy_axis(jm->get_device(), jm->get_axis(), jm->get_axis_value());
}
+ Ref<InputEventGesture> ge = p_event;
+
+ if (ge.is_valid()) {
+
+ if (main_loop) {
+ main_loop->input_event(ge);
+ }
+ }
+
if (!p_event->is_echo()) {
for (const Map<StringName, InputMap::Action>::Element *E = InputMap::get_singleton()->get_action_map().front(); E; E = E->next()) {
diff --git a/main/main.cpp b/main/main.cpp
index 5410aae1d2..e74402d7dd 100755
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -290,8 +290,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
register_core_settings(); //here globals is present
- OS::get_singleton()->initialize_logger();
-
translation_server = memnew(TranslationServer);
performance = memnew(Performance);
ClassDB::register_class<Performance>();
@@ -745,6 +743,15 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
#endif
}
+ GLOBAL_DEF("logging/file_logging/enable_file_logging", true);
+ GLOBAL_DEF("logging/file_logging/log_path", "user://logs/log.txt");
+ GLOBAL_DEF("logging/file_logging/max_log_files", 10);
+ if (FileAccess::get_create_func(FileAccess::ACCESS_USERDATA) && GLOBAL_GET("logging/file_logging/enable_file_logging")) {
+ String base_path = GLOBAL_GET("logging/file_logging/log_path");
+ int max_files = GLOBAL_GET("logging/file_logging/max_log_files");
+ OS::get_singleton()->add_logger(memnew(RotatedFileLogger(base_path, max_files)));
+ }
+
if (editor) {
Engine::get_singleton()->set_editor_hint(true);
main_args.push_back("--editor");