This commit is contained in:
parent
621b73d91c
commit
bd6c86db8b
2 changed files with 39 additions and 5 deletions
|
@ -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;
|
else if(m_leftRightScrollPosition>max)m_leftRightScrollPosition=max;
|
||||||
|
|
||||||
// Camera focus point stuff
|
// Camera focus point stuff
|
||||||
m_currentCamFocusPointTarget.vx=Pos.vx+MAP2D_CENTRE_X+(m_leftRightScrollPosition/scspeed);
|
calcCameraFocusPointTarget();
|
||||||
m_currentCamFocusPointTarget.vy=Pos.vy+MAP2D_CENTRE_Y;
|
|
||||||
for(i=0;i<_frames;i++)
|
for(i=0;i<_frames;i++)
|
||||||
{
|
{
|
||||||
m_currentCamFocusPoint.vx+=(m_currentCamFocusPointTarget.vx-m_currentCamFocusPoint.vx)>>cammove;
|
m_currentCamFocusPoint.vx+=(m_currentCamFocusPointTarget.vx-m_currentCamFocusPoint.vx)>>cammove;
|
||||||
|
@ -1098,6 +1097,24 @@ void CPlayer::springPlayerUp()
|
||||||
m_currentPlayerModeClass->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:
|
Function:
|
||||||
Purpose:
|
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:
|
Function:
|
||||||
|
@ -1188,13 +1217,15 @@ void CPlayer::respawn()
|
||||||
m_invincibleFrameCount=INVINCIBLE_FRAMES__START;
|
m_invincibleFrameCount=INVINCIBLE_FRAMES__START;
|
||||||
Pos=m_respawnPos;
|
Pos=m_respawnPos;
|
||||||
m_cameraLookOffset=0;
|
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_padLookAroundTimer=0;
|
||||||
m_ledgeLookAhead=m_lastLedgeLookAhead=0;
|
m_ledgeLookAhead=m_lastLedgeLookAhead=0;
|
||||||
m_ledgeLookOffset=0;
|
m_ledgeLookOffset=0;
|
||||||
m_ledgeLookTimer=0;
|
m_ledgeLookTimer=0;
|
||||||
m_leftRightScrollPosition=0;
|
|
||||||
|
|
||||||
m_glassesFlag=0;
|
m_glassesFlag=0;
|
||||||
m_squeakyBootsTimer=0;
|
m_squeakyBootsTimer=0;
|
||||||
|
|
|
@ -200,8 +200,11 @@ public:
|
||||||
void setAnimNo(int _animNo);
|
void setAnimNo(int _animNo);
|
||||||
|
|
||||||
void springPlayerUp();
|
void springPlayerUp();
|
||||||
|
void teleportTo(int _x,int _y);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void playAnimFrameSfx(int _animNo,int _animFrame);
|
void playAnimFrameSfx(int _animNo,int _animFrame);
|
||||||
|
void calcCameraFocusPointTarget();
|
||||||
|
|
||||||
DVECTOR m_moveVelocity;
|
DVECTOR m_moveVelocity;
|
||||||
int m_allowConversation;
|
int m_allowConversation;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue