1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-16 14:00:40 +00:00

Merge pull request #13437 from xsellier/bugfix/mouse-cursor-lag

Implement hardware cursor acceleration for Godot Engine 2.1
This commit is contained in:
Rémi Verschelde
2018-01-03 08:36:44 +01:00
committed by GitHub
36 changed files with 335 additions and 264 deletions

View File

@@ -953,20 +953,6 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
register_scene_types();
register_server_types();
GLOBAL_DEF("display/custom_mouse_cursor", String());
GLOBAL_DEF("display/custom_mouse_cursor_hotspot", Vector2());
Globals::get_singleton()->set_custom_property_info("display/custom_mouse_cursor", PropertyInfo(Variant::STRING, "display/custom_mouse_cursor", PROPERTY_HINT_FILE, "*.png,*.webp"));
if (String(Globals::get_singleton()->get("display/custom_mouse_cursor")) != String()) {
//print_line("use custom cursor");
Ref<Texture> cursor = ResourceLoader::load(Globals::get_singleton()->get("display/custom_mouse_cursor"));
if (cursor.is_valid()) {
// print_line("loaded ok");
Vector2 hotspot = Globals::get_singleton()->get("display/custom_mouse_cursor_hotspot");
Input::get_singleton()->set_custom_mouse_cursor(cursor, hotspot);
}
}
#ifdef TOOLS_ENABLED
EditorNode::register_editor_types();
#endif