diff options
-rw-r--r-- | core/io/http_client.cpp | 4 | ||||
-rw-r--r-- | doc/classes/Input.xml | 4 | ||||
-rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | platform/osx/os_osx.mm | 6 | ||||
-rw-r--r-- | platform/windows/os_windows.cpp | 6 | ||||
-rw-r--r-- | platform/x11/os_x11.cpp | 5 |
6 files changed, 17 insertions, 10 deletions
diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp index de0b6860f9..80a281a21d 100644 --- a/core/io/http_client.cpp +++ b/core/io/http_client.cpp @@ -668,11 +668,11 @@ Error HTTPClient::_get_http_data(uint8_t *p_buffer, int p_bytes, int &r_received // We can't use StreamPeer.get_data, since when reaching EOF we will get an // error without knowing how many bytes we received. Error err = ERR_FILE_EOF; - int read; + int read = 0; int left = p_bytes; r_received = 0; while (left > 0) { - err = connection->get_partial_data(p_buffer, left, read); + err = connection->get_partial_data(p_buffer + r_received, left, read); if (err == OK) { r_received += read; } else if (err == ERR_FILE_EOF) { diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml index a0bb585583..d9929b3d31 100644 --- a/doc/classes/Input.xml +++ b/doc/classes/Input.xml @@ -293,7 +293,7 @@ <argument index="2" name="hotspot" type="Vector2" default="Vector2( 0, 0 )"> </argument> <description> - Set a custom mouse cursor image, which is only visible inside the game window. The hotspot can also be specified. Passing [code]null[/code] to the image parameter resets to the system cursor. See enum [code]CURSOR_*[/code] for the list of shapes. + Sets a custom mouse cursor image, which is only visible inside the game window. The hotspot can also be specified. Passing [code]null[/code] to the image parameter resets to the system cursor. See enum [code]CURSOR_*[/code] for the list of shapes. [code]image[/code]'s size must be lower than 256x256. [code]hotspot[/code] must be within [code]image[/code]'s size. </description> @@ -304,6 +304,8 @@ <argument index="0" name="shape" type="int" enum="Input.CursorShape" default="0"> </argument> <description> + Sets the default cursor shape to be used in the viewport instead of [code]CURSOR_ARROW[/code]. + Note that if you want to change the default cursor shape for [Control]'s nodes, use [member Control.mouse_default_cursor_shape] instead. </description> </method> <method name="set_mouse_mode"> diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 9dd6a8e0ed..e155daa2fa 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -797,7 +797,7 @@ bool ScriptEditor::_test_script_times_on_disk(RES p_for_script) { if (se) { RES edited_res = se->get_edited_resource(); - if (edited_res.is_valid() && p_for_script != edited_res) + if (p_for_script.is_valid() && edited_res.is_valid() && p_for_script != edited_res) continue; if (edited_res->get_path() == "" || edited_res->get_path().find("local://") != -1 || edited_res->get_path().find("::") != -1) diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index c0de4e3f2a..b98113baeb 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -1662,7 +1662,7 @@ void OS_OSX::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, c [cursors[p_shape] release]; cursors[p_shape] = cursor; - if (p_shape == CURSOR_ARROW) { + if (p_shape == cursor_shape) { [cursor set]; } @@ -1671,8 +1671,10 @@ void OS_OSX::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, c } else { // Reset to default system cursor cursors[p_shape] = NULL; + + CursorShape c = cursor_shape; cursor_shape = CURSOR_MAX; - set_cursor_shape(p_shape); + set_cursor_shape(c); } } diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 67fc1c7496..f63aebbbd3 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -2311,7 +2311,7 @@ void OS_Windows::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shap cursors[p_shape] = CreateIconIndirect(&iconinfo); - if (p_shape == CURSOR_ARROW) { + if (p_shape == cursor_shape) { SetCursor(cursors[p_shape]); } @@ -2328,8 +2328,10 @@ void OS_Windows::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shap } else { // Reset to default system cursor cursors[p_shape] = NULL; + + CursorShape c = cursor_shape; cursor_shape = CURSOR_MAX; - set_cursor_shape(p_shape); + set_cursor_shape(c); } } diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index b80a20ce40..24dfe541f9 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -2606,7 +2606,7 @@ void OS_X11::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, c // Save it for a further usage cursors[p_shape] = XcursorImageLoadCursor(x11_display, cursor_image); - if (p_shape == CURSOR_ARROW) { + if (p_shape == current_cursor) { XDefineCursor(x11_display, x11_window, cursors[p_shape]); } @@ -2618,8 +2618,9 @@ void OS_X11::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, c cursors[p_shape] = XcursorImageLoadCursor(x11_display, img[p_shape]); } + CursorShape c = current_cursor; current_cursor = CURSOR_MAX; - set_cursor_shape(p_shape); + set_cursor_shape(c); } } |