Fix mouse movement events being discarded when there's more than one event in a frame

actorid
scrawl 12 years ago
parent cc077eaba6
commit 705488ddfb

@ -206,7 +206,6 @@ namespace MWInput
{ {
// Tell OIS to handle all input events // Tell OIS to handle all input events
mInputManager->capture(); mInputManager->capture();
// inject some fake mouse movement to force updating MyGUI's widget states // inject some fake mouse movement to force updating MyGUI's widget states
// this shouldn't do any harm since we're moving back to the original position afterwards // this shouldn't do any harm since we're moving back to the original position afterwards
MyGUI::InputManager::getInstance().injectMouseMove( int(mMouseX+1), int(mMouseY+1), mMouseWheel); MyGUI::InputManager::getInstance().injectMouseMove( int(mMouseX+1), int(mMouseY+1), mMouseWheel);
@ -501,10 +500,6 @@ namespace MWInput
// We keep track of our own mouse position, so that moving the mouse while in // We keep track of our own mouse position, so that moving the mouse while in
// game mode does not move the position of the GUI cursor // game mode does not move the position of the GUI cursor
// Don't support the UI sensitivity slider to reduce headache
// related to when the mouse can leave the window, and what to
// do when it re-enters
mMouseX = arg.x; mMouseX = arg.x;
mMouseY = arg.y; mMouseY = arg.y;
@ -533,8 +528,8 @@ namespace MWInput
// Only actually turn player when we're not in vanity mode // Only actually turn player when we're not in vanity mode
if(!MWBase::Environment::get().getWorld()->vanityRotateCamera(rot)) if(!MWBase::Environment::get().getWorld()->vanityRotateCamera(rot))
{ {
mPlayer.setYaw(x/scale); mPlayer.yaw(x/scale);
mPlayer.setPitch(-y/scale); mPlayer.pitch(-y/scale);
} }
if (arg.zrel) if (arg.zrel)

@ -125,20 +125,20 @@ namespace MWWorld
MWWorld::Class::get (ptr).setStance (ptr, MWWorld::Class::Sneak, sneak); MWWorld::Class::get (ptr).setStance (ptr, MWWorld::Class::Sneak, sneak);
} }
void Player::setYaw(float yaw) void Player::yaw(float yaw)
{ {
MWWorld::Ptr ptr = getPlayer(); MWWorld::Ptr ptr = getPlayer();
MWWorld::Class::get(ptr).getMovementSettings(ptr).mRotation[2] = yaw; MWWorld::Class::get(ptr).getMovementSettings(ptr).mRotation[2] += yaw;
} }
void Player::setPitch(float pitch) void Player::pitch(float pitch)
{ {
MWWorld::Ptr ptr = getPlayer(); MWWorld::Ptr ptr = getPlayer();
MWWorld::Class::get(ptr).getMovementSettings(ptr).mRotation[0] = pitch; MWWorld::Class::get(ptr).getMovementSettings(ptr).mRotation[0] += pitch;
} }
void Player::setRoll(float roll) void Player::roll(float roll)
{ {
MWWorld::Ptr ptr = getPlayer(); MWWorld::Ptr ptr = getPlayer();
MWWorld::Class::get(ptr).getMovementSettings(ptr).mRotation[1] = roll; MWWorld::Class::get(ptr).getMovementSettings(ptr).mRotation[1] += roll;
} }
void Player::use() void Player::use()

@ -64,9 +64,9 @@ namespace MWWorld
void setRunState(bool run); void setRunState(bool run);
void setSneak(bool sneak); void setSneak(bool sneak);
void setYaw(float yaw); void yaw(float yaw);
void setPitch(float pitch); void pitch(float pitch);
void setRoll(float roll); void roll(float roll);
}; };
} }
#endif #endif

Loading…
Cancel
Save