diff options
| author | Rémi Verschelde | 2018-01-03 08:35:59 +0100 |
|---|---|---|
| committer | GitHub | 2018-01-03 08:35:59 +0100 |
| commit | 6322b0bbb7fec1e6574f0bb09c99647472ef3a52 (patch) | |
| tree | 235aab52e666b4619c940bb1765a76ad2649cfc7 /main/input_default.cpp | |
| parent | 2c226e4edf720ebbadf355e244b27082ca01f330 (diff) | |
| parent | a392dbdbe3f67d42698e47399421fbdf6ae5c90a (diff) | |
| download | godot-6322b0bbb7fec1e6574f0bb09c99647472ef3a52.tar.gz godot-6322b0bbb7fec1e6574f0bb09c99647472ef3a52.tar.zst godot-6322b0bbb7fec1e6574f0bb09c99647472ef3a52.zip | |
Diffstat (limited to 'main/input_default.cpp')
| -rw-r--r-- | main/input_default.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/main/input_default.cpp b/main/input_default.cpp index 5026b8bb3..c3454d86f 100644 --- a/main/input_default.cpp +++ b/main/input_default.cpp @@ -497,26 +497,16 @@ bool InputDefault::is_emulating_touchscreen() const { return emulate_touch; } -void InputDefault::set_custom_mouse_cursor(const RES &p_cursor, const Vector2 &p_hotspot) { - /* no longer supported, leaving this for reference to anyone who might want to implement hardware cursors +void InputDefault::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) { + if (Engine::get_singleton()->is_editor_hint()) + return; + if (custom_cursor == p_cursor) return; custom_cursor = p_cursor; - if (p_cursor.is_null()) { - set_mouse_mode(MOUSE_MODE_VISIBLE); - //removed, please insist us to implement hardare cursors - //VisualServer::get_singleton()->cursor_set_visible(false); - } else { - Ref<AtlasTexture> atex = custom_cursor; - Rect2 region = atex.is_valid() ? atex->get_region() : Rect2(); - set_mouse_mode(MOUSE_MODE_HIDDEN); - VisualServer::get_singleton()->cursor_set_visible(true); - VisualServer::get_singleton()->cursor_set_texture(custom_cursor->get_rid(), p_hotspot, 0, region); - VisualServer::get_singleton()->cursor_set_pos(get_mouse_position()); - } - */ + OS::get_singleton()->set_custom_mouse_cursor(p_cursor, (OS::CursorShape)p_shape, p_hotspot); } void InputDefault::set_mouse_in_window(bool p_in_window) { |
