This commit is contained in:
Paul 2001-04-02 21:37:20 +00:00
parent 201b150680
commit f43db72d0a
27 changed files with 243 additions and 19 deletions

View File

@ -86,6 +86,23 @@ void CBalloonPickup::init()
setCollisionSize(fh->W,fh->H);
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
DVECTOR CBalloonPickup::getSizeForPlacement()
{
DVECTOR size;
sFrameHdr *fh;
fh=getSpriteBank()->getFrameHeader(FRM__BALLOON);
size.vx=fh->W;
size.vy=fh->H;
return size;
}
/*----------------------------------------------------------------------
Function:
Purpose:

View File

@ -39,6 +39,7 @@ class CBalloonPickup : public CBaseRespawningPickup
public:
virtual void init();
virtual DVECTOR getSizeForPlacement();
virtual void collect(class CPlayer *_player);
protected:

View File

@ -53,6 +53,23 @@
Vars
---- */
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
DVECTOR CCoralBlowerPickup::getSizeForPlacement()
{
DVECTOR size;
sFrameHdr *fh;
fh=getSpriteBank()->getFrameHeader(FRM__BLOWER);
size.vx=fh->W;
size.vy=fh->H;
return size;
}
/*----------------------------------------------------------------------
Function:
Purpose:

View File

@ -37,6 +37,7 @@
class CCoralBlowerPickup : public CBasePickup
{
public:
virtual DVECTOR getSizeForPlacement();
virtual void collect(class CPlayer *_player);
protected:

View File

@ -69,6 +69,23 @@ void CBubbleMixturePickup::init()
m_sin=0;
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
DVECTOR CBubbleMixturePickup::getSizeForPlacement()
{
DVECTOR size;
sFrameHdr *fh;
fh=getSpriteBank()->getFrameHeader(FRM__BUBBLEMIXTURE);
size.vx=fh->W;
size.vy=fh->H;
return size;
}
/*----------------------------------------------------------------------
Function:
Purpose:
@ -138,6 +155,23 @@ void CBubbleWandPickup::init()
CBaseRespawningPickup::init();
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
DVECTOR CBubbleWandPickup::getSizeForPlacement()
{
DVECTOR size;
sFrameHdr *fh;
fh=getSpriteBank()->getFrameHeader(FRM__BUBBLEWAND);
size.vx=fh->W;
size.vy=fh->H;
return size;
}
/*----------------------------------------------------------------------
Function:
Purpose:

View File

@ -39,6 +39,7 @@ class CBubbleMixturePickup : public CBaseRespawningPickup
public:
virtual void init();
virtual DVECTOR getSizeForPlacement();
virtual void collect(class CPlayer *_player);
protected:
@ -58,6 +59,7 @@ class CBubbleWandPickup : public CBaseRespawningPickup
public:
virtual void init();
virtual DVECTOR getSizeForPlacement();
virtual void collect(class CPlayer *_player);
protected:

View File

@ -67,6 +67,23 @@ void CGlassesPickup::init()
m_glintRot=0;
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
DVECTOR CGlassesPickup::getSizeForPlacement()
{
DVECTOR size;
sFrameHdr *fh;
fh=getSpriteBank()->getFrameHeader(FRM__GLASSES);
size.vx=fh->W;
size.vy=fh->H;
return size;
}
/*----------------------------------------------------------------------
Function:
Purpose:

View File

@ -39,6 +39,7 @@ class CGlassesPickup : public CBasePickup
public:
virtual void init();
virtual DVECTOR getSizeForPlacement();
virtual void collect(class CPlayer *_player);
protected:

View File

@ -69,6 +69,23 @@ void CBaseHealthPickup::init()
m_sin=0;
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
DVECTOR CBaseHealthPickup::getSizeForPlacement()
{
DVECTOR size;
sFrameHdr *fh;
fh=getSpriteBank()->getFrameHeader(getFrameNumber());
size.vx=fh->W;
size.vy=fh->H;
return size;
}
/*----------------------------------------------------------------------
Function:
Purpose:

View File

@ -39,6 +39,7 @@ class CBaseHealthPickup : public CBasePickup
public:
virtual void init();
virtual DVECTOR getSizeForPlacement();
virtual void collect(class CPlayer *_player);
protected:

View File

@ -53,6 +53,23 @@
Vars
---- */
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
DVECTOR CHelmetPickup::getSizeForPlacement()
{
DVECTOR size;
sFrameHdr *fh;
fh=getSpriteBank()->getFrameHeader(FRM__HELMET);
size.vx=fh->W;
size.vy=fh->H;
return size;
}
/*----------------------------------------------------------------------
Function:
Purpose:

View File

@ -37,6 +37,7 @@
class CHelmetPickup : public CBasePickup
{
public:
virtual DVECTOR getSizeForPlacement();
virtual void collect(class CPlayer *_player);
protected:

View File

@ -286,6 +286,7 @@ void CBaseRespawningPickup::collect(class CPlayer *_player)
CBasePickup *createPickup(const PICKUP_TYPE _type,const DVECTOR *_pos)
{
CBasePickup *pickup;
DVECTOR pickupPos;
switch(_type)
{
@ -354,7 +355,10 @@ CBasePickup *createPickup(const PICKUP_TYPE _type,const DVECTOR *_pos)
}
pickup->init();
pickup->setPos(_pos);
pickupPos=pickup->getSizeForPlacement();
pickupPos.vx=_pos->vx+(pickupPos.vx/2);
pickupPos.vy=_pos->vy+(pickupPos.vy/2)-16;
pickup->setPos(&pickupPos);
return pickup;
}

View File

@ -63,6 +63,7 @@ public:
virtual void think(int _frames);
virtual void render();
virtual DVECTOR getSizeForPlacement()=0;
void setPos(const struct DVECTOR *_pos);
virtual void collect(class CPlayer *_player);

View File

@ -65,6 +65,23 @@ void CJellyLauncherAmmoPickup::init()
m_rattle=0;
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
DVECTOR CJellyLauncherAmmoPickup::getSizeForPlacement()
{
DVECTOR size;
sFrameHdr *fh;
fh=getSpriteBank()->getFrameHeader(FRM__JELLYAMMO);
size.vx=fh->W;
size.vy=fh->H;
return size;
}
/*----------------------------------------------------------------------
Function:
Purpose:

View File

@ -39,6 +39,7 @@ class CJellyLauncherAmmoPickup : public CBasePickup
public:
virtual void init();
virtual DVECTOR getSizeForPlacement();
virtual void collect(class CPlayer *_player);
protected:

View File

@ -69,6 +69,23 @@ void CLifePickup::init()
m_sin=0;
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
DVECTOR CLifePickup::getSizeForPlacement()
{
DVECTOR size;
sFrameHdr *fh;
fh=getSpriteBank()->getFrameHeader(FRM__PANTS);
size.vx=fh->W;
size.vy=fh->H;
return size;
}
/*----------------------------------------------------------------------
Function:
Purpose:

View File

@ -39,6 +39,7 @@ class CLifePickup : public CBasePickup
public:
virtual void init();
virtual DVECTOR getSizeForPlacement();
virtual void collect(class CPlayer *_player);
protected:

View File

@ -53,6 +53,23 @@
Vars
---- */
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
DVECTOR CNetPickup::getSizeForPlacement()
{
DVECTOR size;
sFrameHdr *fh;
fh=getSpriteBank()->getFrameHeader(FRM__NET);
size.vx=fh->W;
size.vy=fh->H;
return size;
}
/*----------------------------------------------------------------------
Function:
Purpose:

View File

@ -37,6 +37,7 @@
class CNetPickup : public CBasePickup
{
public:
virtual DVECTOR getSizeForPlacement();
virtual void collect(class CPlayer *_player);
protected:

View File

@ -69,6 +69,23 @@ void CBaseQuestItemPickup::init()
m_pingFrame=0;
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
DVECTOR CBaseQuestItemPickup::getSizeForPlacement()
{
DVECTOR size;
sFrameHdr *fh;
fh=getSpriteBank()->getFrameHeader(getFrameNumber());
size.vx=fh->W;
size.vy=fh->H;
return size;
}
/*----------------------------------------------------------------------
Function:
Purpose:

View File

@ -39,6 +39,7 @@ class CBaseQuestItemPickup : public CBasePickup
public:
virtual void init();
virtual DVECTOR getSizeForPlacement();
virtual void collect(class CPlayer *_player);
protected:

View File

@ -69,6 +69,23 @@ void CShoesPickup::init()
m_sin=0;
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
DVECTOR CShoesPickup::getSizeForPlacement()
{
DVECTOR size;
sFrameHdr *fh;
fh=getSpriteBank()->getFrameHeader(FRM__SHOE);
size.vx=fh->W;
size.vy=fh->H;
return size;
}
/*----------------------------------------------------------------------
Function:
Purpose:

View File

@ -39,6 +39,7 @@ class CShoesPickup : public CBaseRespawningPickup
public:
virtual void init();
virtual DVECTOR getSizeForPlacement();
virtual void collect(class CPlayer *_player);
protected:

View File

@ -62,6 +62,23 @@ void CSpatulaPickup::init()
m_glintRot=0;
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
DVECTOR CSpatulaPickup::getSizeForPlacement()
{
DVECTOR size;
sFrameHdr *fh;
fh=getSpriteBank()->getFrameHeader(FRM__SPATULA);
size.vx=fh->W;
size.vy=fh->H;
return size;
}
/*----------------------------------------------------------------------
Function:
Purpose:

View File

@ -39,6 +39,7 @@ class CSpatulaPickup : public CBasePickup
public:
virtual void init();
virtual DVECTOR getSizeForPlacement();
virtual void collect(class CPlayer *_player);
protected:

View File

@ -173,8 +173,8 @@ int s_health;
int s_screenPos;
DVECTOR m_cameraScrollPos={0,600};
int SCREEN_GEOM_CENTRE_X=256;
int SCREEN_GEOM_CENTRE_Y=107;
int SCREEN_GEOM_CENTRE_X=38;
int SCREEN_GEOM_CENTRE_Y=248;
int SCREEN_GEOM_PLAYER_OFS_X=9;
int SCREEN_GEOM_PLAYER_OFS_Y=-26;
@ -450,24 +450,9 @@ m_fontBank->print(40,40,posBuf);
// Render
if(m_invincibleFrameCount==0||m_invincibleFrameCount&2)
{
//int xval=(255-(MAP2D_BLOCKSTEPSIZE*(-m_cameraScrollPos.vx>>8)));
//DrawLine(xval-7,0,xval-7,255,0,128,255,0);
//DrawLine(xval+7,0,xval+7,255,0,128,255,0);
//!! SetGeomOffset(SCREEN_GEOM_CENTRE_X+m_playerScreenGeomPos.vx,SCREEN_GEOM_CENTRE_Y+m_playerScreenGeomPos.vy);
// if(panim!=-1)
// m_actorGfx.setAnimNo(panim);
// else
// m_actorGfx.setAnimNo(m_animNo);
//!! m_actorGfx.setFrame(m_animFrame);
//!! m_actorGfx.Animate(this);
//!! m_actorGfx.Render(this);
//!! m_currentPlayerModeClass->render();
//!! SetGeomOffset(SCREEN_GEOM_CENTRE_X,SCREEN_GEOM_CENTRE_Y);
DVECTOR Pos=
{
SCREEN_GEOM_CENTRE_X+m_playerScreenGeomPos.vx-m_actorGfx->getFrameWidth(m_animNo,m_animFrame/2),
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);