This commit is contained in:
Paul 2001-04-05 16:26:17 +00:00
parent 0f094cd65a
commit a89174506f
7 changed files with 52 additions and 61 deletions

View File

@ -417,13 +417,13 @@ m_fontBank->print(40,40,posBuf);
// Render
if(m_invincibleFrameCount==0||m_invincibleFrameCount&2)
{
DVECTOR Pos=
DVECTOR sbPos=
{
SCREEN_GEOM_CENTRE_X+m_playerScreenGeomPos.vx,
SCREEN_GEOM_CENTRE_Y+m_playerScreenGeomPos.vy
};
m_actorGfx->Render(Pos,m_animNo,m_animFrame>>sbanimspeed,m_facing==FACING_RIGHT?0:1);
m_currentPlayerModeClass->render();
renderSb(&sbPos,m_animNo,m_animFrame>>sbanimspeed);
m_currentPlayerModeClass->render(&sbPos);
}
@ -680,6 +680,19 @@ void CPlayer::respawn()
clearPlatform();
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayer::renderSb(DVECTOR *_pos,int _animNo,int _animFrame)
{
m_actorGfx->Render(*_pos,_animNo,_animFrame,m_facing==FACING_RIGHT?0:1);
}
/*----------------------------------------------------------------------
Function:
Purpose:

View File

@ -180,6 +180,7 @@ public:
int m_frame;
CSoundMediator::SFXID m_sfxId;
} AnimFrameSfx;
void renderSb(DVECTOR *_pos,int _animNo,int _animFrame);
private:
typedef struct
{

View File

@ -67,31 +67,6 @@ static PlayerMetrics s_playerMetrics=
} };
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerModeBalloon::initialise(class CPlayer *_player)
{
CPlayerModeBase::initialise(_player);
m_sprites=new ("BalloonSprite") SpriteBank();
m_sprites->load(INGAMEFX_INGAMEFX_SPR);
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerModeBalloon::shutdown()
{
m_sprites->dump(); delete m_sprites;
CPlayerModeBase::shutdown();
}
/*----------------------------------------------------------------------
Function:
Purpose:
@ -102,7 +77,6 @@ void CPlayerModeBalloon::enter()
{
CPlayerModeBase::enter();
CSoundMediator::playSfx(CSoundMediator::SFX_BALLOON_INFLATE);
m_balloonTimer=BALLOON_TIME;
}
/*----------------------------------------------------------------------
@ -114,12 +88,6 @@ void CPlayerModeBalloon::enter()
void CPlayerModeBalloon::think()
{
CPlayerModeBase::think();
if(--m_balloonTimer==0||getPadInputDown()&PI_ACTION)
{
PAUL_DBGMSG("*pop*");
CSoundMediator::playSfx(CSoundMediator::SFX_BALLOON_POP);
m_player->setMode(PLAYER_MODE_FULLUNARMED);
}
}
/*----------------------------------------------------------------------
@ -129,21 +97,17 @@ void CPlayerModeBalloon::think()
Returns:
---------------------------------------------------------------------- */
int balloonx=-14;
int balloony=-90;
void CPlayerModeBalloon::render()
int balloony=-120;
int balloonsize=350;
void CPlayerModeBalloon::render(DVECTOR *_pos)
{
DVECTOR ofs,pos;
DVECTOR pos;
CPlayerModeBase::render();
if(m_balloonTimer>BALLOON_FLASH_TIME||
m_balloonTimer&2)
{
ofs=CLevel::getCameraPos();
pos=m_player->getPlayerPos();
pos.vx+=balloonx-ofs.vx;
pos.vy+=balloony-ofs.vy;
m_sprites->printFT4(FRM__BALLOON,pos.vx,pos.vy,0,0,0);
}
pos.vx=_pos->vx+balloonx;
pos.vy=_pos->vy+balloony;
m_player->getSpriteBank()->printFT4Scaled(FRM__BALLOON,pos.vx,pos.vy,0,0,5,balloonsize);
}
/*----------------------------------------------------------------------

View File

@ -37,24 +37,12 @@
class CPlayerModeBalloon : public CPlayerModeBase
{
public:
virtual void initialise(class CPlayer *_player);
virtual void shutdown();
virtual void enter();
virtual void think();
virtual void render();
virtual void render(DVECTOR *_pos);
virtual int canFallForever() {return true;}
virtual const struct PlayerMetrics *getPlayerMetrics();
private:
enum
{
BALLOON_TIME=10*60,
BALLOON_FLASH_TIME=2*60,
};
int m_balloonTimer;
class SpriteBank *m_sprites;
};

View File

@ -24,6 +24,11 @@
/* Data
---- */
#ifndef __ANIM_SPONGEBOB_HEADER__
#include <ACTOR_SPONGEBOB_ANIM.h>
#endif
/*----------------------------------------------------------------------
Tyepdefs && Defines
------------------- */
@ -67,5 +72,24 @@ void CPlayerModeDead::think()
}
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
/*
void CPlayerModeDead::render(DVECTOR *_pos)
{
DVECTOR deadSbPos;
deadSbPos=*_pos;
deadSbPos.vy-=m_deadTime;
m_player->renderSb(&deadSbPos,ANIM_SPONGEBOB_DEATHANGLE,0);
}
*/
/*===========================================================================
end */

View File

@ -39,6 +39,7 @@ class CPlayerModeDead : public CPlayerMode
public:
virtual void enter();
virtual void think();
// virtual void render(DVECTOR *_pos);
private:
// Player can press ACTION to respawn after death

View File

@ -80,7 +80,7 @@ public:
virtual void shutdown() {;}
virtual void enter() {;}
virtual void think() {;}
virtual void render() {;}
virtual void render(DVECTOR *_pos) {;}
virtual void renderModeUi() {;} // Ui specific to this mode (eg: ammo)
int getPadInputHeld();