mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-28 20:09:42 +00:00
Catch exceptions in updateWindowManager (Bug #4269)
This commit is contained in:
parent
047c44f265
commit
d9d8de3061
1 changed files with 17 additions and 10 deletions
|
@ -1757,19 +1757,26 @@ namespace MWWorld
|
||||||
|
|
||||||
void World::updateWindowManager ()
|
void World::updateWindowManager ()
|
||||||
{
|
{
|
||||||
// inform the GUI about focused object
|
try
|
||||||
MWWorld::Ptr object = getFacedObject ();
|
|
||||||
|
|
||||||
// retrieve object dimensions so we know where to place the floating label
|
|
||||||
if (!object.isEmpty ())
|
|
||||||
{
|
{
|
||||||
osg::Vec4f screenBounds = mRendering->getScreenBounds(object);
|
// inform the GUI about focused object
|
||||||
|
MWWorld::Ptr object = getFacedObject ();
|
||||||
|
|
||||||
MWBase::Environment::get().getWindowManager()->setFocusObjectScreenCoords(
|
// retrieve object dimensions so we know where to place the floating label
|
||||||
screenBounds.x(), screenBounds.y(), screenBounds.z(), screenBounds.w());
|
if (!object.isEmpty ())
|
||||||
|
{
|
||||||
|
osg::Vec4f screenBounds = mRendering->getScreenBounds(object);
|
||||||
|
|
||||||
|
MWBase::Environment::get().getWindowManager()->setFocusObjectScreenCoords(
|
||||||
|
screenBounds.x(), screenBounds.y(), screenBounds.z(), screenBounds.w());
|
||||||
|
}
|
||||||
|
|
||||||
|
MWBase::Environment::get().getWindowManager()->setFocusObject(object);
|
||||||
|
}
|
||||||
|
catch (std::exception& e)
|
||||||
|
{
|
||||||
|
std::cerr << "Error updating window manager: " << e.what() << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
MWBase::Environment::get().getWindowManager()->setFocusObject(object);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MWWorld::Ptr World::getFacedObject(float maxDistance, bool ignorePlayer)
|
MWWorld::Ptr World::getFacedObject(float maxDistance, bool ignorePlayer)
|
||||||
|
|
Loading…
Reference in a new issue