This commit is contained in:
parent
c716046995
commit
1ba0ce001d
19 changed files with 57 additions and 118 deletions
|
@ -243,11 +243,13 @@ void TestFX(DVECTOR Pos)
|
||||||
*/
|
*/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
int FXType=(CFX::FX_TYPE)CFX::FX_TYPE_THWACK;
|
int FXType=(CFX::FX_TYPE)CFX::FX_TYPE_THWACK;
|
||||||
|
#include "game\game.h"
|
||||||
void TestFX(DVECTOR Pos,CThing *Parent)
|
void TestFX(DVECTOR Pos,CThing *Parent)
|
||||||
{
|
{
|
||||||
CFXAttachAnim *FX=(CFXAttachAnim*)CFX::Create((CFX::FX_TYPE)FXType,Pos);
|
//CFXAttachAnim *FX=(CFXAttachAnim*)CFX::Create((CFX::FX_TYPE)FXType,Pos);
|
||||||
// Parent->addChild(FX);
|
// Parent->addChild(FX);
|
||||||
// TestFXPtr->setLife(32);
|
// TestFXPtr->setLife(32);
|
||||||
|
CGameScene::dropHealth(Pos,0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -69,6 +69,7 @@ static CFX *Create(const FX_TYPE Type);
|
||||||
static CFX *Create(const FX_TYPE Type,CThing *Parent);
|
static CFX *Create(const FX_TYPE Type,CThing *Parent);
|
||||||
static CFX *Create(const FX_TYPE Type,DVECTOR const &Pos);
|
static CFX *Create(const FX_TYPE Type,DVECTOR const &Pos);
|
||||||
virtual bool alwaysThink() {return(!RelativeToMap);}
|
virtual bool alwaysThink() {return(!RelativeToMap);}
|
||||||
|
virtual void leftThinkZone(int _frames) {killFX();}
|
||||||
|
|
||||||
virtual void init();
|
virtual void init();
|
||||||
virtual void init(DVECTOR const &Pos);
|
virtual void init(DVECTOR const &Pos);
|
||||||
|
|
|
@ -39,12 +39,6 @@ void CFXBaseAnim::init(DVECTOR const &_Pos)
|
||||||
renderFrame=DataPtr->StartFrame;
|
renderFrame=DataPtr->StartFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
void CFXBaseAnim::shutdown()
|
|
||||||
{
|
|
||||||
CFX::shutdown();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*** Think *******************************************************************/
|
/*** Think *******************************************************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -86,7 +80,7 @@ void CFXBaseAnim::killFX()
|
||||||
{
|
{
|
||||||
setToShutdown();
|
setToShutdown();
|
||||||
// If has follow on effect, create it now
|
// If has follow on effect, create it now
|
||||||
if (DataPtr->EndFX)
|
if (DataPtr->EndFX || canThink())
|
||||||
{
|
{
|
||||||
CFX::Create((CFX::FX_TYPE)DataPtr->EndFX,getPos());
|
CFX::Create((CFX::FX_TYPE)DataPtr->EndFX,getPos());
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,6 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual void init(DVECTOR const &Pos);
|
virtual void init(DVECTOR const &Pos);
|
||||||
virtual void shutdown();
|
|
||||||
virtual void think(int _frames);
|
virtual void think(int _frames);
|
||||||
virtual void render();
|
virtual void render();
|
||||||
virtual void killFX();
|
virtual void killFX();
|
||||||
|
|
|
@ -25,12 +25,6 @@ void CFXBaseTrail::init(DVECTOR const &_Pos)
|
||||||
ListCount=0;
|
ListCount=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
void CFXBaseTrail::shutdown()
|
|
||||||
{
|
|
||||||
CFX::shutdown();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*** Think *******************************************************************/
|
/*** Think *******************************************************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -32,7 +32,6 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual void init(DVECTOR const &Pos);
|
virtual void init(DVECTOR const &Pos);
|
||||||
virtual void shutdown();
|
|
||||||
virtual void think(int _frames);
|
virtual void think(int _frames);
|
||||||
virtual void render();
|
virtual void render();
|
||||||
|
|
||||||
|
|
|
@ -36,12 +36,6 @@ sLevelHdr *LevelHdr=CLevel::getLevelHdr();
|
||||||
Life=FallingTile_DefLife;
|
Life=FallingTile_DefLife;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
void CFXFallingTile::shutdown()
|
|
||||||
{
|
|
||||||
CFX::shutdown();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*** Think *******************************************************************/
|
/*** Think *******************************************************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -13,7 +13,6 @@ class CFXFallingTile : public CFX
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual void init(DVECTOR const &Pos);
|
virtual void init(DVECTOR const &Pos);
|
||||||
virtual void shutdown();
|
|
||||||
virtual void think(int _frames);
|
virtual void think(int _frames);
|
||||||
virtual void render();
|
virtual void render();
|
||||||
void SetTile(int T) {Tile=T;}
|
void SetTile(int T) {Tile=T;}
|
||||||
|
|
|
@ -32,12 +32,6 @@ void CFXJellyFishLegs::init(DVECTOR const &_Pos)
|
||||||
Scale = ONE;
|
Scale = ONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
void CFXJellyFishLegs::shutdown()
|
|
||||||
{
|
|
||||||
CFX::shutdown();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CFXJellyFishLegs::Setup(int XOfs,int YOfs,bool XFlip)
|
void CFXJellyFishLegs::Setup(int XOfs,int YOfs,bool XFlip)
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,7 +13,6 @@ class CFXJellyFishLegs : public CFX
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual void init(DVECTOR const &Pos);
|
virtual void init(DVECTOR const &Pos);
|
||||||
virtual void shutdown();
|
|
||||||
virtual void think(int _frames);
|
virtual void think(int _frames);
|
||||||
virtual void render();
|
virtual void render();
|
||||||
|
|
||||||
|
|
|
@ -32,12 +32,6 @@ SpriteBank *SprBank=CGameScene::getSpriteBank();
|
||||||
DrawW=NRGW;
|
DrawW=NRGW;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
void CFXNRGBar::shutdown()
|
|
||||||
{
|
|
||||||
CFX::shutdown();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*** Think *******************************************************************/
|
/*** Think *******************************************************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -13,7 +13,6 @@ class CFXNRGBar : public CFX
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual void init(DVECTOR const &Pos);
|
virtual void init(DVECTOR const &Pos);
|
||||||
virtual void shutdown();
|
|
||||||
virtual void think(int _frames);
|
virtual void think(int _frames);
|
||||||
virtual void render();
|
virtual void render();
|
||||||
|
|
||||||
|
|
|
@ -33,12 +33,6 @@ void CFXSteam::init(DVECTOR const &_Pos)
|
||||||
IsHorizontal=false;
|
IsHorizontal=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
void CFXSteam::shutdown()
|
|
||||||
{
|
|
||||||
CFX::shutdown();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CFXSteam::SetSize(int Size)
|
void CFXSteam::SetSize(int Size)
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,7 +13,7 @@ class CFXSteam : public CFXBaseTrail
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual void init(DVECTOR const &Pos);
|
virtual void init(DVECTOR const &Pos);
|
||||||
virtual void shutdown();
|
|
||||||
virtual void think(int _frames);
|
virtual void think(int _frames);
|
||||||
virtual void killFX();
|
virtual void killFX();
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
#include "mem\memory.h"
|
#include "mem\memory.h"
|
||||||
#include "fileio\fileio.h"
|
#include "fileio\fileio.h"
|
||||||
#include "utils\utils.h"
|
#include "utils\utils.h"
|
||||||
//#include "utils\pak.h"
|
|
||||||
#include "gfx\prim.h"
|
#include "gfx\prim.h"
|
||||||
#include "gfx\actor.h"
|
#include "gfx\actor.h"
|
||||||
#include "gfx\otpos.h"
|
#include "gfx\otpos.h"
|
||||||
|
@ -99,7 +98,7 @@ int Slot=0;
|
||||||
SlotCount++;
|
SlotCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SlotList[Slot].RefCount++;
|
// SlotList[Slot].RefCount++;
|
||||||
|
|
||||||
return(Slot);
|
return(Slot);
|
||||||
}
|
}
|
||||||
|
@ -208,7 +207,7 @@ sPoolNode *DstTail=Dst->Tail;
|
||||||
int CActorCache::ReserveSlot(int W,int H,int FrameCount)
|
int CActorCache::ReserveSlot(int W,int H,int FrameCount)
|
||||||
{
|
{
|
||||||
int Slot=GetSlot(W,H);
|
int Slot=GetSlot(W,H);
|
||||||
SlotList[Slot].FrameCount+=FrameCount;
|
// SlotList[Slot].FrameCount+=FrameCount;
|
||||||
return(Slot);
|
return(Slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -282,8 +281,8 @@ void CActorCache::Reset()
|
||||||
SlotList[i].ListMem=0;
|
SlotList[i].ListMem=0;
|
||||||
SlotList[i].NodeList.Head=0;
|
SlotList[i].NodeList.Head=0;
|
||||||
SlotList[i].NodeList.Tail=0;
|
SlotList[i].NodeList.Tail=0;
|
||||||
SlotList[i].RefCount=0;
|
// SlotList[i].RefCount=0;
|
||||||
SlotList[i].FrameCount=0;
|
// SlotList[i].FrameCount=0;
|
||||||
SlotList[i].Width=0;
|
SlotList[i].Width=0;
|
||||||
SlotList[i].Height=0;
|
SlotList[i].Height=0;
|
||||||
}
|
}
|
||||||
|
@ -524,12 +523,7 @@ sActorPool *Actor=ActorList;
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
CActorGfx::CActorGfx(sActorPool *ThisActor)
|
CActorGfx::CActorGfx(sActorPool *ThisActor)
|
||||||
{
|
{
|
||||||
PoolEntry=ThisActor;
|
setActor(ThisActor);
|
||||||
ShadowXOfs=DEF_SHADOW_OFS;
|
|
||||||
ShadowYOfs=DEF_SHADOW_OFS;
|
|
||||||
ShadowFlag=false;
|
|
||||||
OtPos=OTPOS__ACTOR_POS;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -537,6 +531,17 @@ CActorGfx::~CActorGfx()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
void CActorGfx::setActor(sActorPool *ThisActor)
|
||||||
|
{
|
||||||
|
PoolEntry=ThisActor;
|
||||||
|
// ShadowXOfs=DEF_SHADOW_OFS;
|
||||||
|
// ShadowYOfs=DEF_SHADOW_OFS;
|
||||||
|
// ShadowFlag=false;
|
||||||
|
OtPos=OTPOS__ACTOR_POS;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
POLY_FT4 *CActorGfx::Render(DVECTOR &Pos,int Anim,int Frame,bool XFlip,bool YFlip)
|
POLY_FT4 *CActorGfx::Render(DVECTOR &Pos,int Anim,int Frame,bool XFlip,bool YFlip)
|
||||||
|
@ -622,7 +627,7 @@ sSpriteAnim *ThisAnim=SpriteBank->AnimList+Anim;
|
||||||
Ft4->tpage=ThisNode->TPage;
|
Ft4->tpage=ThisNode->TPage;
|
||||||
Ft4->clut=PoolEntry->ActorGfx->Clut;
|
Ft4->clut=PoolEntry->ActorGfx->Clut;
|
||||||
addPrim(OtPtr+OtPos,Ft4);
|
addPrim(OtPtr+OtPos,Ft4);
|
||||||
|
/*
|
||||||
if (ShadowFlag)
|
if (ShadowFlag)
|
||||||
{
|
{
|
||||||
POLY_FT4 *sFt4=GetPrimFT4();
|
POLY_FT4 *sFt4=GetPrimFT4();
|
||||||
|
@ -635,6 +640,7 @@ sSpriteAnim *ThisAnim=SpriteBank->AnimList+Anim;
|
||||||
setRGB0(sFt4,0,0,0);
|
setRGB0(sFt4,0,0,0);
|
||||||
addPrim(OtPtr+OtPos,sFt4);
|
addPrim(OtPtr+OtPos,sFt4);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
// Set BBox
|
// Set BBox
|
||||||
//int HalfW=CurrentFrameGfx->W>>1;
|
//int HalfW=CurrentFrameGfx->W>>1;
|
||||||
// Sizes now depend on aspect corrected sizes, so get sizes back from poly
|
// Sizes now depend on aspect corrected sizes, so get sizes back from poly
|
||||||
|
|
|
@ -31,19 +31,19 @@ struct sNodeList
|
||||||
struct sPoolSlot
|
struct sPoolSlot
|
||||||
{
|
{
|
||||||
u16 Width,Height;
|
u16 Width,Height;
|
||||||
u16 RefCount;
|
// u16 RefCount;
|
||||||
u16 FrameCount;
|
// u16 FrameCount;
|
||||||
sNodeList NodeList;
|
sNodeList NodeList;
|
||||||
u8 *ListMem;
|
u8 *ListMem;
|
||||||
int SlotCount;
|
u16 SlotCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
struct sActorPool
|
struct sActorPool
|
||||||
{
|
{
|
||||||
FileEquate Filename;
|
FileEquate Filename;
|
||||||
|
s16 CacheSlot;
|
||||||
sSpriteAnimBank *ActorGfx;
|
sSpriteAnimBank *ActorGfx;
|
||||||
int CacheSlot;
|
|
||||||
sNodeList *GlobalCache;
|
sNodeList *GlobalCache;
|
||||||
sNodeList LocalCache;
|
sNodeList LocalCache;
|
||||||
sNodeList LastCache;
|
sNodeList LastCache;
|
||||||
|
@ -138,6 +138,8 @@ public:
|
||||||
CActorGfx(sActorPool *ThisActor);
|
CActorGfx(sActorPool *ThisActor);
|
||||||
virtual ~CActorGfx();
|
virtual ~CActorGfx();
|
||||||
|
|
||||||
|
void setActor(sActorPool *ThisActor);
|
||||||
|
|
||||||
POLY_FT4 *Render(DVECTOR &Pos,int Anim,int Frame,bool FlipX=false,bool FlipY=false);
|
POLY_FT4 *Render(DVECTOR &Pos,int Anim,int Frame,bool FlipX=false,bool FlipY=false);
|
||||||
POLY_FT4 *RotateScale(POLY_FT4 *Ft4,DVECTOR &Pos,int Angle,int XScale,int YScale);
|
POLY_FT4 *RotateScale(POLY_FT4 *Ft4,DVECTOR &Pos,int Angle,int XScale,int YScale);
|
||||||
|
|
||||||
|
@ -146,8 +148,8 @@ virtual ~CActorGfx();
|
||||||
|
|
||||||
sBBox &GetBBox() {return(BBox);}
|
sBBox &GetBBox() {return(BBox);}
|
||||||
|
|
||||||
void SetShadow(bool f) {ShadowFlag=f;}
|
// void SetShadow(bool f) {ShadowFlag=f;}
|
||||||
void SetShadowOfs(int X,int Y) {ShadowXOfs=X; ShadowYOfs=Y;}
|
// void SetShadowOfs(int X,int Y) {ShadowXOfs=X; ShadowYOfs=Y;}
|
||||||
void SetOtPos(int Ot) {OtPos=Ot;}
|
void SetOtPos(int Ot) {OtPos=Ot;}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -158,8 +160,8 @@ protected:
|
||||||
sSpriteFrameGfx *CurrentFrameGfx;
|
sSpriteFrameGfx *CurrentFrameGfx;
|
||||||
|
|
||||||
sBBox BBox;
|
sBBox BBox;
|
||||||
bool ShadowFlag;
|
// bool ShadowFlag;
|
||||||
s16 ShadowXOfs,ShadowYOfs;
|
// s16 ShadowXOfs,ShadowYOfs;
|
||||||
u32 OtPos;
|
u32 OtPos;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -227,7 +227,7 @@ public:
|
||||||
void setLedgeLookAhead(int _lookAhead) {m_ledgeLookAhead=_lookAhead;}
|
void setLedgeLookAhead(int _lookAhead) {m_ledgeLookAhead=_lookAhead;}
|
||||||
|
|
||||||
void addLife();
|
void addLife();
|
||||||
void addSpatula() {m_numSpatulasHeld++;}
|
void addSpatula(int Count=1) {m_numSpatulasHeld+=Count;}
|
||||||
int getSpatulasHeld() {return m_numSpatulasHeld;}
|
int getSpatulasHeld() {return m_numSpatulasHeld;}
|
||||||
ATTACK_STATE getAttackState();
|
ATTACK_STATE getAttackState();
|
||||||
int isRecoveringFromHit() {return m_invincibleFrameCount!=0||m_currentMode==PLAYER_MODE_DEAD;}
|
int isRecoveringFromHit() {return m_invincibleFrameCount!=0||m_currentMode==PLAYER_MODE_DEAD;}
|
||||||
|
|
|
@ -418,6 +418,7 @@ DVECTOR const &CamPos=CLevel::getCameraPos();
|
||||||
if (ThingRect->y2<m_ThinkBBox.YMin || ThingRect->y1>m_ThinkBBox.YMax) Flag=0;
|
if (ThingRect->y2<m_ThinkBBox.YMin || ThingRect->y1>m_ThinkBBox.YMax) Flag=0;
|
||||||
}
|
}
|
||||||
thing->setThinkFlag(Flag);
|
thing->setThinkFlag(Flag);
|
||||||
|
// Is in think zone
|
||||||
if (Flag)
|
if (Flag)
|
||||||
{
|
{
|
||||||
thing->think(_frames);
|
thing->think(_frames);
|
||||||
|
@ -428,15 +429,16 @@ DVECTOR const &CamPos=CLevel::getCameraPos();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Flag|=lastFlag;
|
Flag|=lastFlag;
|
||||||
|
// Handle enter/leave states (not sure of viabilty now)
|
||||||
switch (Flag)
|
switch (Flag)
|
||||||
{ // Last This
|
{ // Last This
|
||||||
case 0: // 0 0
|
case 0: // 0 0
|
||||||
break;
|
break;
|
||||||
case 1: // 0 1
|
case 1: // 0 1
|
||||||
thing->enterThingZone(_frames);
|
thing->enterThinkZone(_frames);
|
||||||
break;
|
break;
|
||||||
case 2: // 1 0
|
case 2: // 1 0
|
||||||
thing->leftThingZone(_frames);
|
thing->leftThinkZone(_frames);
|
||||||
break;
|
break;
|
||||||
case 3: // 1 1
|
case 3: // 1 1
|
||||||
break;
|
break;
|
||||||
|
@ -444,11 +446,8 @@ DVECTOR const &CamPos=CLevel::getCameraPos();
|
||||||
ASSERT("Invalid Think State");
|
ASSERT("Invalid Think State");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* THIS WILL NOT STAY HERE, THINGS MUST BE INITIALISED CORRECTLY */
|
/* THIS WILL NOT STAY HERE, THINGS MUST BE INITIALISED CORRECTLY */
|
||||||
thing->updateCollisionArea();
|
thing->updateCollisionArea();
|
||||||
|
|
||||||
thing=thing->m_nextListThing;
|
thing=thing->m_nextListThing;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -916,6 +915,7 @@ void CThingManager::resetFreeList()
|
||||||
while (ThisThing)
|
while (ThisThing)
|
||||||
{
|
{
|
||||||
CThing *Next=ThisThing->NextFreeThing;
|
CThing *Next=ThisThing->NextFreeThing;
|
||||||
|
ThisThing->destroy();
|
||||||
delete ThisThing;
|
delete ThisThing;
|
||||||
FreeListCount--;
|
FreeListCount--;
|
||||||
ThisThing=Next;
|
ThisThing=Next;
|
||||||
|
@ -979,21 +979,12 @@ int SubType=Thing->getThingSubType();
|
||||||
CThing **List=s_FreeList[Type];
|
CThing **List=s_FreeList[Type];
|
||||||
|
|
||||||
// Check its been aquired/set correctly
|
// Check its been aquired/set correctly
|
||||||
// ASSERT(SubType!=1234);
|
|
||||||
if (SubType!=1234)
|
ASSERT(SubType!=1234);
|
||||||
{
|
|
||||||
Thing->NextFreeThing=List[SubType];
|
Thing->NextFreeThing=List[SubType];
|
||||||
List[SubType]=Thing;
|
List[SubType]=Thing;
|
||||||
FreeListCount++;
|
FreeListCount++;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
printf("%i %i\n",Type,SubType);
|
|
||||||
ASSERT(!"Thing not Setup Correctly");
|
|
||||||
Thing->NextFreeThing=DuffList;
|
|
||||||
DuffList=Thing;
|
|
||||||
DuffListCount++;
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
delete Thing;
|
delete Thing;
|
||||||
|
@ -1249,30 +1240,6 @@ CThing *List=NextThing;
|
||||||
m_numChildren = 0;
|
m_numChildren = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
|
||||||
Function:
|
|
||||||
Purpose:
|
|
||||||
Params:
|
|
||||||
Returns:
|
|
||||||
---------------------------------------------------------------------- */
|
|
||||||
/*
|
|
||||||
bool CThing::hasChild(CThing *Child)
|
|
||||||
{
|
|
||||||
CThing *nextChild = NextThing;
|
|
||||||
|
|
||||||
while( nextChild )
|
|
||||||
{
|
|
||||||
if ( nextChild == Child )
|
|
||||||
{
|
|
||||||
return( true );
|
|
||||||
}
|
|
||||||
|
|
||||||
nextChild = nextChild->NextThing;
|
|
||||||
}
|
|
||||||
|
|
||||||
return( false );
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
Function:
|
Function:
|
||||||
Purpose:
|
Purpose:
|
||||||
|
@ -1315,7 +1282,7 @@ void CThing::updateCollisionArea()
|
||||||
Params:
|
Params:
|
||||||
Returns:
|
Returns:
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
|
/*
|
||||||
s32 CThing::getNewYPos(CThing *_thisThing)
|
s32 CThing::getNewYPos(CThing *_thisThing)
|
||||||
{
|
{
|
||||||
CRECT thisRect;
|
CRECT thisRect;
|
||||||
|
@ -1330,7 +1297,7 @@ s32 CThing::getNewYPos(CThing *_thisThing)
|
||||||
return( thisRect.y2 );
|
return( thisRect.y2 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
Function:
|
Function:
|
||||||
Purpose:
|
Purpose:
|
||||||
|
|
|
@ -140,8 +140,11 @@ virtual TYPE getThingType()=0;
|
||||||
virtual void setThingSubType(int T) {m_SubType=T;}
|
virtual void setThingSubType(int T) {m_SubType=T;}
|
||||||
virtual int getThingSubType() {return(m_SubType);}
|
virtual int getThingSubType() {return(m_SubType);}
|
||||||
|
|
||||||
virtual void init();
|
virtual void create() {;} // Once only init (for mem alloc)
|
||||||
virtual void shutdown();
|
virtual void init(); // re-usable init
|
||||||
|
virtual void shutdown(); // re-usable shutdown
|
||||||
|
virtual void destroy() {;} // memory clean up when totally killing the poor things
|
||||||
|
|
||||||
virtual void think(int _frames);
|
virtual void think(int _frames);
|
||||||
virtual void render();
|
virtual void render();
|
||||||
void setToShutdown(bool f=true) {m_isShuttingDown = f;}
|
void setToShutdown(bool f=true) {m_isShuttingDown = f;}
|
||||||
|
@ -153,10 +156,8 @@ virtual int dontKillDuringLevelRespawn() {return false;}
|
||||||
void removeChild(CThing *Child);
|
void removeChild(CThing *Child);
|
||||||
void removeAllChild();
|
void removeAllChild();
|
||||||
void deleteAllChild();
|
void deleteAllChild();
|
||||||
// bool hasChild(CThing *Child);
|
|
||||||
int getNumChildren() {return( m_numChildren );}
|
int getNumChildren() {return( m_numChildren );}
|
||||||
|
|
||||||
|
|
||||||
DVECTOR const &getPos() {return Pos;}
|
DVECTOR const &getPos() {return Pos;}
|
||||||
void setPos(DVECTOR newPos) {Pos=newPos;}
|
void setPos(DVECTOR newPos) {Pos=newPos;}
|
||||||
DVECTOR getPosDelta() {return PosDelta;}
|
DVECTOR getPosDelta() {return PosDelta;}
|
||||||
|
@ -186,8 +187,8 @@ public:
|
||||||
virtual CRECT const *getRenderBBox() {return &m_collisionArea;}
|
virtual CRECT const *getRenderBBox() {return &m_collisionArea;}
|
||||||
virtual CRECT const *getThinkBBox() {return &m_collisionArea;}
|
virtual CRECT const *getThinkBBox() {return &m_collisionArea;}
|
||||||
virtual bool alwaysThink() {return(false);}
|
virtual bool alwaysThink() {return(false);}
|
||||||
virtual void leftThingZone(int _frames) {}
|
virtual void leftThinkZone(int _frames) {}
|
||||||
virtual void enterThingZone(int _frames) {}
|
virtual void enterThinkZone(int _frames) {}
|
||||||
|
|
||||||
void ShowBBox();
|
void ShowBBox();
|
||||||
DVECTOR const &getCollisionCentre() {return m_collisionCentre;}
|
DVECTOR const &getCollisionCentre() {return m_collisionCentre;}
|
||||||
|
@ -203,7 +204,7 @@ virtual int checkCollisionAgainst(CThing *_thisThing, int _frames);
|
||||||
virtual void collidedWith(CThing *_thisThing) {;}
|
virtual void collidedWith(CThing *_thisThing) {;}
|
||||||
virtual void setHasPlatformCollided( bool newVal ) {;}
|
virtual void setHasPlatformCollided( bool newVal ) {;}
|
||||||
virtual bool getHasPlatformCollided() {return false;}
|
virtual bool getHasPlatformCollided() {return false;}
|
||||||
virtual s32 getNewYPos( CThing *_thisThing );
|
//virtual s32 getNewYPos( CThing *_thisThing );
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Thing states
|
// Thing states
|
||||||
|
@ -213,6 +214,7 @@ public:
|
||||||
bool canRender() {return (m_renderFlag);}
|
bool canRender() {return (m_renderFlag);}
|
||||||
DVECTOR &getRenderPos() {return(m_RenderPos);}
|
DVECTOR &getRenderPos() {return(m_RenderPos);}
|
||||||
bool canThink() {return (m_thinkFlag);}
|
bool canThink() {return (m_thinkFlag);}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool m_renderFlag,m_thinkFlag;
|
bool m_renderFlag,m_thinkFlag;
|
||||||
DVECTOR m_RenderPos;
|
DVECTOR m_RenderPos;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue