From 490e8dfd9692d4db3d7d4516ed86a8b43aea3448 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 28 Jun 2020 07:11:24 -0400 Subject: [PATCH] CBasicViewport: Make use of in-class initializers --- src/Editor/CBasicViewport.cpp | 9 +-------- src/Editor/CBasicViewport.h | 12 ++++++------ 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/Editor/CBasicViewport.cpp b/src/Editor/CBasicViewport.cpp index a81224ac..260800c7 100644 --- a/src/Editor/CBasicViewport.cpp +++ b/src/Editor/CBasicViewport.cpp @@ -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() { diff --git a/src/Editor/CBasicViewport.h b/src/Editor/CBasicViewport.h index 18ead8d4..4c985146 100644 --- a/src/Editor/CBasicViewport.h +++ b/src/Editor/CBasicViewport.h @@ -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);