diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-02-08 22:35:09 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-02-09 17:14:25 +0100 |
commit | 1b041ecccfbe44a4f50ffc086e3996e2b6eea4f7 (patch) | |
tree | 74cff7036d1ecfb4df5a79a7ca68bedce5bea47e /src/gui/viewport.h | |
parent | 0ca05c54dd814f294617eda286ef175f01baa542 (diff) | |
download | mana-1b041ecccfbe44a4f50ffc086e3996e2b6eea4f7.tar.gz mana-1b041ecccfbe44a4f50ffc086e3996e2b6eea4f7.tar.bz2 mana-1b041ecccfbe44a4f50ffc086e3996e2b6eea4f7.tar.xz mana-1b041ecccfbe44a4f50ffc086e3996e2b6eea4f7.zip |
C++11: Use default member initializers
This patch is not exhaustive.
Diffstat (limited to 'src/gui/viewport.h')
-rw-r--r-- | src/gui/viewport.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/gui/viewport.h b/src/gui/viewport.h index f3f82ce5..96c8afd3 100644 --- a/src/gui/viewport.h +++ b/src/gui/viewport.h @@ -190,17 +190,17 @@ class Viewport : public WindowContainer, public gcn::MouseListener, */ void updateCursorType(); - Map *mMap; /**< The current map. */ + Map *mMap = nullptr; /**< The current map. */ int mScrollRadius; int mScrollLaziness; int mScrollCenterOffsetX; int mScrollCenterOffsetY; - int mMouseX; /**< Current mouse position in pixels. */ - int mMouseY; /**< Current mouse position in pixels. */ - float mPixelViewX; /**< Current viewpoint in pixels. */ - float mPixelViewY; /**< Current viewpoint in pixels. */ - int mDebugFlags; /**< Flags for showing debug graphics. */ + int mMouseX = 0; /**< Current mouse position in pixels. */ + int mMouseY = 0; /**< Current mouse position in pixels. */ + float mPixelViewX = 0.0f; /**< Current viewpoint in pixels. */ + float mPixelViewY = 0.0f; /**< Current viewpoint in pixels. */ + int mDebugFlags = 0; /**< Flags for showing debug graphics. */ struct ShakeEffect { @@ -212,14 +212,14 @@ class Viewport : public WindowContainer, public gcn::MouseListener, using ShakeEffects = std::list<ShakeEffect>; ShakeEffects mShakeEffects; - bool mPlayerFollowMouse; + bool mPlayerFollowMouse = false; - int mLocalWalkTime; /**< Timestamp before the next walk can be sent. */ + int mLocalWalkTime = -1; /**< Timestamp before the next walk can be sent. */ PopupMenu *mPopupMenu; /**< Popup menu. */ - Being *mHoverBeing; /**< Being mouse is currently over. */ - FloorItem *mHoverItem; /**< FloorItem mouse is currently over. */ - BeingPopup *mBeingPopup; /**< Being information popup. */ + Being *mHoverBeing = nullptr; /**< Being mouse is currently over. */ + FloorItem *mHoverItem = nullptr; /**< FloorItem mouse is currently over. */ + BeingPopup *mBeingPopup; /**< Being information popup. */ }; extern Viewport *viewport; /**< The viewport. */ |