This commit is contained in:
Charles 2001-06-08 15:02:29 +00:00
parent fe09f84333
commit 6742515647
4 changed files with 27 additions and 12 deletions

View File

@ -56,7 +56,7 @@ void CNpcSteerableBarrelPlatform::processMovement( int _frames )
{
DVECTOR playerPos = player->getPos();
DVECTOR *playerVel = player->getMoveVelocity();
s32 playerMovement = player->getMovement();
/*s32 speedChange = -playerVel->vx << 8;
@ -80,7 +80,7 @@ void CNpcSteerableBarrelPlatform::processMovement( int _frames )
m_currentSpeed = -( m_speed << 8 );
}*/
m_currentSpeed = -playerVel->vx << 4;
m_currentSpeed = -playerMovement;
/*s32 playerX = playerPos.vx - this->Pos.vx;
@ -130,17 +130,17 @@ void CNpcSteerableBarrelPlatform::processMovement( int _frames )
moveX = m_moveXHighRes >> 8;
m_moveXHighRes -= moveX << 8;*/
moveX = ( m_currentSpeed * _frames ) >> 8;
moveX = m_currentSpeed;
// check for collision
if ( CGameScene::getCollision()->getHeightFromGround( Pos.vx + moveX, Pos.vy + 14 ) < -maxHeight )
if ( CGameScene::getCollision()->getHeightFromGround( Pos.vx + moveX, Pos.vy ) < -maxHeight )
{
moveX = 0;
m_currentSpeed = 0;
}
m_rotation += ( m_currentSpeed * 30 * _frames ) >> 10;
m_rotation += ( m_currentSpeed * 30 * _frames ) >> 2;
m_rotation &= 4095;
if ( m_contact )
@ -153,7 +153,7 @@ void CNpcSteerableBarrelPlatform::processMovement( int _frames )
// check for vertical movement
groundHeight = CGameScene::getCollision()->getHeightFromGround( Pos.vx + moveX, Pos.vy + 14, yMovement + 16 );
groundHeight = CGameScene::getCollision()->getHeightFromGround( Pos.vx + moveX, Pos.vy, yMovement + 16 );
if ( groundHeight <= yMovement )
{

View File

@ -46,7 +46,7 @@ void CNpcSteerableOildrumPlatform::processMovement( int _frames )
{
DVECTOR playerPos = player->getPos();
DVECTOR *playerVel = player->getMoveVelocity();
s32 playerMovement = player->getMovement();
/*s32 speedChange = -playerVel->vx << 8;
@ -70,7 +70,8 @@ void CNpcSteerableOildrumPlatform::processMovement( int _frames )
m_currentSpeed = -( m_speed << 8 );
}*/
m_currentSpeed = -playerVel->vx << 4;
//m_currentSpeed = -playerVel->vx << 4;
m_currentSpeed = -playerMovement;
/*s32 playerX = playerPos.vx - this->Pos.vx;
@ -120,17 +121,17 @@ void CNpcSteerableOildrumPlatform::processMovement( int _frames )
moveX = m_moveXHighRes >> 8;
m_moveXHighRes -= moveX << 8;*/
moveX = ( m_currentSpeed * _frames ) >> 8;
moveX = m_currentSpeed;
// check for collision
if ( CGameScene::getCollision()->getHeightFromGround( Pos.vx + moveX, Pos.vy + 20 ) < -maxHeight )
if ( CGameScene::getCollision()->getHeightFromGround( Pos.vx + moveX, Pos.vy ) < -maxHeight )
{
moveX = 0;
m_currentSpeed = 0;
}
m_rotation += ( m_currentSpeed * 30 * _frames ) >> 10;
m_rotation += ( m_currentSpeed * 30 * _frames ) >> 2;
m_rotation &= 4095;
if ( m_contact )
@ -143,7 +144,7 @@ void CNpcSteerableOildrumPlatform::processMovement( int _frames )
// check for vertical movement
groundHeight = CGameScene::getCollision()->getHeightFromGround( Pos.vx + moveX, Pos.vy + 20, yMovement + 16 );
groundHeight = CGameScene::getCollision()->getHeightFromGround( Pos.vx + moveX, Pos.vy, yMovement + 16 );
if ( groundHeight <= yMovement )
{

View File

@ -741,6 +741,9 @@ if(newmode!=-1)
m_tryingToManuallyPickupWeapon=false;
m_tryingToAutomaticallyPickupWeapon=false;
m_xMove = Pos.vx;
for(i=0;i<_frames;i++)
{
updatePadInput();
@ -1022,6 +1025,8 @@ if(newmode!=-1)
playAnimFrameSfx(m_animNo,m_animFrame);
}
m_xMove = Pos.vx - m_xMove;
// Out of water and wearing helmet..?
ASSERT(!(getIsInWater()==false&&isWearingDivingHelmet()==false));
if(isWearingDivingHelmet()&&getIsInWater()==false&&

View File

@ -455,6 +455,15 @@ public:
private:
class FontBank *m_fontBank;
public:
// Movement tracking for barrels
s32 getMovement() {return( m_xMove );}
private:
s32 m_xMove;
};