From 5049fe4320ee09997fda6498801f4104b8e4167e Mon Sep 17 00:00:00 2001 From: PlutonicOverkill Date: Thu, 20 Jul 2017 21:31:05 +1200 Subject: [PATCH 1/6] Pause game when minimised on Windows --- components/sdlutil/sdlinputwrapper.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/sdlutil/sdlinputwrapper.cpp b/components/sdlutil/sdlinputwrapper.cpp index c88210b0a..ac172b84b 100644 --- a/components/sdlutil/sdlinputwrapper.cpp +++ b/components/sdlutil/sdlinputwrapper.cpp @@ -221,10 +221,12 @@ InputWrapper::InputWrapper(SDL_Window* window, osg::ref_ptr v case SDL_WINDOWEVENT_CLOSE: break; case SDL_WINDOWEVENT_SHOWN: + case SDL_WINDOWEVENT_RESTORED: if (mWindowListener) mWindowListener->windowVisibilityChange(true); break; case SDL_WINDOWEVENT_HIDDEN: + case SDL_WINDOWEVENT_MINIMIZED: if (mWindowListener) mWindowListener->windowVisibilityChange(false); break; From 0e2e23e9f823520531e9684950d30f057f51e1b8 Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 20 Jul 2017 20:59:09 +0200 Subject: [PATCH 2/6] Remove tooltip object as part of WindowManager::clear --- apps/openmw/mwgui/windowmanagerimp.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp index bc77eb069..0ca378fe7 100644 --- a/apps/openmw/mwgui/windowmanagerimp.cpp +++ b/apps/openmw/mwgui/windowmanagerimp.cpp @@ -1694,6 +1694,8 @@ namespace MWGui mCompanionWindow->resetReference(); mConsole->resetReference(); + mToolTips->setFocusObject(MWWorld::ConstPtr()); + mInventoryWindow->clear(); mSelectedSpell.clear(); From c9f8a220dc39357af4d5117158ae8910f278a81a Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 20 Jul 2017 20:59:36 +0200 Subject: [PATCH 3/6] Update the tooltip when the focusObject is set --- apps/openmw/mwgui/tooltips.cpp | 8 ++++++++ apps/openmw/mwgui/tooltips.hpp | 3 +++ apps/openmw/mwworld/worldimp.cpp | 4 ++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwgui/tooltips.cpp b/apps/openmw/mwgui/tooltips.cpp index fad78d9a6..1e770a60b 100644 --- a/apps/openmw/mwgui/tooltips.cpp +++ b/apps/openmw/mwgui/tooltips.cpp @@ -40,6 +40,7 @@ namespace MWGui , mEnabled(true) , mFullHelp(false) , mShowOwned(0) + , mFrameDuration(0.f) { getWidget(mDynamicToolTipBox, "DynamicToolTipBox"); @@ -67,6 +68,11 @@ namespace MWGui } void ToolTips::onFrame(float frameDuration) + { + mFrameDuration = frameDuration; + } + + void ToolTips::update(float frameDuration) { while (mDynamicToolTipBox->getChildCount()) @@ -320,6 +326,8 @@ namespace MWGui void ToolTips::setFocusObject(const MWWorld::ConstPtr& focus) { mFocusObject = focus; + + update(mFrameDuration); } MyGUI::IntSize ToolTips::getToolTipViaPtr (int count, bool image) diff --git a/apps/openmw/mwgui/tooltips.hpp b/apps/openmw/mwgui/tooltips.hpp index 2db5fce34..bb2affc63 100644 --- a/apps/openmw/mwgui/tooltips.hpp +++ b/apps/openmw/mwgui/tooltips.hpp @@ -50,6 +50,7 @@ namespace MWGui ToolTips(); void onFrame(float frameDuration); + void update(float frameDuration); void setEnabled(bool enabled); @@ -126,6 +127,8 @@ namespace MWGui bool mFullHelp; int mShowOwned; + + float mFrameDuration; }; } #endif diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index c6d37b34c..08b0e7182 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -1756,8 +1756,6 @@ namespace MWWorld // inform the GUI about focused object MWWorld::Ptr object = getFacedObject (); - MWBase::Environment::get().getWindowManager()->setFocusObject(object); - // retrieve object dimensions so we know where to place the floating label if (!object.isEmpty ()) { @@ -1766,6 +1764,8 @@ namespace MWWorld MWBase::Environment::get().getWindowManager()->setFocusObjectScreenCoords( screenBounds.x(), screenBounds.y(), screenBounds.z(), screenBounds.w()); } + + MWBase::Environment::get().getWindowManager()->setFocusObject(object); } MWWorld::Ptr World::getFacedObject(float maxDistance, bool ignorePlayer) From 5c11266a4621e5a6368d40380d985e0686a50a33 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 22 Jul 2017 00:06:43 +0200 Subject: [PATCH 4/6] Fix character preview item selection --- apps/openmw/mwrender/characterpreview.cpp | 9 ++++++--- apps/openmw/mwrender/characterpreview.hpp | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwrender/characterpreview.cpp b/apps/openmw/mwrender/characterpreview.cpp index 877c35bba..217a0d1fb 100644 --- a/apps/openmw/mwrender/characterpreview.cpp +++ b/apps/openmw/mwrender/characterpreview.cpp @@ -256,7 +256,8 @@ namespace MWRender // NB Camera::setViewport has threading issues osg::ref_ptr stateset = new osg::StateSet; - stateset->setAttributeAndModes(new osg::Viewport(0, mSizeY-sizeY, std::min(mSizeX, sizeX), std::min(mSizeY, sizeY))); + mViewport = new osg::Viewport(0, mSizeY-sizeY, std::min(mSizeX, sizeX), std::min(mSizeY, sizeY)); + stateset->setAttributeAndModes(mViewport); mCamera->setStateSet(stateset); redraw(); @@ -334,8 +335,10 @@ namespace MWRender int InventoryPreview::getSlotSelected (int posX, int posY) { - float projX = (posX / mCamera->getViewport()->width()) * 2 - 1.f; - float projY = (posY / mCamera->getViewport()->height()) * 2 - 1.f; + if (!mViewport) + return -1; + float projX = (posX / mViewport->width()) * 2 - 1.f; + float projY = (posY / mViewport->height()) * 2 - 1.f; // With Intersector::WINDOW, the intersection ratios are slightly inaccurate. Seems to be a // precision issue - compiling with OSG_USE_FLOAT_MATRIX=0, Intersector::WINDOW works ok. // Using Intersector::PROJECTION results in better precision because the start/end points and the model matrices diff --git a/apps/openmw/mwrender/characterpreview.hpp b/apps/openmw/mwrender/characterpreview.hpp index f0d5ad0c9..b71bffb62 100644 --- a/apps/openmw/mwrender/characterpreview.hpp +++ b/apps/openmw/mwrender/characterpreview.hpp @@ -17,6 +17,7 @@ namespace osg class Texture2D; class Camera; class Group; + class Viewport; } namespace MWRender @@ -83,6 +84,8 @@ namespace MWRender int getSlotSelected(int posX, int posY); protected: + osg::ref_ptr mViewport; + virtual void onSetup(); }; From 9bc24ab629992959323340bb325024ae68a7635a Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 22 Jul 2017 00:34:36 +0200 Subject: [PATCH 5/6] Fix character preview zNear/zFar not being autocomputed as intended (Bug #3955) --- apps/openmw/mwrender/characterpreview.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/openmw/mwrender/characterpreview.cpp b/apps/openmw/mwrender/characterpreview.cpp index 217a0d1fb..f7219959a 100644 --- a/apps/openmw/mwrender/characterpreview.cpp +++ b/apps/openmw/mwrender/characterpreview.cpp @@ -133,6 +133,7 @@ namespace MWRender mCamera->setRenderOrder(osg::Camera::PRE_RENDER); mCamera->attach(osg::Camera::COLOR_BUFFER, mTexture); mCamera->setName("CharacterPreview"); + mCamera->setComputeNearFarMode(osg::Camera::COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES); mCamera->setNodeMask(Mask_RenderToTexture); From 411b78562e809a552cfb30e281d2c465114e33b7 Mon Sep 17 00:00:00 2001 From: Nikolay Kasyanov Date: Sat, 22 Jul 2017 21:25:59 +0200 Subject: [PATCH 6/6] [macOS, CI] Use most recent dependencies Includes a fix for https://bugs.openmw.org/issues/3904. --- CI/before_install.osx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/before_install.osx.sh b/CI/before_install.osx.sh index ee2cc9cc9..25e1c9517 100755 --- a/CI/before_install.osx.sh +++ b/CI/before_install.osx.sh @@ -6,5 +6,5 @@ brew outdated cmake || brew upgrade cmake brew outdated pkgconfig || brew upgrade pkgconfig brew install $macos_qt_formula -curl https://downloads.openmw.org/osx/dependencies/openmw-deps-eaf8112.zip -o ~/openmw-deps.zip +curl https://downloads.openmw.org/osx/dependencies/openmw-deps-5e144e2.zip -o ~/openmw-deps.zip unzip ~/openmw-deps.zip -d /private/tmp/openmw-deps > /dev/null