Cleaned up and changed executeAutoMove()

This commit is contained in:
Star-Demon 2011-01-17 15:48:12 -05:00
parent 90e6029bad
commit 1bc9a46c6b
3 changed files with 35 additions and 43 deletions

View file

@ -280,14 +280,13 @@ namespace MWInput
// Disable movement in Gui mode
if(windows.isGuiMode()) return true;
float speed = 300 * evt.timeSinceLastFrame; //is this a placeholder player speed?
float TESTwalkSpeed = 100 * evt.timeSinceLastFrame; //Try this, then.
//float TESTsneakSpeed = 100 * evt.timeSinceLastFrame; //and this.
float speed = 300 * evt.timeSinceLastFrame; //placeholder player speed?
float TESTwalkSpeed = 100 * evt.timeSinceLastFrame; //How about another?
float moveX = 0, moveY = 0, moveZ = 0;
//execute Automove - condition checked in function
player.executeAutoMove((float)evt.timeSinceLastEvent); //or since last frame?
player.executeAutoMove((float)evt.timeSinceLastFrame); //or since last frame?
//Poll and execute movement keys - will disable automove if pressed.
if(poller.isDown(A_MoveLeft))

View file

@ -63,4 +63,5 @@ namespace MWWorld
delete mClass;
mClass = new_class;
}
}

View file

@ -32,8 +32,6 @@ namespace MWWorld
bool mCollisionMode;
bool mAutoMove;
//bool misSneaking;
//bool misHidden;
bool misWalking; //Testing...
public:
@ -124,22 +122,16 @@ namespace MWWorld
mAutoMove = setMe;
}
//NOTE: we don't have speed being calculated yet, so for now this function only requires a frame duration.
/// <param name="duration">float value representing time since last call</param>
void executeAutoMove(float duration) //call by value for MoveZ makes this harder.
void executeAutoMove(float duration)
{
if (mAutoMove == true)
{
//TODO: Make player go.
/*Access moveZ, access walking/running speed, -1 is for correct direction,
otherwise you end up running backwards - not a bad idea for a future feature, actually...*/
/*
if (this.misWalking == false)
{
//inputmanager.moveZ = 300 * duration * -1;
} else {
//inputmanager.moveZ = 100 * duration * -1;
}
*/
//if player is running
//Make player go at full speed
//player.moveRel(0, 0, (300*duration*-1));
//else go forward at walk speed.
}
}