This commit is contained in:
Paul 2001-05-02 18:11:29 +00:00
parent 621b73d91c
commit bd6c86db8b
2 changed files with 39 additions and 5 deletions

View File

@ -750,8 +750,7 @@ else if(Pos.vy>m_mapEdge.vy-64)Pos.vy=m_mapEdge.vy-64;
else if(m_leftRightScrollPosition>max)m_leftRightScrollPosition=max;
// Camera focus point stuff
m_currentCamFocusPointTarget.vx=Pos.vx+MAP2D_CENTRE_X+(m_leftRightScrollPosition/scspeed);
m_currentCamFocusPointTarget.vy=Pos.vy+MAP2D_CENTRE_Y;
calcCameraFocusPointTarget();
for(i=0;i<_frames;i++)
{
m_currentCamFocusPoint.vx+=(m_currentCamFocusPointTarget.vx-m_currentCamFocusPoint.vx)>>cammove;
@ -1098,6 +1097,24 @@ void CPlayer::springPlayerUp()
m_currentPlayerModeClass->springPlayerUp();
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayer::teleportTo(int _x,int _y)
{
DVECTOR pos={_x,_y};
setPos(pos);
setRespawnPos(pos);
m_leftRightScrollPosition=0;
calcCameraFocusPointTarget();
m_currentCamFocusPoint=m_currentCamFocusPointTarget;
}
/*----------------------------------------------------------------------
Function:
Purpose:
@ -1162,6 +1179,18 @@ void CPlayer::playAnimFrameSfx(int _animNo,int _animFrame)
}
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayer::calcCameraFocusPointTarget()
{
m_currentCamFocusPointTarget.vx=Pos.vx+MAP2D_CENTRE_X+(m_leftRightScrollPosition/scspeed);
m_currentCamFocusPointTarget.vy=Pos.vy+MAP2D_CENTRE_Y;
}
/*----------------------------------------------------------------------
Function:
@ -1188,13 +1217,15 @@ void CPlayer::respawn()
m_invincibleFrameCount=INVINCIBLE_FRAMES__START;
Pos=m_respawnPos;
m_cameraLookOffset=0;
m_currentCamFocusPoint.vx=Pos.vx+MAP2D_CENTRE_X;
m_currentCamFocusPoint.vy=Pos.vy+MAP2D_CENTRE_Y;
m_leftRightScrollPosition=0;
calcCameraFocusPointTarget();
m_currentCamFocusPoint=m_currentCamFocusPointTarget;
m_padLookAroundTimer=0;
m_ledgeLookAhead=m_lastLedgeLookAhead=0;
m_ledgeLookOffset=0;
m_ledgeLookTimer=0;
m_leftRightScrollPosition=0;
m_glassesFlag=0;
m_squeakyBootsTimer=0;

View File

@ -200,8 +200,11 @@ public:
void setAnimNo(int _animNo);
void springPlayerUp();
void teleportTo(int _x,int _y);
private:
void playAnimFrameSfx(int _animNo,int _animFrame);
void calcCameraFocusPointTarget();
DVECTOR m_moveVelocity;
int m_allowConversation;