From f1a659e2acb859e4a28ef120c180d4cf96b89cb0 Mon Sep 17 00:00:00 2001 From: Glorf Date: Thu, 2 May 2013 14:49:30 +0200 Subject: [PATCH 1/9] Bugfix #730 --- files/mygui/openmw_settings_window.layout | 24 +++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/files/mygui/openmw_settings_window.layout b/files/mygui/openmw_settings_window.layout index 693c5a9cb5..77d14d0f6d 100644 --- a/files/mygui/openmw_settings_window.layout +++ b/files/mygui/openmw_settings_window.layout @@ -16,7 +16,7 @@ - + @@ -31,7 +31,7 @@ - + @@ -65,35 +65,35 @@ - + - + - + - + - + @@ -118,7 +118,7 @@ - + @@ -134,7 +134,7 @@ - + @@ -199,7 +199,7 @@ - + @@ -224,7 +224,7 @@ - + @@ -232,7 +232,7 @@ - + From dcccfd9f22bff4d6e34ca5fbcb291df1fe486d0f Mon Sep 17 00:00:00 2001 From: kpp Date: Thu, 2 May 2013 22:43:21 +0400 Subject: [PATCH 2/9] Initialize values --- apps/openmw/mwgui/loadingscreen.cpp | 1 + apps/openmw/mwmechanics/character.cpp | 9 ++++++++- apps/openmw/mwrender/water.hpp | 4 +++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwgui/loadingscreen.cpp b/apps/openmw/mwgui/loadingscreen.cpp index 3b341574d9..018f51feb8 100644 --- a/apps/openmw/mwgui/loadingscreen.cpp +++ b/apps/openmw/mwgui/loadingscreen.cpp @@ -22,6 +22,7 @@ namespace MWGui , mLastRenderTime(0.f) , mLastWallpaperChangeTime(0.f) , mFirstLoad(true) + , mTotalRefsLoading(0) { getWidget(mLoadingText, "LoadingText"); getWidget(mProgressBar, "ProgressBar"); diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index b82fc4dc56..24a8e53ee6 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -104,7 +104,14 @@ static void getStateInfo(CharacterState state, std::string *group) CharacterController::CharacterController(const MWWorld::Ptr &ptr, MWRender::Animation *anim, CharacterState state, bool loop) - : mPtr(ptr), mAnimation(anim), mCharState(state), mSkipAnim(false), mMovingAnim(false), mSecondsOfRunning(0), mSecondsOfSwimming(0) + : mPtr(ptr) + , mAnimation(anim) + , mCharState(state) + , mSkipAnim(false) + , mMovingAnim(false) + , mSecondsOfRunning(0) + , mSecondsOfSwimming(0) + , mLooping(false) { if(!mAnimation) return; diff --git a/apps/openmw/mwrender/water.hpp b/apps/openmw/mwrender/water.hpp index 6c03236370..a21d03ad6a 100644 --- a/apps/openmw/mwrender/water.hpp +++ b/apps/openmw/mwrender/water.hpp @@ -41,7 +41,9 @@ namespace MWRender { { public: Reflection(Ogre::SceneManager* sceneManager) - : mSceneMgr(sceneManager) {} + : mSceneMgr(sceneManager) + , mIsUnderwater(false) + {} virtual ~Reflection() {} virtual void setHeight (float height) {} From a8b17066783fd9e3f1297d411723b9aa5d9a9784 Mon Sep 17 00:00:00 2001 From: greye Date: Fri, 3 May 2013 10:51:42 +0400 Subject: [PATCH 3/9] init pointer value to prevent segfault --- apps/openmw/mwrender/terrainmaterial.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/openmw/mwrender/terrainmaterial.cpp b/apps/openmw/mwrender/terrainmaterial.cpp index b9c055acdf..892dab7cfc 100644 --- a/apps/openmw/mwrender/terrainmaterial.cpp +++ b/apps/openmw/mwrender/terrainmaterial.cpp @@ -49,6 +49,7 @@ namespace MWRender TerrainMaterial::Profile::Profile(Ogre::TerrainMaterialGenerator* parent, const Ogre::String& name, const Ogre::String& desc) : Ogre::TerrainMaterialGenerator::Profile(parent, name, desc) , mGlobalColourMap(false) + , mMaterial(0) { } From 57f22c77c00b59a27dcc825524a55fa6e75b2bb4 Mon Sep 17 00:00:00 2001 From: Glorf Date: Fri, 3 May 2013 12:44:27 +0200 Subject: [PATCH 4/9] Bugfix #732 part 1 --- apps/openmw/mwbase/windowmanager.hpp | 2 ++ apps/openmw/mwgui/messagebox.cpp | 14 ++++++++++++-- apps/openmw/mwgui/messagebox.hpp | 4 +++- apps/openmw/mwgui/settingswindow.cpp | 4 +++- apps/openmw/mwgui/windowmanagerimp.cpp | 10 ++++++++++ apps/openmw/mwgui/windowmanagerimp.hpp | 2 ++ apps/openmw/mwinput/inputmanagerimp.cpp | 4 ++++ 7 files changed, 36 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwbase/windowmanager.hpp b/apps/openmw/mwbase/windowmanager.hpp index 976d7d84c1..1832bf5420 100644 --- a/apps/openmw/mwbase/windowmanager.hpp +++ b/apps/openmw/mwbase/windowmanager.hpp @@ -201,6 +201,8 @@ namespace MWBase ///< Hides dialog and schedules dialog to be deleted. virtual void messageBox (const std::string& message, const std::vector& buttons = std::vector()) = 0; + virtual void staticMessageBox(const std::string& message) = 0; + virtual void removeStaticMessageBox() = 0; virtual void enterPressed () = 0; virtual int readPressedButton() = 0; diff --git a/apps/openmw/mwgui/messagebox.cpp b/apps/openmw/mwgui/messagebox.cpp index 876fb35220..2fc50f257c 100644 --- a/apps/openmw/mwgui/messagebox.cpp +++ b/apps/openmw/mwgui/messagebox.cpp @@ -13,6 +13,7 @@ namespace MWGui // defines mMessageBoxSpeed = 0.1; mInterMessageBoxe = NULL; + mStaticMessageBox = NULL; } void MessageBoxManager::onFrame (float frameDuration) @@ -68,11 +69,14 @@ namespace MWGui } } - void MessageBoxManager::createMessageBox (const std::string& message) + void MessageBoxManager::createMessageBox (const std::string& message, bool stat) { MessageBox *box = new MessageBox(*this, message); - removeMessageBox(message.length()*mMessageBoxSpeed, box); + if(stat) + mStaticMessageBox = box; + else + removeMessageBox(message.length()*mMessageBoxSpeed, box); mMessageBoxes.push_back(box); std::vector::iterator it; @@ -90,6 +94,12 @@ namespace MWGui } } + void MessageBoxManager::removeStaticMessageBox () + { + removeMessageBox(mStaticMessageBox); + mStaticMessageBox = NULL; + } + bool MessageBoxManager::createInteractiveMessageBox (const std::string& message, const std::vector& buttons) { if(mInterMessageBoxe != NULL) { diff --git a/apps/openmw/mwgui/messagebox.hpp b/apps/openmw/mwgui/messagebox.hpp index 0df6f3544b..0e47b0323b 100644 --- a/apps/openmw/mwgui/messagebox.hpp +++ b/apps/openmw/mwgui/messagebox.hpp @@ -31,7 +31,8 @@ namespace MWGui public: MessageBoxManager (); void onFrame (float frameDuration); - void createMessageBox (const std::string& message); + void createMessageBox (const std::string& message, bool stat = false); + void removeStaticMessageBox (); bool createInteractiveMessageBox (const std::string& message, const std::vector& buttons); bool isInteractiveMessageBox (); @@ -52,6 +53,7 @@ namespace MWGui private: std::vector mMessageBoxes; InteractiveMessageBox* mInterMessageBoxe; + MessageBox* mStaticMessageBox; std::vector mTimers; float mMessageBoxSpeed; }; diff --git a/apps/openmw/mwgui/settingswindow.cpp b/apps/openmw/mwgui/settingswindow.cpp index 39ee4e01d0..413171dd4d 100644 --- a/apps/openmw/mwgui/settingswindow.cpp +++ b/apps/openmw/mwgui/settingswindow.cpp @@ -551,6 +551,8 @@ namespace MWGui while (mControlsBox->getChildCount()) MyGUI::Gui::getInstance().destroyWidget(mControlsBox->getChildAt(0)); + MWBase::Environment::get().getWindowManager ()->removeStaticMessageBox(); + std::vector actions = MWBase::Environment::get().getInputManager()->getActionSorting (); const int h = 18; @@ -585,7 +587,7 @@ namespace MWGui static_cast(_sender)->setCaptionWithReplacing("#{sNone}"); - MWBase::Environment::get().getWindowManager ()->messageBox ("#{sControlsMenu3}"); + MWBase::Environment::get().getWindowManager ()->staticMessageBox ("#{sControlsMenu3}"); MWBase::Environment::get().getWindowManager ()->disallowMouse(); MWBase::Environment::get().getInputManager ()->enableDetectingBindingMode (actionId); diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp index ff83f5f672..be947cb8a2 100644 --- a/apps/openmw/mwgui/windowmanagerimp.cpp +++ b/apps/openmw/mwgui/windowmanagerimp.cpp @@ -600,6 +600,16 @@ namespace MWGui } } + void WindowManager::staticMessageBox(const std::string& message) + { + mMessageBoxManager->createMessageBox(message, true); + } + + void WindowManager::removeStaticMessageBox() + { + mMessageBoxManager->removeStaticMessageBox(); + } + void WindowManager::enterPressed () { mMessageBoxManager->enterPressed(); diff --git a/apps/openmw/mwgui/windowmanagerimp.hpp b/apps/openmw/mwgui/windowmanagerimp.hpp index acac77bf31..f3413ca2f6 100644 --- a/apps/openmw/mwgui/windowmanagerimp.hpp +++ b/apps/openmw/mwgui/windowmanagerimp.hpp @@ -192,6 +192,8 @@ namespace MWGui virtual void removeDialog(OEngine::GUI::Layout* dialog); ///< Hides dialog and schedules dialog to be deleted. virtual void messageBox (const std::string& message, const std::vector& buttons = std::vector()); + virtual void staticMessageBox(const std::string& message); + virtual void removeStaticMessageBox(); virtual void enterPressed (); virtual int readPressedButton (); ///< returns the index of the pressed button or -1 if no button was pressed (->MessageBoxmanager->InteractiveMessageBox) diff --git a/apps/openmw/mwinput/inputmanagerimp.cpp b/apps/openmw/mwinput/inputmanagerimp.cpp index 1cd7164133..01ef36177c 100644 --- a/apps/openmw/mwinput/inputmanagerimp.cpp +++ b/apps/openmw/mwinput/inputmanagerimp.cpp @@ -917,6 +917,10 @@ namespace MWInput void InputManager::keyBindingDetected(ICS::InputControlSystem* ICS, ICS::Control* control , OIS::KeyCode key, ICS::Control::ControlChangingDirection direction) { + //Disallow binding escape key + if(key==OIS::KC_ESCAPE) + return + clearAllBindings(control); ICS::DetectingBindingListener::keyBindingDetected (ICS, control, key, direction); MWBase::Environment::get().getWindowManager ()->notifyInputActionBound (); From 517dfb4d75b28899c08dbdb48db5542f8c865aa1 Mon Sep 17 00:00:00 2001 From: Glorf Date: Fri, 3 May 2013 13:24:34 +0200 Subject: [PATCH 5/9] Bugfix #732 part 2 --- apps/openmw/mwinput/inputmanagerimp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwinput/inputmanagerimp.cpp b/apps/openmw/mwinput/inputmanagerimp.cpp index 01ef36177c..a7ec4d4d23 100644 --- a/apps/openmw/mwinput/inputmanagerimp.cpp +++ b/apps/openmw/mwinput/inputmanagerimp.cpp @@ -917,8 +917,8 @@ namespace MWInput void InputManager::keyBindingDetected(ICS::InputControlSystem* ICS, ICS::Control* control , OIS::KeyCode key, ICS::Control::ControlChangingDirection direction) { - //Disallow binding escape key - if(key==OIS::KC_ESCAPE) + //Disallow binding escape key, and unassigned keys + if(key==OIS::KC_ESCAPE || key==OIS::KC_UNASSIGNED) return clearAllBindings(control); From 7fe7111c19d0c2cb541a6b20316424470f5ba1a2 Mon Sep 17 00:00:00 2001 From: gus Date: Fri, 3 May 2013 17:09:09 +0100 Subject: [PATCH 6/9] Fargoth quest almost works. There is still a sall problem as the path taken is not exactly the same. I need to copy the exact way morrowind do pathfinding... --- apps/openmw/mwmechanics/aitravel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwmechanics/aitravel.cpp b/apps/openmw/mwmechanics/aitravel.cpp index 13ae2a592e..b221856674 100644 --- a/apps/openmw/mwmechanics/aitravel.cpp +++ b/apps/openmw/mwmechanics/aitravel.cpp @@ -48,7 +48,7 @@ namespace MWMechanics { int sideX = sgn(actor.getCell()->mCell->mData.mX - player.getCell()->mCell->mData.mX); //check if actor is near the border of an inactive cell. If so, disable aitravel. - if(sideX*(pos.pos[0] - actor.getCell()->mCell->mData.mX * ESM::Land::REAL_SIZE) > sideX*(ESM::Land::REAL_SIZE/2. - 2000)) + if(sideX*(pos.pos[0] - actor.getCell()->mCell->mData.mX * ESM::Land::REAL_SIZE) > sideX*(ESM::Land::REAL_SIZE/2. - 200)) { MWWorld::Class::get(actor).getMovementSettings(actor).mPosition[1] = 0; return true; @@ -58,7 +58,7 @@ namespace MWMechanics { int sideY = sgn(actor.getCell()->mCell->mData.mY - player.getCell()->mCell->mData.mY); //check if actor is near the border of an inactive cell. If so, disable aitravel. - if(sideY*(pos.pos[1] - actor.getCell()->mCell->mData.mY * ESM::Land::REAL_SIZE) > sideY*(ESM::Land::REAL_SIZE/2. - 2000)) + if(sideY*(pos.pos[1] - actor.getCell()->mCell->mData.mY * ESM::Land::REAL_SIZE) > sideY*(ESM::Land::REAL_SIZE/2. - 200)) { MWWorld::Class::get(actor).getMovementSettings(actor).mPosition[1] = 0; return true; From 6fbd940a2f94f6e184303d5ba26c98199557ec60 Mon Sep 17 00:00:00 2001 From: Lukasz Gromanowski Date: Sat, 4 May 2013 07:31:54 +0200 Subject: [PATCH 7/9] Fix warning issued by GCC 4.8 in oics/tinyxml.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix warning issued by GCC 4.8 (and as far I remember 4.7 too) about not supported "%lf" format string: openmw/extern/oics/tinyxml.cpp: In member function ‘void TiXmlAttribute::SetDoubleValue(double)’: openmw/extern/oics/tinyxml.cpp:1269:50: warning: ISO C++98 does not support the ‘%lf’ gnu_printf format [-Wformat=] TIXML_SNPRINTF( buf, sizeof(buf), "%lf", _value); ^ Signed-off-by: Lukasz Gromanowski --- extern/oics/tinyxml.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/extern/oics/tinyxml.cpp b/extern/oics/tinyxml.cpp index 841a41cd39..29a4768aa0 100644 --- a/extern/oics/tinyxml.cpp +++ b/extern/oics/tinyxml.cpp @@ -706,9 +706,9 @@ void TiXmlElement::SetDoubleAttribute( const char * name, double val ) { char buf[256]; #if defined(TIXML_SNPRINTF) - TIXML_SNPRINTF( buf, sizeof(buf), "%f", val ); + TIXML_SNPRINTF( buf, sizeof(buf), "%f", val ); #else - sprintf( buf, "%f", val ); + sprintf( buf, "%f", val ); #endif SetAttribute( name, buf ); } @@ -1266,9 +1266,9 @@ void TiXmlAttribute::SetDoubleValue( double _value ) { char buf [256]; #if defined(TIXML_SNPRINTF) - TIXML_SNPRINTF( buf, sizeof(buf), "%lf", _value); + TIXML_SNPRINTF( buf, sizeof(buf), "%f", _value); #else - sprintf (buf, "%lf", _value); + sprintf (buf, "%f", _value); #endif SetValue (buf); } From 5de0db9a28ff8c7f1d44f433ce070acea729cc68 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Sat, 4 May 2013 18:57:34 +0200 Subject: [PATCH 8/9] updated credits file --- credits.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/credits.txt b/credits.txt index 6456e30a10..c7430d6841 100644 --- a/credits.txt +++ b/credits.txt @@ -52,6 +52,7 @@ Paul McElroy (Greendogo) Pieter van der Kloet (pvdk) Radu-Marius Popovici (rpopovici) Roman Melnik (Kromgart) +Roman Proskuryakov (humbug) Sandy Carter (bwrsandman) Sebastian Wick (swick) Sergey Shambir From 2ccb77991070ee57fb26f5386ad2255329606cd5 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 4 May 2013 19:14:19 +0200 Subject: [PATCH 9/9] Fix member variable case problem --- components/compiler/lineparser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/compiler/lineparser.cpp b/components/compiler/lineparser.cpp index 5a22309f94..40462c4881 100644 --- a/components/compiler/lineparser.cpp +++ b/components/compiler/lineparser.cpp @@ -141,7 +141,7 @@ namespace Compiler if (mState==SetMemberVarState) { - mMemberName = Misc::StringUtils::lowerCase (name); + mMemberName = name; char type = getContext().getMemberType (mMemberName, mName); if (type!=' ')