diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/input_default.cpp | 10 | ||||
-rw-r--r-- | main/input_default.h | 2 | ||||
-rw-r--r-- | main/main.cpp | 13 | ||||
-rw-r--r-- | main/tests/test_gdscript.cpp | 12 | ||||
-rw-r--r-- | main/tests/test_gui.cpp | 4 |
5 files changed, 23 insertions, 18 deletions
diff --git a/main/input_default.cpp b/main/input_default.cpp index 4e2fd6f9d4..e7dc9d4b70 100644 --- a/main/input_default.cpp +++ b/main/input_default.cpp @@ -899,8 +899,14 @@ void InputDefault::joy_axis(int p_device, int p_axis, const JoyAxis &p_value) { return; } - if (ABS(joy.last_axis[p_axis]) > 0.5 && joy.last_axis[p_axis] * p_value.value < 0) { - //changed direction quickly, insert fake event to release pending inputmap actions + //when changing direction quickly, insert fake event to release pending inputmap actions + float last = joy.last_axis[p_axis]; + if (p_value.min == 0 && (last < 0.25 || last > 0.75) && (last - 0.5) * (p_value.value - 0.5) < 0) { + JoyAxis jx; + jx.min = p_value.min; + jx.value = p_value.value < 0.5 ? 0.6 : 0.4; + joy_axis(p_device, p_axis, jx); + } else if (ABS(last) > 0.5 && last * p_value.value < 0) { JoyAxis jx; jx.min = p_value.min; jx.value = p_value.value < 0 ? 0.1 : -0.1; diff --git a/main/input_default.h b/main/input_default.h index 35e841a488..92ef67c7b5 100644 --- a/main/input_default.h +++ b/main/input_default.h @@ -214,7 +214,7 @@ public: virtual void start_joy_vibration(int p_device, float p_weak_magnitude, float p_strong_magnitude, float p_duration = 0); virtual void stop_joy_vibration(int p_device); - void set_main_loop(MainLoop *main_loop); + void set_main_loop(MainLoop *p_main_loop); void set_mouse_position(const Point2 &p_posf); void action_press(const StringName &p_action); diff --git a/main/main.cpp b/main/main.cpp index f23da57185..e00a482bde 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1048,7 +1048,7 @@ bool Main::start() { String script; String test; String screen; - String _export_platform; + String _export_preset; String _import; String _import_script; bool noquit = false; @@ -1083,10 +1083,10 @@ bool Main::start() { test = args[i + 1]; } else if (args[i] == "-export") { editor = true; //needs editor - _export_platform = args[i + 1]; + _export_preset = args[i + 1]; } else if (args[i] == "-export_debug") { editor = true; //needs editor - _export_platform = args[i + 1]; + _export_preset = args[i + 1]; export_debug = true; } else if (args[i] == "-import") { editor = true; //needs editor @@ -1136,7 +1136,7 @@ bool Main::start() { #endif - if (_export_platform != "") { + if (_export_preset != "") { if (game_path == "") { String err = "Command line param "; err += export_debug ? "-export_debug" : "-export"; @@ -1243,9 +1243,9 @@ bool Main::start() { //root_node->set_editor(editor); //startup editor - if (_export_platform != "") { + if (_export_preset != "") { - editor_node->export_platform(_export_platform, game_path, export_debug, "", true); + editor_node->export_preset(_export_preset, game_path, export_debug, "", true); game_path = ""; //no load anything } } @@ -1466,6 +1466,7 @@ bool Main::start() { String iconpath = GLOBAL_DEF("application/config/icon", "Variant()"); if (iconpath != "") { Ref<Image> icon; + icon.instance(); if (icon->load(iconpath) == OK) OS::get_singleton()->set_icon(icon); } diff --git a/main/tests/test_gdscript.cpp b/main/tests/test_gdscript.cpp index 95147d8467..0607360d88 100644 --- a/main/tests/test_gdscript.cpp +++ b/main/tests/test_gdscript.cpp @@ -911,7 +911,7 @@ static void _disassemble_class(const Ref<GDScript> &p_class, const Vector<String } } -MainLoop *test(TestType p_test) { +MainLoop *test(TestType p_type) { List<String> cmdlargs = OS::get_singleton()->get_cmdline_args(); @@ -950,7 +950,7 @@ MainLoop *test(TestType p_test) { } } - if (p_test == TEST_TOKENIZER) { + if (p_type == TEST_TOKENIZER) { GDTokenizerText tk; tk.set_code(code); @@ -993,7 +993,7 @@ MainLoop *test(TestType p_test) { } } - if (p_test == TEST_PARSER) { + if (p_type == TEST_PARSER) { GDParser parser; Error err = parser.parse(code); @@ -1010,7 +1010,7 @@ MainLoop *test(TestType p_test) { _parser_show_class(cnode, 0, lines); } - if (p_test == TEST_COMPILER) { + if (p_type == TEST_COMPILER) { GDParser parser; @@ -1044,7 +1044,7 @@ MainLoop *test(TestType p_test) { current = current->get_base(); } - } else if (p_test == TEST_BYTECODE) { + } else if (p_type == TEST_BYTECODE) { Vector<uint8_t> buf = GDTokenizerBuffer::parse_code_string(code); String dst = test.get_basename() + ".gdc"; @@ -1073,7 +1073,7 @@ MainLoop *test(TestType p_test) { namespace TestGDScript { -MainLoop *test(TestType p_test) { +MainLoop *test(TestType p_type) { return NULL; } diff --git a/main/tests/test_gui.cpp b/main/tests/test_gui.cpp index 3c6a708cd8..44d4464aac 100644 --- a/main/tests/test_gui.cpp +++ b/main/tests/test_gui.cpp @@ -278,7 +278,7 @@ public: richtext->set_position(Point2(600, 210)); richtext->set_size(Point2(180, 250)); - richtext->set_anchor_and_margin(MARGIN_RIGHT, Control::ANCHOR_END, 20); + richtext->set_anchor_and_margin(MARGIN_RIGHT, Control::ANCHOR_END, -20); frame->add_child(richtext); @@ -319,8 +319,6 @@ public: ///richtext->add_text("Hello!\n"); //richtext->pop(); - richtext->set_anchor(MARGIN_RIGHT, Control::ANCHOR_END); - TabContainer *tabc = memnew(TabContainer); Control *ctl = memnew(Control); |