mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Minor code cleanup
This commit is contained in:
@@ -30,7 +30,7 @@ namespace sdl
|
||||
{
|
||||
|
||||
Cursor::Cursor(image::ImageData *data, int hotx, int hoty)
|
||||
: cursor(0)
|
||||
: cursor(nullptr)
|
||||
, type(CURSORTYPE_IMAGE)
|
||||
, systemType(CURSOR_MAX_ENUM)
|
||||
{
|
||||
@@ -63,7 +63,7 @@ Cursor::Cursor(image::ImageData *data, int hotx, int hoty)
|
||||
}
|
||||
|
||||
Cursor::Cursor(mouse::Cursor::SystemCursor cursortype)
|
||||
: cursor(0)
|
||||
: cursor(nullptr)
|
||||
, type(CURSORTYPE_SYSTEM)
|
||||
, systemType(cursortype)
|
||||
{
|
||||
|
||||
@@ -71,7 +71,7 @@ const char *Mouse::getName() const
|
||||
}
|
||||
|
||||
Mouse::Mouse()
|
||||
: curCursor(0)
|
||||
: curCursor(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ void Mouse::setVisible(bool visible)
|
||||
|
||||
bool Mouse::isDown(Button *buttonlist) const
|
||||
{
|
||||
Uint32 buttonstate = SDL_GetMouseState(0, 0);
|
||||
Uint32 buttonstate = SDL_GetMouseState(nullptr, nullptr);
|
||||
|
||||
for (Button button = *buttonlist; button != BUTTON_MAX_ENUM; button = *(++buttonlist))
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ int w_Cursor_getType(lua_State *L)
|
||||
Cursor *cursor = luax_checkcursor(L, 1);
|
||||
|
||||
Cursor::CursorType ctype = cursor->getType();
|
||||
const char *typestr = 0;
|
||||
const char *typestr = nullptr;
|
||||
|
||||
if (ctype == Cursor::CURSORTYPE_IMAGE)
|
||||
mouse::Cursor::getConstant(ctype, typestr);
|
||||
|
||||
@@ -30,11 +30,11 @@ namespace love
|
||||
namespace mouse
|
||||
{
|
||||
|
||||
static Mouse *instance = 0;
|
||||
static Mouse *instance = nullptr;
|
||||
|
||||
int w_newCursor(lua_State *L)
|
||||
{
|
||||
Cursor *cursor = 0;
|
||||
Cursor *cursor = nullptr;
|
||||
|
||||
if (lua_isstring(L, 1) || luax_istype(L, 1, FILESYSTEM_FILE_T) || luax_istype(L, 1, FILESYSTEM_FILE_DATA_T))
|
||||
luax_convobj(L, 1, "image", "newImageData");
|
||||
@@ -212,7 +212,7 @@ static const lua_CFunction types[] =
|
||||
|
||||
extern "C" int luaopen_love_mouse(lua_State *L)
|
||||
{
|
||||
if (instance == 0)
|
||||
if (instance == nullptr)
|
||||
{
|
||||
EXCEPT_GUARD(instance = new love::mouse::sdl::Mouse();)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user