From fa4c4b8f2129316697d9bbc88350946e0c3ff4db Mon Sep 17 00:00:00 2001 From: Lukasz Gromanowski Date: Tue, 27 Mar 2012 23:07:25 +0200 Subject: [PATCH 1/2] Issue #225: Initialize members in class constructor. --- apps/openmw/mwgui/layouts.cpp | 15 ++++++++++++++- apps/openmw/mwgui/layouts.hpp | 2 ++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwgui/layouts.cpp b/apps/openmw/mwgui/layouts.cpp index dbd6154b7..f2c650fb3 100644 --- a/apps/openmw/mwgui/layouts.cpp +++ b/apps/openmw/mwgui/layouts.cpp @@ -182,7 +182,9 @@ void HUD::setPlayerPos(const float x, const float y) } MapWindow::MapWindow() - : Layout("openmw_map_window_layout.xml"), mGlobal(false) + : Layout("openmw_map_window_layout.xml") + , mGlobal(false) + , mVisible(false) { setCoord(500,0,320,300); setText("WorldButton", "World"); @@ -272,6 +274,17 @@ void MapWindow::onWorldButtonClicked(MyGUI::Widget* _sender) mButton->setCaption( mGlobal ? "Local" : "World" ); } +LocalMapBase::LocalMapBase() + : mCurX(0) + , mCurY(0) + , mInterior(false) + , mLocalMap(NULL) + , mPrefix() + , mChanged(false) + , mLayout(NULL) +{ +} + void LocalMapBase::init(MyGUI::ScrollView* widget, OEngine::GUI::Layout* layout) { mLocalMap = widget; diff --git a/apps/openmw/mwgui/layouts.hpp b/apps/openmw/mwgui/layouts.hpp index 8d9a41a22..614479ccc 100644 --- a/apps/openmw/mwgui/layouts.hpp +++ b/apps/openmw/mwgui/layouts.hpp @@ -34,6 +34,7 @@ namespace MWGui class LocalMapBase { public: + LocalMapBase(); void init(MyGUI::ScrollView* widget, OEngine::GUI::Layout* layout); void setCellPrefix(const std::string& prefix); @@ -85,6 +86,7 @@ namespace MWGui { public: MapWindow(); + virtual ~MapWindow(){} void setVisible(bool b); void setPlayerPos(const float x, const float y); From f86d53636d0611f9fd45c60f7507b69d6671db81 Mon Sep 17 00:00:00 2001 From: Lukasz Gromanowski Date: Wed, 28 Mar 2012 21:36:38 +0200 Subject: [PATCH 2/2] Issue #225: Correction to commit fa4c4b8. Correction to commit fa4c4b8 - memeber mChanged should be set to true, otherwise the map won't display if the game is started in (0, 0) cell. --- apps/openmw/mwgui/layouts.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/openmw/mwgui/layouts.cpp b/apps/openmw/mwgui/layouts.cpp index f2c650fb3..de74214ee 100644 --- a/apps/openmw/mwgui/layouts.cpp +++ b/apps/openmw/mwgui/layouts.cpp @@ -280,7 +280,7 @@ LocalMapBase::LocalMapBase() , mInterior(false) , mLocalMap(NULL) , mPrefix() - , mChanged(false) + , mChanged(true) , mLayout(NULL) { }