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 // Disable movement in Gui mode
if(windows.isGuiMode()) return true; if(windows.isGuiMode()) return true;
float speed = 300 * evt.timeSinceLastFrame; //is this a placeholder player speed? float speed = 300 * evt.timeSinceLastFrame; //placeholder player speed?
float TESTwalkSpeed = 100 * evt.timeSinceLastFrame; //Try this, then. float TESTwalkSpeed = 100 * evt.timeSinceLastFrame; //How about another?
//float TESTsneakSpeed = 100 * evt.timeSinceLastFrame; //and this.
float moveX = 0, moveY = 0, moveZ = 0; float moveX = 0, moveY = 0, moveZ = 0;
//execute Automove - condition checked in function //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. //Poll and execute movement keys - will disable automove if pressed.
if(poller.isDown(A_MoveLeft)) if(poller.isDown(A_MoveLeft))

View File

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

View File

@ -32,8 +32,6 @@ namespace MWWorld
bool mCollisionMode; bool mCollisionMode;
bool mAutoMove; bool mAutoMove;
//bool misSneaking;
//bool misHidden;
bool misWalking; //Testing... bool misWalking; //Testing...
public: public:
@ -124,22 +122,16 @@ namespace MWWorld
mAutoMove = setMe; 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> /// <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) if (mAutoMove == true)
{ {
//TODO: Make player go. //if player is running
/*Access moveZ, access walking/running speed, -1 is for correct direction, //Make player go at full speed
otherwise you end up running backwards - not a bad idea for a future feature, actually...*/ //player.moveRel(0, 0, (300*duration*-1));
/* //else go forward at walk speed.
if (this.misWalking == false)
{
//inputmanager.moveZ = 300 * duration * -1;
} else {
//inputmanager.moveZ = 100 * duration * -1;
}
*/
} }
} }