diff --git a/makefile.gaz b/makefile.gaz index 94e022008..1d0b3e54c 100644 --- a/makefile.gaz +++ b/makefile.gaz @@ -144,6 +144,16 @@ pad_src := pads paul_src := paul \ scenesel +pickups_src := pickup \ + pbubmix \ + pglasses \ + phealth \ + pjlammo \ + plife \ + pquest \ + pshoes \ + pspatula + player_src := demoplay \ panimsfx \ player \ diff --git a/makefile.gfx b/makefile.gfx index 0ec593799..5101eeafc 100644 --- a/makefile.gfx +++ b/makefile.gfx @@ -303,6 +303,7 @@ GFX_DATA_OUT += $(UI_GFX_TEX_OUT) #---------------------------------------------------------------------------- # Ingame graphic effects +# Also contins pickup graphics at the moment.. #---------------------------------------------------------------------------- INGAMEFX_GFX_DIR := $(GRAF_DIR)/ingamefx INGAMEFX_GFX_OUT_DIR := $(DATA_OUT)/ingamefx @@ -310,10 +311,15 @@ INGAMEFX_GFX_OUT_DIR := $(DATA_OUT)/ingamefx INGAMEFX_GFX_NONTRANS := INGAMEFX_GFX_NONTRANS_IN := $(foreach FILE,$(INGAMEFX_GFX_NONTRANS),$(INGAMEFX_NONTRANS_DIR)/$(FILE)) -INGAMEFX_GFX_TRANS := +bubble_1.bmp +bubble_2.bmp +bubble_3.bmp -INGAMEFX_GFX_TRANS_IN := $(foreach FILE,$(INGAMEFX_GFX_TRANS),$(INGAMEFX_GFX_DIR)/$(FILE)) +PICKUP_GFX_DIR := $(GRAF_DIR)/pickups +PICKUP_GFX := +spatula +pants +health100 +health50 +health25 +glint1 +glint2 +glint3 +glint4 \ + +jellyammo +bubblemixture +glasses +shoe +teeth +PICKUP_GFX_IN := $(foreach FILE,$(PICKUP_GFX),$(PICKUP_GFX_DIR)/$(FILE).bmp) -INGAMEFX_GFX_TEX_IN := ${INGAMEFX_GFX_NONTRANS_IN} ${INGAMEFX_GFX_TRANS_IN} +INGAMEFX_GFX_TRANS := +bubble_1 +bubble_2 +bubble_3 +INGAMEFX_GFX_TRANS_IN := $(foreach FILE,$(INGAMEFX_GFX_TRANS),$(INGAMEFX_GFX_DIR)/$(FILE).bmp) + +INGAMEFX_GFX_TEX_IN := ${INGAMEFX_GFX_NONTRANS_IN} ${INGAMEFX_GFX_TRANS_IN} ${PICKUP_GFX_IN} INGAMEFX_GFX_TEX_OUT := $(INGAMEFX_GFX_OUT_DIR)/ingamefx.Spr INGAMEFX_GFX_REP_FILE := $(REPORT_DIR)/ingamefx.rep INGAMEFX_GFX_HDR_FILE := $(INC_DIR)/ingamefx.h @@ -325,7 +331,7 @@ cleaningamefx : ingamefx: $(INGAMEFX_GFX_TEX_IN) $(INGAMEFX_GFX_TEX_OUT) : $(INGAMEFX_GFX_TEX_IN) - @parkgrab -z+ ${INGAMEFX_GFX_TRANS_IN} -z- ${INGAMEFX_GFX_NONTRANS_IN} -b+ -t:29,1,1 -l:$(REPORT_DIR)/ingamefx.lbm -o:$(INGAMEFX_GFX_TEX_OUT) -k:$(INGAMEFX_GFX_REP_FILE) + @parkgrab -z+ ${INGAMEFX_GFX_TRANS_IN} ${PICKUP_GFX_IN} -z- ${INGAMEFX_GFX_NONTRANS_IN} -b+ -t:29,1,1 -l:$(REPORT_DIR)/ingamefx.lbm -o:$(INGAMEFX_GFX_TEX_OUT) -k:$(INGAMEFX_GFX_REP_FILE) @$(MV) -f $(INGAMEFX_GFX_OUT_DIR)/ingamefx.h $(INGAMEFX_GFX_HDR_FILE) GRAF_DIRS_TO_MAKE += $(INGAMEFX_GFX_OUT_DIR) diff --git a/source/pickups/pbubmix.cpp b/source/pickups/pbubmix.cpp index 19c34dd7e..c3b16d052 100644 --- a/source/pickups/pbubmix.cpp +++ b/source/pickups/pbubmix.cpp @@ -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(); } diff --git a/source/pickups/pglasses.cpp b/source/pickups/pglasses.cpp index 09ef5ce98..04423715b 100644 --- a/source/pickups/pglasses.cpp +++ b/source/pickups/pglasses.cpp @@ -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 */ diff --git a/source/pickups/pglasses.h b/source/pickups/pglasses.h index fcc984bc4..2fa946324 100644 --- a/source/pickups/pglasses.h +++ b/source/pickups/pglasses.h @@ -41,7 +41,6 @@ public: virtual void collect(class CPlayer *_player); -private: }; diff --git a/source/pickups/phealth.cpp b/source/pickups/phealth.cpp index e6e074714..11d31f426 100644 --- a/source/pickups/phealth.cpp +++ b/source/pickups/phealth.cpp @@ -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(); } diff --git a/source/pickups/pickup.cpp b/source/pickups/pickup.cpp index 3a2f63fc1..a0b5f64db 100644 --- a/source/pickups/pickup.cpp +++ b/source/pickups/pickup.cpp @@ -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(); diff --git a/source/pickups/pickup.h b/source/pickups/pickup.h index 681bdc76a..f82fb65ca 100644 --- a/source/pickups/pickup.h +++ b/source/pickups/pickup.h @@ -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(); diff --git a/source/pickups/pjlammo.cpp b/source/pickups/pjlammo.cpp index 85275d489..3fe79a5f6 100644 --- a/source/pickups/pjlammo.cpp +++ b/source/pickups/pjlammo.cpp @@ -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(); } diff --git a/source/pickups/plife.cpp b/source/pickups/plife.cpp index fa9262590..dd9c47f81 100644 --- a/source/pickups/plife.cpp +++ b/source/pickups/plife.cpp @@ -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(); } diff --git a/source/pickups/pquest.cpp b/source/pickups/pquest.cpp index 2fb0e828a..cbd3ddef6 100644 --- a/source/pickups/pquest.cpp +++ b/source/pickups/pquest.cpp @@ -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>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(); } diff --git a/source/pickups/pquest.h b/source/pickups/pquest.h index d309c3c73..9f4d3aad9 100644 --- a/source/pickups/pquest.h +++ b/source/pickups/pquest.h @@ -47,6 +47,9 @@ public: protected: virtual int getFrameNumber()=0; +private: + int m_pingFrame; + }; class CTestQuestItemPickup : public CBaseQuestItemPickup diff --git a/source/pickups/pshoes.cpp b/source/pickups/pshoes.cpp index 7bf521320..f2739dba5 100644 --- a/source/pickups/pshoes.cpp +++ b/source/pickups/pshoes.cpp @@ -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); } diff --git a/source/pickups/pspatula.cpp b/source/pickups/pspatula.cpp index 243958304..2f8437db2 100644 --- a/source/pickups/pspatula.cpp +++ b/source/pickups/pspatula.cpp @@ -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(); diff --git a/users/paul/spongebob project/spongebob project.dsp b/users/paul/spongebob project/spongebob project.dsp index 0a1995e0e..7a079c0e3 100644 --- a/users/paul/spongebob project/spongebob project.dsp +++ b/users/paul/spongebob project/spongebob project.dsp @@ -680,6 +680,82 @@ SOURCE=..\..\..\source\paul\scenesel.cpp SOURCE=..\..\..\source\paul\scenesel.h # End Source File # End Group +# Begin Group "pickups" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\..\source\pickups\pbubmix.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\source\pickups\pbubmix.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\source\pickups\pglasses.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\source\pickups\pglasses.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\source\pickups\phealth.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\source\pickups\phealth.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\source\pickups\pickup.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\source\pickups\pickup.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\source\pickups\pjlammo.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\source\pickups\pjlammo.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\source\pickups\plife.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\source\pickups\plife.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\source\pickups\pquest.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\source\pickups\pquest.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\source\pickups\pshoes.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\source\pickups\pshoes.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\source\pickups\pspatula.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\source\pickups\pspatula.h +# End Source File +# End Group # Begin Group "player" # PROP Default_Filter ""