This commit is contained in:
parent
1da64afa81
commit
c7fe8c740b
70 changed files with 302 additions and 445 deletions
|
@ -1526,7 +1526,7 @@ if(drawlastpos)
|
|||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
void CPlayer::setRespawnPosAndRingTelephone(DVECTOR _respawn)
|
||||
void CPlayer::setRespawnPosAndRingTelephone(DVECTOR const &_respawn)
|
||||
{
|
||||
if(m_respawnPos.vx!=_respawn.vx||
|
||||
m_respawnPos.vy!=_respawn.vy)
|
||||
|
@ -2395,7 +2395,7 @@ void CPlayer::justButtBouncedABadGuy()
|
|||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
void CPlayer::shove( DVECTOR move )
|
||||
void CPlayer::shove( DVECTOR const &move )
|
||||
{
|
||||
int colHeight;
|
||||
|
||||
|
@ -3026,10 +3026,10 @@ void CPlayer::setPlayerCollisionSize(int _x,int _y,int _w,int _h)
|
|||
}
|
||||
void CPlayer::getPlayerCollisionSize(int *_x,int *_y,int *_w,int *_h)
|
||||
{
|
||||
DVECTOR offset,size;
|
||||
// DVECTOR offset,size;
|
||||
|
||||
offset=getCollisionCentreOffset();
|
||||
size=getCollisionSize();
|
||||
DVECTOR const &offset=getCollisionCentreOffset();
|
||||
DVECTOR const &size=getCollisionSize();
|
||||
|
||||
*_x=offset.vx;
|
||||
*_y=offset.vy;
|
||||
|
|
|
@ -226,7 +226,7 @@ public:
|
|||
void detectHazardousSurface();
|
||||
virtual void render();
|
||||
virtual int dontKillDuringLevelRespawn() {return true;}
|
||||
virtual void shove(DVECTOR move);
|
||||
virtual void shove(DVECTOR const &move);
|
||||
void moveLeft(); // This is only for camera scroll right now
|
||||
void moveRight(); // " " " " "
|
||||
void fall(); // " " " " "
|
||||
|
@ -236,12 +236,12 @@ public:
|
|||
|
||||
int isTryingToConversateWithFriend() {return m_allowConversation;}
|
||||
|
||||
DVECTOR getCameraPos() {return m_cameraPos;}
|
||||
DVECTOR const &getCameraPos() {return m_cameraPos;}
|
||||
void setCartCam(int _flag) {m_cartCamActive=_flag;}
|
||||
void setReverseCameraMovement(int _flag) {m_reverseCameraMovement=_flag;}
|
||||
void setCameraBox(CameraBox _cameraBox);
|
||||
void setRespawnPos(DVECTOR _respawn) {m_respawnPos=_respawn;}
|
||||
void setRespawnPosAndRingTelephone(DVECTOR _respawn);
|
||||
void setRespawnPos(DVECTOR const &_respawn) {m_respawnPos=_respawn;}
|
||||
void setRespawnPosAndRingTelephone(DVECTOR const &_respawn);
|
||||
|
||||
// This isn't funny anymore.. :(
|
||||
int getHeightFromGround(int _x,int _y,int _maxHeight=32);
|
||||
|
@ -285,7 +285,7 @@ private:
|
|||
|
||||
|
||||
public:
|
||||
DVECTOR getPlayerPos() {return Pos;}
|
||||
DVECTOR const &getPlayerPos() {return Pos;}
|
||||
void setPlayerPos(DVECTOR *_pos) {Pos=*_pos;}
|
||||
void ignoreNewlyPressedButtonsOnPadThisThink();
|
||||
PLAYERINPUT getPadInputHeld() {return m_padInput;}
|
||||
|
|
|
@ -80,8 +80,9 @@ void CPlayerModeCart::think()
|
|||
|
||||
if ( platform )
|
||||
{
|
||||
newPos.vx = platform->getPos().vx;
|
||||
newPos.vy = platform->getPos().vy;
|
||||
newPos=platform->getPos();
|
||||
// newPos.vx = platform->getPos().vx;
|
||||
// newPos.vy = platform->getPos().vy;
|
||||
|
||||
int platformOffset = ( ( CNpcPlatform* ) platform )->getHeightFromPlatformAtPosition( newPos.vx, newPos.vy );
|
||||
s16 angle = ( ( CNpcPlatform * ) platform )->getCollisionAngle();
|
||||
|
|
|
@ -212,12 +212,12 @@ void CPlayerModeCoralBlower::think()
|
|||
else if(m_enemy==NULL)
|
||||
{
|
||||
// Search for an enemy..
|
||||
DVECTOR playerPos;
|
||||
// DVECTOR playerPos;
|
||||
int playerFacing;
|
||||
CRECT suckRect;
|
||||
CThing *thing;
|
||||
|
||||
playerPos=m_player->getPos();
|
||||
DVECTOR const &playerPos=m_player->getPos();
|
||||
playerFacing=m_player->getFacing();
|
||||
|
||||
suckRect.x1=playerPos.vx+(blowerCatchPos.vx*playerFacing)-(blowerCatchSize.vx/2);
|
||||
|
@ -228,7 +228,7 @@ void CPlayerModeCoralBlower::think()
|
|||
#ifdef __USER_paul__
|
||||
{
|
||||
CRECT area=suckRect;
|
||||
DVECTOR ofs=CLevel::getCameraPos();
|
||||
DVECTOR const &ofs=CLevel::getCameraPos();
|
||||
area.x1-=ofs.vx;
|
||||
area.y1-=ofs.vy;
|
||||
area.x2-=ofs.vx;
|
||||
|
@ -352,11 +352,11 @@ void CPlayerModeCoralBlower::renderModeUi()
|
|||
{
|
||||
// Draw aiming cursor
|
||||
int facing,heading;
|
||||
DVECTOR screenOfs,launchPos,targetPos;
|
||||
DVECTOR launchPos,targetPos;
|
||||
|
||||
facing=m_player->getFacing();
|
||||
heading=((m_launchHeading+1024)*facing)&4095;
|
||||
screenOfs=CLevel::getCameraPos();
|
||||
DVECTOR const &screenOfs=CLevel::getCameraPos();
|
||||
launchPos=m_player->getPlayerPos();
|
||||
launchPos.vx+=(blowerLaunchPoint.vx*facing)-screenOfs.vx;
|
||||
launchPos.vy+=blowerLaunchPoint.vy-screenOfs.vy;
|
||||
|
|
|
@ -231,15 +231,15 @@ void CPlayerModeNet::think()
|
|||
|
||||
case NET_STATE__CATCHING:
|
||||
{
|
||||
DVECTOR catchPos;
|
||||
DVECTOR playerPos;
|
||||
// DVECTOR catchPos;
|
||||
// DVECTOR playerPos;
|
||||
int playerFacing;
|
||||
CRECT netRect;
|
||||
CThing *thing;
|
||||
|
||||
ASSERT(m_netFrame<(int)(sizeof(netCatchPos)/sizeof(DVECTOR)));
|
||||
catchPos=netCatchPos[m_netFrame];
|
||||
playerPos=m_player->getPos();
|
||||
DVECTOR const &catchPos=netCatchPos[m_netFrame];
|
||||
DVECTOR const &playerPos=m_player->getPos();
|
||||
playerFacing=m_player->getFacing();
|
||||
|
||||
netRect.x1=playerPos.vx+(catchPos.vx*playerFacing)-(netCatchSize.vx/2);
|
||||
|
|
|
@ -199,7 +199,7 @@ int CPlayerMode::getPadInputDown() {return m_player->getPadInputDown();}
|
|||
---------------------------------------------------------------------- */
|
||||
int CPlayerMode::getHeightFromGound()
|
||||
{
|
||||
DVECTOR pos=getPlayerPos();
|
||||
DVECTOR const &pos=getPlayerPos();
|
||||
return m_player->getHeightFromGround(pos.vx,pos.vy);
|
||||
}
|
||||
|
||||
|
@ -219,7 +219,7 @@ void CPlayerMode::inSoakUpState() {m_player->inSoakUpState();}
|
|||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
DVECTOR CPlayerMode::getPlayerPos() {return m_player->getPlayerPos();}
|
||||
DVECTOR const &CPlayerMode::getPlayerPos() {return m_player->getPlayerPos();}
|
||||
void CPlayerMode::setPlayerPos(DVECTOR *_pos) {m_player->setPlayerPos(_pos);}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
|
@ -350,11 +350,9 @@ void CPlayerModeBase::thinkVerticalMovement()
|
|||
{
|
||||
if(m_player->moveVertical(m_player->getMoveVelocity()->vy>>VELOCITY_SHIFT))
|
||||
{
|
||||
DVECTOR pos;
|
||||
|
||||
if(m_currentState!=STATE_CELEBRATE)
|
||||
playerHasHitGround();
|
||||
pos=m_player->getPlayerPos();
|
||||
DVECTOR const &pos=m_player->getPlayerPos();
|
||||
if(m_player->getHeightFromGround(pos.vx,pos.vy,5)==0&&
|
||||
(CGameScene::getCollision()->getCollisionBlock(pos.vx,pos.vy)&COLLISION_TYPE_MASK)==COLLISION_TYPE_FLAG_SOAKUP)
|
||||
{
|
||||
|
@ -378,8 +376,8 @@ void CPlayerModeBase::thinkVerticalMovement()
|
|||
m_currentState!=STATE_JUMPBACK&&m_currentState!=STATE_BUTTBOUNCEUP&&
|
||||
m_currentState!=STATE_FLOAT&&m_currentState!=STATE_CELEBRATE)
|
||||
{
|
||||
DVECTOR pos;
|
||||
pos=m_player->getPlayerPos();
|
||||
DVECTOR const &pos=m_player->getPlayerPos();
|
||||
|
||||
if(m_player->getHeightFromGround(pos.vx,pos.vy,1)!=0
|
||||
#ifdef SHITE_COLLISION
|
||||
&&
|
||||
|
@ -565,10 +563,9 @@ int cheight=15;
|
|||
int CPlayerModeBase::isOnEdge()
|
||||
{
|
||||
CLayerCollision *collision=CGameScene::getCollision();
|
||||
DVECTOR pos;
|
||||
int ret;
|
||||
|
||||
pos=m_player->getPlayerPos();
|
||||
DVECTOR const &pos=m_player->getPlayerPos();
|
||||
ret=0;
|
||||
if(m_player->getHeightFromGround(pos.vx-csize,pos.vy,cheight+1)>cheight)
|
||||
{
|
||||
|
@ -589,8 +586,7 @@ int CPlayerModeBase::isOnEdge()
|
|||
---------------------------------------------------------------------- */
|
||||
int CPlayerModeBase::canMoveLeft()
|
||||
{
|
||||
DVECTOR pos;
|
||||
pos=m_player->getPlayerPos();
|
||||
DVECTOR const &pos=m_player->getPlayerPos();
|
||||
#ifdef SHITE_COLLISION
|
||||
return m_player->getHeightFromGround(pos.vx-checkx,pos.vy,checkdist)>-checkycanmove?true:false;
|
||||
#else
|
||||
|
@ -601,8 +597,7 @@ int CPlayerModeBase::canMoveLeft()
|
|||
|
||||
int CPlayerModeBase::canMoveRight()
|
||||
{
|
||||
DVECTOR pos;
|
||||
pos=m_player->getPlayerPos();
|
||||
DVECTOR const &pos=m_player->getPlayerPos();
|
||||
#ifdef SHITE_COLLISION
|
||||
return m_player->getHeightFromGround(pos.vx+checkx,pos.vy,checkdist)>-checkycanmove?true:false;
|
||||
#else
|
||||
|
|
|
@ -109,7 +109,7 @@ public:
|
|||
|
||||
|
||||
public:
|
||||
DVECTOR getPlayerPos(); // Public so that the states can get the position for bubicle spawners
|
||||
DVECTOR const &getPlayerPos(); // Public so that the states can get the position for bubicle spawners
|
||||
protected:
|
||||
void setPlayerPos(DVECTOR *_pos); // Private so that they cannot directly alter it
|
||||
|
||||
|
|
|
@ -174,9 +174,8 @@ void CPlayerStateButtBounceLand::enter(CPlayerModeBase *_playerMode)
|
|||
m_bounceOffFloor=false;
|
||||
if(_playerMode->getIsInWater())
|
||||
{
|
||||
DVECTOR pos;
|
||||
DVECTOR const &pos=_playerMode->getPlayerPos();
|
||||
|
||||
pos=_playerMode->getPlayerPos();
|
||||
if((CGameScene::getCollision()->getCollisionBlock(pos.vx,pos.vy)&COLLISION_TYPE_MASK)==COLLISION_TYPE_FLAG_DESTRUCTABLE_WALL)
|
||||
{
|
||||
CLevel &level=GameScene.GetLevel();
|
||||
|
@ -223,8 +222,7 @@ void CPlayerStateButtBounceUp::enter(CPlayerModeBase *_playerMode)
|
|||
{
|
||||
if(_playerMode->getIsInWater())
|
||||
{
|
||||
DVECTOR pos;
|
||||
pos=_playerMode->getPlayerPos();
|
||||
DVECTOR const &pos=_playerMode->getPlayerPos();
|
||||
CGameBubicleFactory::spawnBubicles(pos.vx-20,pos.vy,40,10,CGameBubicleFactory::TYPE_MEDIUM);
|
||||
CPadVibrationManager::setVibration(0,CPadVibrationManager::VIBE_MEDIUM);
|
||||
CGameScene::setCameraShake(0,8);
|
||||
|
|
|
@ -90,8 +90,7 @@ void CPlayerStateSoakUp::think(CPlayerModeBase *_playerMode)
|
|||
{
|
||||
if(m_breatheDelayFrames==0)
|
||||
{
|
||||
DVECTOR pos;
|
||||
pos=_playerMode->getPlayerPos();
|
||||
DVECTOR const & pos=_playerMode->getPlayerPos();
|
||||
CGameBubicleFactory::spawnBubicles(pos.vx+BUBBLE_XOFF,pos.vy+BUBBLE_YOFF,BUBBLE_W,BUBBLE_H,CGameBubicleFactory::TYPE_SPONGEBOBSOAKUP);
|
||||
m_breatheDelayFrames=0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue