forked from mirror/openmw-tes3mp
Issue #19: Some more framelistener cleanup
This commit is contained in:
parent
8bebae17aa
commit
fbcb5fe681
1 changed files with 12 additions and 15 deletions
|
@ -77,6 +77,8 @@ bool OMW::Engine::frameRenderingQueued (const Ogre::FrameEvent& evt)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
mEnvironment.mFrameDuration = evt.timeSinceLastFrame;
|
||||||
|
|
||||||
if(mShowFPS)
|
if(mShowFPS)
|
||||||
{
|
{
|
||||||
mEnvironment.mWindowManager->wmSetFPS(mOgre.getFPS());
|
mEnvironment.mWindowManager->wmSetFPS(mOgre.getFPS());
|
||||||
|
@ -138,19 +140,15 @@ bool OMW::Engine::frameRenderingQueued (const Ogre::FrameEvent& evt)
|
||||||
pos += chance;
|
pos += chance;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//mEnvironment.mSoundManager->playSound(effect, 1.0, 1.0);
|
|
||||||
//printf("REGION: %s\n", test.name);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(current->cell->data.flags & current->cell->Interior)
|
else if(current->cell->data.flags & current->cell->Interior)
|
||||||
{
|
{
|
||||||
test.name = "";
|
test.name = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
mEnvironment.mFrameDuration = evt.timeSinceLastFrame;
|
|
||||||
|
|
||||||
//
|
|
||||||
|
// update GUI
|
||||||
mEnvironment.mWindowManager->onFrame(mEnvironment.mFrameDuration);
|
mEnvironment.mWindowManager->onFrame(mEnvironment.mFrameDuration);
|
||||||
|
|
||||||
// global scripts
|
// global scripts
|
||||||
|
@ -175,28 +173,27 @@ bool OMW::Engine::frameRenderingQueued (const Ogre::FrameEvent& evt)
|
||||||
std::vector<std::pair<std::string, Ogre::Vector3> > movement;
|
std::vector<std::pair<std::string, Ogre::Vector3> > movement;
|
||||||
mEnvironment.mMechanicsManager->update (movement);
|
mEnvironment.mMechanicsManager->update (movement);
|
||||||
|
|
||||||
|
if (mEnvironment.mWindowManager->getMode()==MWGui::GM_Game)
|
||||||
|
mEnvironment.mWorld->doPhysics (movement, mEnvironment.mFrameDuration);
|
||||||
|
|
||||||
if (focusFrameCounter++ == focusUpdateFrame)
|
if (focusFrameCounter++ == focusUpdateFrame)
|
||||||
{
|
{
|
||||||
std::string handle = mEnvironment.mWorld->getFacedHandle();
|
std::string handle = mEnvironment.mWorld->getFacedHandle();
|
||||||
|
|
||||||
std::string name;
|
|
||||||
|
|
||||||
if (!handle.empty())
|
if (!handle.empty())
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = mEnvironment.mWorld->getPtrViaHandle (handle);
|
MWWorld::Ptr ptr = mEnvironment.mWorld->getPtrViaHandle (handle);
|
||||||
|
|
||||||
if (!ptr.isEmpty())
|
if (!ptr.isEmpty())
|
||||||
name = MWWorld::Class::get (ptr).getName (ptr);
|
{
|
||||||
|
std::string name = MWWorld::Class::get (ptr).getName (ptr);
|
||||||
|
if (!name.empty())
|
||||||
|
std::cout << "Object: " << name << std::endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!name.empty())
|
|
||||||
std::cout << "Object: " << name << std::endl;
|
|
||||||
|
|
||||||
focusFrameCounter = 0;
|
focusFrameCounter = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mEnvironment.mWindowManager->getMode()==MWGui::GM_Game)
|
|
||||||
mEnvironment.mWorld->doPhysics (movement, mEnvironment.mFrameDuration);
|
|
||||||
}
|
}
|
||||||
catch (const std::exception& e)
|
catch (const std::exception& e)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue