diff --git a/src/modules/mouse/Mouse.h b/src/modules/mouse/Mouse.h index 4542dbf64..2603c2476 100644 --- a/src/modules/mouse/Mouse.h +++ b/src/modules/mouse/Mouse.h @@ -51,7 +51,7 @@ public: virtual Cursor *getCursor() const = 0; - virtual bool hasCursor() const = 0; + virtual bool isCursorSupported() const = 0; virtual double getX() const = 0; virtual double getY() const = 0; diff --git a/src/modules/mouse/sdl/Mouse.cpp b/src/modules/mouse/sdl/Mouse.cpp index b878b569c..4866164f4 100644 --- a/src/modules/mouse/sdl/Mouse.cpp +++ b/src/modules/mouse/sdl/Mouse.cpp @@ -107,7 +107,7 @@ love::mouse::Cursor *Mouse::getCursor() const } -bool Mouse::hasCursor() const +bool Mouse::isCursorSupported() const { return SDL_GetDefaultCursor() != nullptr; } diff --git a/src/modules/mouse/sdl/Mouse.h b/src/modules/mouse/sdl/Mouse.h index 915de6cfb..4c228f107 100644 --- a/src/modules/mouse/sdl/Mouse.h +++ b/src/modules/mouse/sdl/Mouse.h @@ -53,7 +53,7 @@ public: love::mouse::Cursor *getCursor() const override; - bool hasCursor() const override; + bool isCursorSupported() const override; double getX() const override; double getY() const override; diff --git a/src/modules/mouse/wrap_Mouse.cpp b/src/modules/mouse/wrap_Mouse.cpp index c94fd2de5..05baaa5a0 100644 --- a/src/modules/mouse/wrap_Mouse.cpp +++ b/src/modules/mouse/wrap_Mouse.cpp @@ -92,9 +92,9 @@ int w_getCursor(lua_State *L) return 1; } -int w_hasCursor(lua_State *L) +int w_isCursorSupported(lua_State *L) { - luax_pushboolean(L, instance()->hasCursor()); + luax_pushboolean(L, instance()->isCursorSupported()); return 1; } @@ -214,7 +214,7 @@ static const luaL_Reg functions[] = { "getSystemCursor", w_getSystemCursor }, { "setCursor", w_setCursor }, { "getCursor", w_getCursor }, - { "hasCursor", w_hasCursor }, + { "isCursorSupported", w_isCursorSupported }, { "getX", w_getX }, { "getY", w_getY }, { "setX", w_setX }, diff --git a/src/scripts/boot.lua b/src/scripts/boot.lua index 2714ff63e..6dc03f195 100644 --- a/src/scripts/boot.lua +++ b/src/scripts/boot.lua @@ -623,7 +623,7 @@ function love.errhand(msg) love.mouse.setVisible(true) love.mouse.setGrabbed(false) love.mouse.setRelativeMode(false) - if love.mouse.hasCursor() then + if love.mouse.isCursorSupported() then love.mouse.setCursor() end end diff --git a/src/scripts/boot.lua.h b/src/scripts/boot.lua.h index 85e50e7d4..15e18b6e5 100644 --- a/src/scripts/boot.lua.h +++ b/src/scripts/boot.lua.h @@ -1141,8 +1141,9 @@ const unsigned char boot_lua[] = 0x61, 0x62, 0x62, 0x65, 0x64, 0x28, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x0a, 0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x2e, 0x73, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x28, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x0a, - 0x09, 0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x2e, 0x68, 0x61, - 0x73, 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x28, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, + 0x09, 0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x2e, 0x69, 0x73, + 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x28, 0x29, 0x20, + 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x09, 0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x2e, 0x73, 0x65, 0x74, 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x28, 0x29, 0x0a, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,