1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

C++11 cleanup on constructors dir client (#6012)

* C++11 cleanup on constructors dir client
This commit is contained in:
Vincent Glize 2017-06-21 08:04:45 +02:00 committed by Loïc Blot
parent 76074ad81a
commit af3badf7a9
6 changed files with 71 additions and 125 deletions

View file

@ -141,24 +141,23 @@ public:
MyEventReceiver()
{
clearInput();
#ifdef HAVE_TOUCHSCREENGUI
m_touchscreengui = NULL;
#endif
}
bool leftclicked;
bool rightclicked;
bool leftreleased;
bool rightreleased;
bool leftclicked = false;
bool rightclicked = false;
bool leftreleased = false;
bool rightreleased = false;
bool left_active;
bool middle_active;
bool right_active;
bool left_active = false;
bool middle_active = false;
bool right_active = false;
s32 mouse_wheel;
s32 mouse_wheel = 0;
JoystickController *joystick;
JoystickController *joystick = nullptr;
#ifdef HAVE_TOUCHSCREENGUI
TouchScreenGUI *m_touchscreengui;
@ -221,7 +220,7 @@ class RealInputHandler : public InputHandler
{
public:
RealInputHandler(IrrlichtDevice *device, MyEventReceiver *receiver)
: m_device(device), m_receiver(receiver), m_mousepos(0, 0)
: m_device(device), m_receiver(receiver)
{
m_receiver->joystick = &joystick;
}
@ -277,24 +276,15 @@ public:
}
private:
IrrlichtDevice *m_device;
MyEventReceiver *m_receiver;
IrrlichtDevice *m_device = nullptr;
MyEventReceiver *m_receiver = nullptr;
v2s32 m_mousepos;
};
class RandomInputHandler : public InputHandler
{
public:
RandomInputHandler()
{
leftdown = false;
rightdown = false;
leftclicked = false;
rightclicked = false;
leftreleased = false;
rightreleased = false;
keydown.clear();
}
RandomInputHandler() {}
virtual bool isKeyDown(const KeyPress &keyCode) { return keydown[keyCode]; }
virtual bool wasKeyDown(const KeyPress &keyCode) { return false; }
virtual v2s32 getMousePos() { return mousepos; }
@ -390,12 +380,12 @@ private:
KeyList keydown;
v2s32 mousepos;
v2s32 mousespeed;
bool leftdown;
bool rightdown;
bool leftclicked;
bool rightclicked;
bool leftreleased;
bool rightreleased;
bool leftdown = false;
bool rightdown = false;
bool leftclicked = false;
bool rightclicked = false;
bool leftreleased = false;
bool rightreleased = false;
};
#endif