Cleaned up inputmanager, tightened up player.exectueAutoMove()

This commit is contained in:
Star-Demon 2011-01-17 16:36:44 -05:00
parent 1bc9a46c6b
commit 962b8c9781
2 changed files with 15 additions and 35 deletions

View file

@ -281,7 +281,7 @@ namespace MWInput
if(windows.isGuiMode()) return true; if(windows.isGuiMode()) return true;
float speed = 300 * evt.timeSinceLastFrame; //placeholder player speed? float speed = 300 * evt.timeSinceLastFrame; //placeholder player speed?
float TESTwalkSpeed = 100 * evt.timeSinceLastFrame; //How about another? //float TESTwalkSpeed = 100 * evt.timeSinceLastFrame; //How about another?
float moveX = 0, moveY = 0, moveZ = 0; float moveX = 0, moveY = 0, moveZ = 0;
@ -290,51 +290,28 @@ namespace MWInput
//Poll and execute movement keys - will disable automove if pressed. //Poll and execute movement keys - will disable automove if pressed.
if(poller.isDown(A_MoveLeft)) if(poller.isDown(A_MoveLeft))
{
if (player.getmisWalking() == false)
{ {
player.setmAutoMove(false); player.setmAutoMove(false);
moveX -= speed; moveX -= speed;
} else {
player.setmAutoMove(false);
moveX -= TESTwalkSpeed;
}
} }
if(poller.isDown(A_MoveRight)) if(poller.isDown(A_MoveRight))
{
if (player.getmisWalking() == false)
{ {
player.setmAutoMove(false); player.setmAutoMove(false);
moveX += speed; moveX += speed;
} else {
player.setmAutoMove(false);
moveX += TESTwalkSpeed;
}
} }
if(poller.isDown(A_MoveForward)) if(poller.isDown(A_MoveForward))
{
if (player.getmisWalking() == false)
{ {
player.setmAutoMove(false); player.setmAutoMove(false);
moveZ -= speed; moveZ -= speed;
} else {
player.setmAutoMove(false);
moveZ -= TESTwalkSpeed;
}
} }
if(poller.isDown(A_MoveBackward)) if(poller.isDown(A_MoveBackward))
{
if (player.getmisWalking() == false)
{ {
player.setmAutoMove(false); player.setmAutoMove(false);
moveZ += speed; moveZ += speed;
} else {
player.setmAutoMove(false);
moveZ += TESTwalkSpeed;
}
} }

View file

@ -126,11 +126,14 @@ namespace MWWorld
/// <param name="duration">float value representing time since last call</param> /// <param name="duration">float value representing time since last call</param>
void executeAutoMove(float duration) void executeAutoMove(float duration)
{ {
float X_Val = 0.0f;
float Y_Val = 0.0f;
float Z_Val = 300.0f * duration * -1.0f;
if (mAutoMove == true) if (mAutoMove == true)
{ {
//if player is running //if player is running
//Make player go at full speed //Make player go at full speed
//player.moveRel(0, 0, (300*duration*-1)); moveRel(X_Val, Y_Val, Z_Val);
//else go forward at walk speed. //else go forward at walk speed.
} }
} }