mirror of
https://github.com/love2d/love.git
synced 2026-08-19 20:19:42 +02:00
Changed Cursor:getType to only return one value
This commit is contained in:
@@ -32,22 +32,20 @@ int w_getType(lua_State *L)
|
|||||||
mouse::Cursor *cursor = luax_checktype<mouse::Cursor>(L, 1, "Cursor", MOUSE_CURSOR_T);
|
mouse::Cursor *cursor = luax_checktype<mouse::Cursor>(L, 1, "Cursor", MOUSE_CURSOR_T);
|
||||||
|
|
||||||
Cursor::CursorType ctype = cursor->getType();
|
Cursor::CursorType ctype = cursor->getType();
|
||||||
const char *ctypestr;
|
const char *typestr = 0;
|
||||||
|
|
||||||
if (!mouse::Cursor::getConstant(ctype, ctypestr))
|
if (ctype == Cursor::CURSORTYPE_IMAGE)
|
||||||
return luaL_error(L, "Unknown cursor type.");
|
mouse::Cursor::getConstant(ctype, typestr);
|
||||||
|
else if (ctype == Cursor::CURSORTYPE_SYSTEM)
|
||||||
lua_pushstring(L, ctypestr);
|
|
||||||
|
|
||||||
Cursor::SystemCursor systype = cursor->getSystemType();
|
|
||||||
const char *systypestr;
|
|
||||||
|
|
||||||
if (mouse::Cursor::getConstant(systype, systypestr))
|
|
||||||
{
|
{
|
||||||
lua_pushstring(L, systypestr);
|
Cursor::SystemCursor systype = cursor->getSystemType();
|
||||||
return 2;
|
mouse::Cursor::getConstant(systype, typestr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!typestr)
|
||||||
|
return luaL_error(L, "Unknown cursor type.");
|
||||||
|
|
||||||
|
lua_pushstring(L, typestr);
|
||||||
return 1;
|
return 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user