forked from teamnwah/openmw-tes3coop
Merge branch 'inputfix' into water
This commit is contained in:
commit
e492a69c8f
3 changed files with 12 additions and 6 deletions
|
@ -124,6 +124,9 @@ bool OMW::Engine::frameRenderingQueued (const Ogre::FrameEvent& evt)
|
||||||
{
|
{
|
||||||
mEnvironment.mFrameDuration = evt.timeSinceLastFrame;
|
mEnvironment.mFrameDuration = evt.timeSinceLastFrame;
|
||||||
|
|
||||||
|
// update input
|
||||||
|
mEnvironment.mInputManager->update();
|
||||||
|
|
||||||
// sound
|
// sound
|
||||||
if (mUseSound)
|
if (mUseSound)
|
||||||
mEnvironment.mSoundManager->update (evt.timeSinceLastFrame);
|
mEnvironment.mSoundManager->update (evt.timeSinceLastFrame);
|
||||||
|
|
|
@ -200,8 +200,6 @@ namespace MWInput
|
||||||
|
|
||||||
// Add the exit listener
|
// Add the exit listener
|
||||||
ogre.getRoot()->addFrameListener(&exit);
|
ogre.getRoot()->addFrameListener(&exit);
|
||||||
// Add ourselves as a frame listener to catch movement keys
|
|
||||||
ogre.getRoot()->addFrameListener(this);
|
|
||||||
|
|
||||||
// Set up the mouse handler and tell it about the player camera
|
// Set up the mouse handler and tell it about the player camera
|
||||||
mouse = MouseLookEventPtr(new MouseLookEvent(player.getRenderer()->getCamera()));
|
mouse = MouseLookEventPtr(new MouseLookEvent(player.getRenderer()->getCamera()));
|
||||||
|
@ -262,7 +260,7 @@ namespace MWInput
|
||||||
}
|
}
|
||||||
|
|
||||||
//NOTE: Used to check for movement keys
|
//NOTE: Used to check for movement keys
|
||||||
bool frameRenderingQueued (const Ogre::FrameEvent &evt)
|
void update ()
|
||||||
{
|
{
|
||||||
// Tell OIS to handle all input events
|
// Tell OIS to handle all input events
|
||||||
input.capture();
|
input.capture();
|
||||||
|
@ -276,7 +274,7 @@ namespace MWInput
|
||||||
windows.update();
|
windows.update();
|
||||||
|
|
||||||
// Disable movement in Gui mode
|
// Disable movement in Gui mode
|
||||||
if (windows.isGuiMode()) return true;
|
if (windows.isGuiMode()) return;
|
||||||
|
|
||||||
// Configure player movement according to keyboard input. Actual movement will
|
// Configure player movement according to keyboard input. Actual movement will
|
||||||
// be done in the physics system.
|
// be done in the physics system.
|
||||||
|
@ -305,8 +303,6 @@ namespace MWInput
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
player.setForwardBackward (0);
|
player.setForwardBackward (0);
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Switch between gui modes. Besides controlling the Gui windows
|
// Switch between gui modes. Besides controlling the Gui windows
|
||||||
|
@ -358,4 +354,9 @@ namespace MWInput
|
||||||
{
|
{
|
||||||
impl->setGuiMode(mode);
|
impl->setGuiMode(mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MWInputManager::update()
|
||||||
|
{
|
||||||
|
impl->update();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,8 @@ namespace MWInput
|
||||||
OMW::Engine& engine);
|
OMW::Engine& engine);
|
||||||
~MWInputManager();
|
~MWInputManager();
|
||||||
|
|
||||||
|
void update();
|
||||||
|
|
||||||
void setGuiMode(MWGui::GuiMode mode);
|
void setGuiMode(MWGui::GuiMode mode);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue