CBasicViewport: Make use of in-class initializers

This commit is contained in:
Lioncash 2020-06-28 07:11:24 -04:00
parent 464b417d24
commit 490e8dfd96
2 changed files with 7 additions and 14 deletions

View File

@ -8,11 +8,6 @@
CBasicViewport::CBasicViewport(QWidget *pParent)
: QOpenGLWidget(pParent)
, mLastDrawTime(CTimer::GlobalTime())
, mKeysPressed(0)
, mButtonsPressed(0)
, mCursorState(Qt::ArrowCursor)
, mCursorVisible(true)
{
setMouseTracking(true);
mCamera.SetAspectRatio((float) width() / height());
@ -21,9 +16,7 @@ CBasicViewport::CBasicViewport(QWidget *pParent)
mViewInfo.GameMode = false;
}
CBasicViewport::~CBasicViewport()
{
}
CBasicViewport::~CBasicViewport() = default;
void CBasicViewport::initializeGL()
{

View File

@ -21,19 +21,19 @@ protected:
// Render
CCamera mCamera;
CTimer mFrameTimer;
double mLastDrawTime;
double mLastDrawTime = CTimer::GlobalTime();
SViewInfo mViewInfo;
// Cursor settings
QCursor mCursorState;
bool mCursorVisible;
QCursor mCursorState{Qt::ArrowCursor};
bool mCursorVisible = true;
// Input
QPoint mLastMousePos;
bool mMouseMoved;
bool mMouseMoved = false;
CTimer mMoveTimer;
FMouseInputs mButtonsPressed;
FKeyInputs mKeysPressed;
FMouseInputs mButtonsPressed{0};
FKeyInputs mKeysPressed{0};
public:
explicit CBasicViewport(QWidget *pParent = nullptr);