Merge pull request #245 from OpenMW/master

Add OpenMW commits up to 22 Jul 2017
0.6.1
David Cernat 8 years ago committed by GitHub
commit 2c1ece79fc

@ -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

@ -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)

@ -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

@ -1732,6 +1732,8 @@ namespace MWGui
mCompanionWindow->resetReference();
mConsole->resetReference();
mToolTips->setFocusObject(MWWorld::ConstPtr());
mInventoryWindow->clear();
mSelectedSpell.clear();

@ -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<osg::StateSet> 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

@ -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<osg::Viewport> mViewport;
virtual void onSetup();
};

@ -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)

@ -221,10 +221,12 @@ InputWrapper::InputWrapper(SDL_Window* window, osg::ref_ptr<osgViewer::Viewer> 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;

Loading…
Cancel
Save