This commit is contained in:
parent
9386d1e96c
commit
68bf62003e
15 changed files with 259 additions and 46 deletions
|
@ -108,7 +108,7 @@ void CBubbleMixturePickup::render()
|
|||
fh=sprites->getFrameHeader(FRM__BUBBLEMIXTURE);
|
||||
x=Pos.vx-ofs.vx-(fh->W/2);
|
||||
y=Pos.vy-ofs.vy-(fh->H/2)+((msin(m_sin)*bubmix_bobscale)>>12);
|
||||
sprites->printFT4(fh,x,y,0,0,2);
|
||||
sprites->printFT4(fh,x,y,0,0,PICKUPS_OT_POS);
|
||||
|
||||
CBasePickup::render();
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
void CSpatulaPickup::render()
|
||||
void CGlassesPickup::render()
|
||||
{
|
||||
DVECTOR ofs;
|
||||
SpriteBank *sprites;
|
||||
|
@ -64,13 +64,24 @@ void CSpatulaPickup::render()
|
|||
|
||||
ofs=getRenderOffset();
|
||||
sprites=getSpriteBank();
|
||||
fh=sprites->getFrameHeader(FRM__SPATULA);
|
||||
fh=sprites->getFrameHeader(FRM__GLASSES);
|
||||
x=Pos.vx-ofs.vx-(fh->W/2);
|
||||
y=Pos.vy-ofs.vy-(fh->H/2);
|
||||
sprites->printFT4(fh,x,y,0,0,2);
|
||||
sprites->printFT4(fh,x,y,0,0,PICKUPS_OT_POS);
|
||||
|
||||
CBasePickup::render();
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
void CGlassesPickup::collect(class CPlayer *_player)
|
||||
{
|
||||
CBasePickup::collect(_player);
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
end */
|
||||
|
|
|
@ -41,7 +41,6 @@ public:
|
|||
|
||||
virtual void collect(class CPlayer *_player);
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ void CBaseHealthPickup::render()
|
|||
x=Pos.vx-ofs.vx;
|
||||
y=Pos.vy-ofs.vy;
|
||||
angle=((msin(m_sin)*health_rotatescale)>>12)&4095;
|
||||
sprites->printRotatedScaledSprite(fh,x,y,4096,4096,angle,0);
|
||||
sprites->printRotatedScaledSprite(fh,x,y,4096,4096,angle,PICKUPS_OT_POS);
|
||||
|
||||
CBasePickup::render();
|
||||
}
|
||||
|
|
|
@ -39,6 +39,26 @@
|
|||
#include "pickups\pspatula.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PICKUPS_PJLAMMO_H__
|
||||
#include "pickups\pjlammo.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PICKUPS_PBUBMIX_H__
|
||||
#include "pickups\pbubmix.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PICKUPS_PGLASSES_H__
|
||||
#include "pickups\pglasses.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PICKUPS_PSHOES_H__
|
||||
#include "pickups\pshoes.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PICKUPS_PQUEST_H__
|
||||
#include "pickups\pquest.h"
|
||||
#endif
|
||||
|
||||
|
||||
/* Std Lib
|
||||
------- */
|
||||
|
@ -163,7 +183,7 @@ DVECTOR CBasePickup::getRenderOffset()
|
|||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose: This is basicially a factory method for making pickups :)
|
||||
Purpose: This is basically a factory method for making pickups :)
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
|
@ -191,6 +211,26 @@ CBasePickup *createPickup(const PICKUP_TYPE _type,const DVECTOR *_pos)
|
|||
pickup=new ("SpatulaPickup") CSpatulaPickup();
|
||||
break;
|
||||
|
||||
case PICKUP__JELLY_LAUNCHER_AMMO:
|
||||
pickup=new ("JellyLauncherAmmoPickup") CJellyLauncherAmmoPickup();
|
||||
break;
|
||||
|
||||
case PICKUP__BUBBLE_MIXTURE:
|
||||
pickup=new ("BubbleAmmoPickup") CBubbleMixturePickup();
|
||||
break;
|
||||
|
||||
case PICKUP__GLASSES:
|
||||
pickup=new ("GlassesPickup") CGlassesPickup();
|
||||
break;
|
||||
|
||||
case PICKUP__SQUEAKY_SHOES:
|
||||
pickup=new ("ShoesPickup") CShoesPickup();
|
||||
break;
|
||||
|
||||
case PICKUP__QUEST_ITEM__TEST:
|
||||
pickup=new ("QuestItemPickup") CTestQuestItemPickup();
|
||||
break;
|
||||
|
||||
default:
|
||||
ASSERT(!"UNKNOWN PICKUP TYPE");
|
||||
pickup=new ("Pickup") CBasePickup();
|
||||
|
|
|
@ -37,6 +37,11 @@ typedef enum
|
|||
PICKUP__25_PERCENT_LIFE,
|
||||
PICKUP__LIFE,
|
||||
PICKUP__SPATULA,
|
||||
PICKUP__JELLY_LAUNCHER_AMMO,
|
||||
PICKUP__BUBBLE_MIXTURE,
|
||||
PICKUP__GLASSES,
|
||||
PICKUP__SQUEAKY_SHOES,
|
||||
PICKUP__QUEST_ITEM__TEST, // Needs to be one of these for each quest item ( I think )
|
||||
}
|
||||
PICKUP_TYPE;
|
||||
|
||||
|
@ -57,6 +62,11 @@ public:
|
|||
virtual void collect(class CPlayer *_player);
|
||||
|
||||
protected:
|
||||
enum
|
||||
{
|
||||
PICKUPS_OT_POS=15,
|
||||
};
|
||||
|
||||
class SpriteBank *getSpriteBank() {return m_spriteBank;}
|
||||
DVECTOR getRenderOffset();
|
||||
|
||||
|
|
|
@ -82,15 +82,15 @@ void CJellyLauncherAmmoPickup::shutdown()
|
|||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
int rattlespeed=500;
|
||||
int rattlescale=90;
|
||||
int rattlecount=5;
|
||||
int waitcount=10;
|
||||
int jlammo_rattlespeed=500;
|
||||
int jlammo_rattlescale=90;
|
||||
int jlammo_rattlecount=5;
|
||||
int jlammo_waitcount=10;
|
||||
void CJellyLauncherAmmoPickup::think(int _frames)
|
||||
{
|
||||
CBasePickup::think(_frames);
|
||||
m_rattle+=rattlespeed*_frames;
|
||||
if(m_rattle>(rattlecount+waitcount)*4095)m_rattle=0;
|
||||
m_rattle+=jlammo_rattlespeed*_frames;
|
||||
if(m_rattle>(jlammo_rattlecount+jlammo_waitcount)*4095)m_rattle=0;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
|
@ -112,15 +112,15 @@ void CJellyLauncherAmmoPickup::render()
|
|||
fh=sprites->getFrameHeader(FRM__JELLYAMMO);
|
||||
x=Pos.vx-ofs.vx;
|
||||
y=Pos.vy-ofs.vy;
|
||||
if(m_rattle<=rattlecount*4095)
|
||||
if(m_rattle<=jlammo_rattlecount*4095)
|
||||
{
|
||||
angle=((msin(m_rattle&4095)*rattlescale)>>12)&4095;
|
||||
angle=((msin(m_rattle&4095)*jlammo_rattlescale)>>12)&4095;
|
||||
}
|
||||
else
|
||||
{
|
||||
angle=0;
|
||||
}
|
||||
sprites->printRotatedScaledSprite(fh,x,y,4096,4096,angle,2);
|
||||
sprites->printRotatedScaledSprite(fh,x,y,4096,4096,angle,PICKUPS_OT_POS);
|
||||
|
||||
CBasePickup::render();
|
||||
}
|
||||
|
|
|
@ -110,7 +110,7 @@ void CLifePickup::render()
|
|||
x=Pos.vx-ofs.vx-(fh->W/2);
|
||||
y=Pos.vy-ofs.vy-(fh->H/2);
|
||||
size=256+((msin(m_sin)*life_pulsescale)>>12);
|
||||
sprites->printFT4Scaled(fh,x,y,0,0,0,size);
|
||||
sprites->printFT4Scaled(fh,x,y,0,0,PICKUPS_OT_POS,size);
|
||||
|
||||
CBasePickup::render();
|
||||
}
|
||||
|
|
|
@ -25,6 +25,10 @@
|
|||
#include "utils\mathtab.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PRIM_HEADER__
|
||||
#include "gfx\prim.h"
|
||||
#endif
|
||||
|
||||
|
||||
/* Std Lib
|
||||
------- */
|
||||
|
@ -62,7 +66,7 @@
|
|||
void CBaseQuestItemPickup::init()
|
||||
{
|
||||
CBasePickup::init();
|
||||
// m_sin=0;
|
||||
m_pingFrame=0;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
|
@ -82,17 +86,28 @@ void CBaseQuestItemPickup::shutdown()
|
|||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
//int bubmix_bobspeed=10;
|
||||
//int bubmix_bobscale=3;
|
||||
int quest_pingframes=50;
|
||||
int quest_pingwaitframes=100;
|
||||
int quest_pingsize=100;
|
||||
int quest_pingr=0;
|
||||
int quest_pingg=255;
|
||||
int quest_pingb=0;
|
||||
int quest_pingsegments=16;
|
||||
int quest_transmode=1;
|
||||
void CBaseQuestItemPickup::think(int _frames)
|
||||
{
|
||||
CBasePickup::think(_frames);
|
||||
// m_sin=(m_sin+(_frames*bubmix_bobspeed))&4095;
|
||||
m_pingFrame+=_frames;
|
||||
if(m_pingFrame>(quest_pingframes+quest_pingwaitframes))
|
||||
{
|
||||
// Do sound too.. (pkg)
|
||||
m_pingFrame=0;
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
Purpose: LOTS to optimise here.. (pkg)
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
|
@ -110,6 +125,51 @@ void CBaseQuestItemPickup::render()
|
|||
y=Pos.vy-ofs.vy-(fh->H/2);
|
||||
sprites->printFT4(fh,x,y,0,0,PICKUPS_OT_POS);
|
||||
|
||||
if(m_pingFrame<quest_pingframes)
|
||||
{
|
||||
int radius;
|
||||
int endr,endg,endb;
|
||||
int angle;
|
||||
DVECTOR p1,p2;
|
||||
int i;
|
||||
POLY_G3 *g3;
|
||||
POLY_FT3 *ft3;
|
||||
|
||||
x=Pos.vx-ofs.vx;
|
||||
y=Pos.vy-ofs.vy;
|
||||
radius=(quest_pingsize*m_pingFrame)/quest_pingframes;
|
||||
endr=(quest_pingr*(quest_pingframes-m_pingFrame))/quest_pingframes;
|
||||
endg=(quest_pingg*(quest_pingframes-m_pingFrame))/quest_pingframes;
|
||||
endb=(quest_pingb*(quest_pingframes-m_pingFrame))/quest_pingframes;
|
||||
|
||||
p1.vx=x;
|
||||
p1.vy=y+radius;
|
||||
for(i=0;i<quest_pingsegments;i++)
|
||||
{
|
||||
angle=(4095*(i+1))/quest_pingsegments;
|
||||
p2.vx=x+((msin(angle)*radius)>>12);
|
||||
p2.vy=y+((mcos(angle)*radius)>>12);
|
||||
g3=GetPrimG3();
|
||||
setXY3(g3,x,y,p1.vx,p1.vy,p2.vx,p2.vy);
|
||||
setRGB0(g3,0,0,0);
|
||||
setRGB1(g3,endr,endg,endb);
|
||||
setRGB2(g3,endr,endg,endb);
|
||||
setShadeTex(g3,0);
|
||||
setSemiTrans(g3,1);
|
||||
AddPrimToList(g3,PICKUPS_OT_POS+1);
|
||||
p1=p2;
|
||||
}
|
||||
|
||||
// Trans
|
||||
ft3=GetPrimFT3();
|
||||
setShadeTex(ft3,1);
|
||||
setSemiTrans(ft3,1);
|
||||
ft3->tpage=(quest_transmode<<5);
|
||||
setXY3(ft3,512,512,512,512,512,512);
|
||||
AddPrimToList(ft3,PICKUPS_OT_POS+1);
|
||||
|
||||
}
|
||||
|
||||
CBasePickup::render();
|
||||
}
|
||||
|
||||
|
|
|
@ -47,6 +47,9 @@ public:
|
|||
protected:
|
||||
virtual int getFrameNumber()=0;
|
||||
|
||||
private:
|
||||
int m_pingFrame;
|
||||
|
||||
};
|
||||
|
||||
class CTestQuestItemPickup : public CBaseQuestItemPickup
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "gfx\sprbank.h" // Damnit.. include order! :( (pkg)
|
||||
#endif
|
||||
|
||||
#include "pickups\pbubmix.h"
|
||||
#include "pickups\pshoes.h"
|
||||
|
||||
#ifndef __MATHTABLE_HEADER__
|
||||
#include "utils\mathtab.h"
|
||||
|
@ -59,7 +59,7 @@
|
|||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
void CBubbleMixturePickup::init()
|
||||
void CShoesPickup::init()
|
||||
{
|
||||
CBasePickup::init();
|
||||
m_sin=0;
|
||||
|
@ -71,7 +71,7 @@ void CBubbleMixturePickup::init()
|
|||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
void CBubbleMixturePickup::shutdown()
|
||||
void CShoesPickup::shutdown()
|
||||
{
|
||||
CBasePickup::shutdown();
|
||||
}
|
||||
|
@ -82,12 +82,13 @@ void CBubbleMixturePickup::shutdown()
|
|||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
int bubmix_bobspeed=10;
|
||||
int bubmix_bobscale=3;
|
||||
void CBubbleMixturePickup::think(int _frames)
|
||||
int shoes_bobspeed=100;
|
||||
int shoes_bobscale=2;
|
||||
int shoes_seperation=4;
|
||||
void CShoesPickup::think(int _frames)
|
||||
{
|
||||
CBasePickup::think(_frames);
|
||||
m_sin=(m_sin+(_frames*bubmix_bobspeed))&4095;
|
||||
m_sin=(m_sin+(_frames*shoes_bobspeed))&4095;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
|
@ -96,19 +97,21 @@ void CBubbleMixturePickup::think(int _frames)
|
|||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
void CBubbleMixturePickup::render()
|
||||
void CShoesPickup::render()
|
||||
{
|
||||
DVECTOR ofs;
|
||||
SpriteBank *sprites;
|
||||
sFrameHdr *fh;
|
||||
int x,y;
|
||||
int x,y,yoff;
|
||||
|
||||
ofs=getRenderOffset();
|
||||
sprites=getSpriteBank();
|
||||
fh=sprites->getFrameHeader(FRM__BUBBLEMIXTURE);
|
||||
fh=sprites->getFrameHeader(FRM__SHOE);
|
||||
x=Pos.vx-ofs.vx-(fh->W/2);
|
||||
y=Pos.vy-ofs.vy-(fh->H/2)+((msin(m_sin)*bubmix_bobscale)>>12);
|
||||
sprites->printFT4(fh,x,y,0,0,PICKUPS_OT_POS);
|
||||
y=Pos.vy-ofs.vy-(fh->H/2);
|
||||
yoff=((msin(m_sin)*shoes_bobscale)>>12);
|
||||
sprites->printFT4(fh,x+shoes_seperation,y+yoff,0,0,PICKUPS_OT_POS);
|
||||
sprites->printFT4(fh,x-shoes_seperation,y-yoff,0,0,PICKUPS_OT_POS);
|
||||
|
||||
CBasePickup::render();
|
||||
}
|
||||
|
@ -119,7 +122,7 @@ void CBubbleMixturePickup::render()
|
|||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
void CBubbleMixturePickup::collect(class CPlayer *_player)
|
||||
void CShoesPickup::collect(class CPlayer *_player)
|
||||
{
|
||||
CBasePickup::collect(_player);
|
||||
}
|
||||
|
|
|
@ -21,10 +21,6 @@
|
|||
|
||||
#include "pickups\pspatula.h"
|
||||
|
||||
#ifndef __MATHTABLE_HEADER__
|
||||
#include "utils\mathtab.h"
|
||||
#endif
|
||||
|
||||
|
||||
/* Std Lib
|
||||
------- */
|
||||
|
@ -106,21 +102,20 @@ void CSpatulaPickup::render()
|
|||
SpriteBank *sprites;
|
||||
sFrameHdr *fh;
|
||||
int x,y;
|
||||
int angle;
|
||||
|
||||
ofs=getRenderOffset();
|
||||
sprites=getSpriteBank();
|
||||
fh=sprites->getFrameHeader(FRM__SPATULA);
|
||||
x=Pos.vx-ofs.vx-(fh->W/2);
|
||||
y=Pos.vy-ofs.vy-(fh->H/2);
|
||||
sprites->printFT4(fh,x,y,0,0,1);
|
||||
sprites->printFT4(fh,x,y,0,0,PICKUPS_OT_POS);
|
||||
|
||||
if(m_glint<=255)
|
||||
{
|
||||
fh=sprites->getFrameHeader(spat_glintFrames[m_glint&0x03]);
|
||||
x=x+(((spat_gxy2.vx-spat_gxy1.vx)*m_glint)>>8)+spat_gxy1.vx;
|
||||
y=y+(((spat_gxy2.vy-spat_gxy1.vy)*m_glint)>>8)+spat_gxy1.vy;
|
||||
sprites->printFT4(fh,x,y,0,0,0);
|
||||
sprites->printFT4(fh,x,y,0,0,PICKUPS_OT_POS-1);
|
||||
}
|
||||
|
||||
CBasePickup::render();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue