This commit is contained in:
Paul 2001-02-21 17:13:37 +00:00
parent 9386d1e96c
commit 68bf62003e
15 changed files with 259 additions and 46 deletions

View File

@ -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 \

View File

@ -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)

View File

@ -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();
}

View File

@ -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 */

View File

@ -41,7 +41,6 @@ public:
virtual void collect(class CPlayer *_player);
private:
};

View File

@ -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();
}

View File

@ -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();

View File

@ -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();

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -47,6 +47,9 @@ public:
protected:
virtual int getFrameNumber()=0;
private:
int m_pingFrame;
};
class CTestQuestItemPickup : public CBaseQuestItemPickup

View File

@ -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);
}

View File

@ -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();

View File

@ -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 ""