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 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/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp index 8d9cf3b2f..a17a7b205 100644 --- a/apps/openmw/mwgui/windowmanagerimp.cpp +++ b/apps/openmw/mwgui/windowmanagerimp.cpp @@ -1732,6 +1732,8 @@ namespace MWGui mCompanionWindow->resetReference(); mConsole->resetReference(); + mToolTips->setFocusObject(MWWorld::ConstPtr()); + mInventoryWindow->clear(); mSelectedSpell.clear(); diff --git a/apps/openmw/mwrender/characterpreview.cpp b/apps/openmw/mwrender/characterpreview.cpp index 877c35bba..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); @@ -256,7 +257,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 +336,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(); }; diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 452bfab0f..3ea887aa2 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -1843,8 +1843,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 ()) { @@ -1853,6 +1851,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) 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;