mirror of
https://github.com/glfw/glfw.git
synced 2024-11-10 09:01:46 +00:00
Cleanup
This commit is contained in:
parent
e8f3de0f2e
commit
efdbfd3883
@ -491,18 +491,19 @@ int _glfwPlatformCreateCursor(_GLFWcursor* cursor,
|
|||||||
|
|
||||||
int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape)
|
int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape)
|
||||||
{
|
{
|
||||||
struct wl_cursor* standard_cursor;
|
struct wl_cursor* standardCursor;
|
||||||
|
|
||||||
standard_cursor = wl_cursor_theme_get_cursor(_glfw.wl.cursorTheme,
|
standardCursor = wl_cursor_theme_get_cursor(_glfw.wl.cursorTheme,
|
||||||
translateCursorShape(shape));
|
translateCursorShape(shape));
|
||||||
if (!standard_cursor) {
|
if (!standardCursor)
|
||||||
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"Wayland: Standard cursor \"%s\" not found",
|
"Wayland: Standard cursor \"%s\" not found",
|
||||||
translateCursorShape(shape));
|
translateCursorShape(shape));
|
||||||
return GLFW_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
cursor->wl.image = standard_cursor->images[0];
|
|
||||||
|
|
||||||
|
cursor->wl.image = standardCursor->images[0];
|
||||||
return GLFW_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -534,7 +535,9 @@ void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor)
|
|||||||
|
|
||||||
if (window->cursorMode == GLFW_CURSOR_NORMAL)
|
if (window->cursorMode == GLFW_CURSOR_NORMAL)
|
||||||
{
|
{
|
||||||
if (cursor == NULL)
|
if (cursor)
|
||||||
|
image = cursor->wl.image;
|
||||||
|
else
|
||||||
{
|
{
|
||||||
defaultCursor = wl_cursor_theme_get_cursor(_glfw.wl.cursorTheme,
|
defaultCursor = wl_cursor_theme_get_cursor(_glfw.wl.cursorTheme,
|
||||||
"left_ptr");
|
"left_ptr");
|
||||||
@ -546,10 +549,6 @@ void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor)
|
|||||||
}
|
}
|
||||||
image = defaultCursor->images[0];
|
image = defaultCursor->images[0];
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
image = cursor->wl.image;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (image)
|
if (image)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user