This commit is contained in:
parent
6f1def2d0a
commit
e59981cf94
18 changed files with 139 additions and 87 deletions
|
@ -142,6 +142,53 @@ int i,ListSize;
|
||||||
//***************************************************************************
|
//***************************************************************************
|
||||||
//***************************************************************************
|
//***************************************************************************
|
||||||
//***************************************************************************
|
//***************************************************************************
|
||||||
|
#if 1
|
||||||
|
void PakImage(sBmp &Image)
|
||||||
|
{
|
||||||
|
#ifdef _DEBUG
|
||||||
|
const char *ExeName="tools\\lznp";
|
||||||
|
#else
|
||||||
|
const char *ExeName="lznp.exe";
|
||||||
|
#endif
|
||||||
|
const char *TmpName="Actor.Tmp";
|
||||||
|
const char *PakName="Actor.Pak";
|
||||||
|
char CmdStr[256];
|
||||||
|
FILE *File;
|
||||||
|
|
||||||
|
// Write normal file to temp
|
||||||
|
File=fopen(TmpName,"wb");
|
||||||
|
if (!File) GObject::Error(ERR_FATAL,"Could not create temp file %s.",TmpName);
|
||||||
|
fwrite(Image.Psx,1,Image.PsxSize,File);
|
||||||
|
fclose(File);
|
||||||
|
|
||||||
|
// Pak File by calling LZNP.exe
|
||||||
|
sprintf(CmdStr, "%s %s %s >nul",ExeName,TmpName, PakName);
|
||||||
|
system(CmdStr);
|
||||||
|
|
||||||
|
// Read Pak File Back
|
||||||
|
remove(TmpName); // Delete Tmp File
|
||||||
|
File=fopen(PakName,"rb");
|
||||||
|
if (!File) GObject::Error(ERR_FATAL,"Could not open temp Pak file %s.",PakName);
|
||||||
|
fseek(File,0,SEEK_END);
|
||||||
|
Image.PakSize=ftell(File);
|
||||||
|
fseek(File,0,SEEK_SET);
|
||||||
|
Image.Pak=(u8*)malloc(Image.PakSize*2);
|
||||||
|
ASSERT(Image.Pak);
|
||||||
|
fread(Image.Pak,1,Image.PakSize,File);
|
||||||
|
fclose(File);
|
||||||
|
remove(PakName); // Delete Pak File
|
||||||
|
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
void PakImage(sBmp &Image)
|
||||||
|
{
|
||||||
|
Image.PakSize=PAK_findPakSize(Image.Psx,Image.PsxSize);
|
||||||
|
Image.Pak=(u8*)malloc(Image.PakSize);
|
||||||
|
ASSERT(Image.Pak);
|
||||||
|
PAK_doPak(Image.Pak,Image.Psx,Image.PsxSize);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
//***************************************************************************
|
||||||
CMkActor::CMkActor(GString &ActorName,GString &ActorPath,GString &SpritePath)
|
CMkActor::CMkActor(GString &ActorName,GString &ActorPath,GString &SpritePath)
|
||||||
{
|
{
|
||||||
Name=ActorName;
|
Name=ActorName;
|
||||||
|
@ -543,13 +590,14 @@ int i,ListSize=BmpList.size();
|
||||||
{
|
{
|
||||||
sBmp &ThisBmp=BmpList[i];
|
sBmp &ThisBmp=BmpList[i];
|
||||||
|
|
||||||
printf("%s - Processing Frame %2d\\%2d\r",Name,i+1,ListSize);
|
printf("%s - Processing Frame %2d\\%2d\t\t\t\r",Name,i+1,ListSize);
|
||||||
if (ThisBmp.Psx)
|
if (ThisBmp.Psx)
|
||||||
{
|
{
|
||||||
ThisBmp.PakSize=PAK_findPakSize(ThisBmp.Psx,ThisBmp.PsxSize);
|
PakImage(ThisBmp);
|
||||||
ThisBmp.Pak=(u8*)malloc(ThisBmp.PakSize);
|
// ThisBmp.PakSize=PAK_findPakSize(ThisBmp.Psx,ThisBmp.PsxSize);
|
||||||
ASSERT(ThisBmp.Pak);
|
// ThisBmp.Pak=(u8*)malloc(ThisBmp.PakSize);
|
||||||
PAK_doPak(ThisBmp.Pak,ThisBmp.Psx,ThisBmp.PsxSize);
|
// ASSERT(ThisBmp.Pak);
|
||||||
|
// PAK_doPak(ThisBmp.Pak,ThisBmp.Psx,ThisBmp.PsxSize);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // Blank Frame
|
{ // Blank Frame
|
||||||
|
|
|
@ -358,7 +358,7 @@ triggers_src := trigger \
|
||||||
|
|
||||||
utils_src := utils \
|
utils_src := utils \
|
||||||
sincos \
|
sincos \
|
||||||
pak
|
lznp
|
||||||
|
|
||||||
utils_src_mip := mathmip \
|
utils_src_mip := mathmip \
|
||||||
replace
|
replace
|
||||||
|
|
|
@ -34,6 +34,7 @@ int CFileIO::FilePosList[FILEPOS_MAX];
|
||||||
sFAT *CFileIO::MainFAT=0;
|
sFAT *CFileIO::MainFAT=0;
|
||||||
sASyncQueue CFileIO::ASyncQueue;
|
sASyncQueue CFileIO::ASyncQueue;
|
||||||
bool CFileIO::ASyncFlag;
|
bool CFileIO::ASyncFlag;
|
||||||
|
bool CFileIO::LogFlag;
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
sDataBank CFileIO::DataBank[DATABANK_MAX]=
|
sDataBank CFileIO::DataBank[DATABANK_MAX]=
|
||||||
|
@ -90,8 +91,13 @@ int FATSize=FileEquate_MAX*sizeof(sFAT);
|
||||||
// CurrentDataBank=DATABANK_MAX;
|
// CurrentDataBank=DATABANK_MAX;
|
||||||
ASyncQueue.Status=BLStatusOffline;
|
ASyncQueue.Status=BLStatusOffline;
|
||||||
ASyncFlag=false;
|
ASyncFlag=false;
|
||||||
|
LogFlag=false;
|
||||||
|
#if defined(__USER_daveo__)
|
||||||
|
LogFlag=true;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*** Open ********************************************************************/
|
/*** Open ********************************************************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -192,6 +198,11 @@ u8 * CFileIO::loadFile( FileEquate file, char *allocName )
|
||||||
|
|
||||||
Length = getFileSize( file );
|
Length = getFileSize( file );
|
||||||
|
|
||||||
|
if (LogFlag)
|
||||||
|
{
|
||||||
|
SYSTEM_DBGMSG("File: %i = %i",(int)file,Length);
|
||||||
|
}
|
||||||
|
|
||||||
buffer = (u8 *)MemAlloc( Length ,allocName);
|
buffer = (u8 *)MemAlloc( Length ,allocName);
|
||||||
ASSERT( buffer );
|
ASSERT( buffer );
|
||||||
#if defined(__CLIMAX_DEVKIT__)
|
#if defined(__CLIMAX_DEVKIT__)
|
||||||
|
|
|
@ -124,6 +124,7 @@ static void EnableASync(bool f) {ASyncFlag=f;}
|
||||||
static void AddASyncFile(FileEquate file,u8 *Dst);
|
static void AddASyncFile(FileEquate file,u8 *Dst);
|
||||||
static void LoadASyncFiles();
|
static void LoadASyncFiles();
|
||||||
|
|
||||||
|
static void setLogging(bool f) {LogFlag=f;}
|
||||||
private:
|
private:
|
||||||
static void CheckChunk();
|
static void CheckChunk();
|
||||||
|
|
||||||
|
@ -137,6 +138,7 @@ static DataBankEquate CurrentDataBank;
|
||||||
static sFAT *MainFAT;
|
static sFAT *MainFAT;
|
||||||
static sASyncQueue ASyncQueue;
|
static sASyncQueue ASyncQueue;
|
||||||
static bool ASyncFlag;
|
static bool ASyncFlag;
|
||||||
|
static bool LogFlag;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -99,24 +99,24 @@ 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(Flags & FX_FLAG_SCREEN_FX);}
|
bool alwaysThink() {return(Flags & FX_FLAG_SCREEN_FX);}
|
||||||
virtual void leftThinkZone(int _frames) {if (Flags & FX_FLAG_NO_THINK_KILL) killFX();}
|
void leftThinkZone(int _frames) {if (Flags & FX_FLAG_NO_THINK_KILL) killFX();}
|
||||||
|
|
||||||
virtual void init();
|
void init();
|
||||||
virtual void init(DVECTOR const &Pos);
|
virtual void init(DVECTOR const &Pos);
|
||||||
virtual void shutdown();
|
virtual void shutdown();
|
||||||
virtual void think(int _frames);
|
virtual void think(int _frames);
|
||||||
virtual void render();
|
virtual void render();
|
||||||
|
|
||||||
virtual int canCollide() {return(Flags & FX_FLAG_INJURE_PLAYER);}
|
int canCollide() {return(Flags & FX_FLAG_INJURE_PLAYER);}
|
||||||
virtual void SetOtPos(int Ot) {OtPos=Ot;}
|
void SetOtPos(int Ot) {OtPos=Ot;}
|
||||||
virtual void setLife(int L) {Life=L;}
|
void setLife(int L) {Life=L;}
|
||||||
|
|
||||||
virtual void getFXRenderPos(DVECTOR &Pos);
|
void getFXRenderPos(DVECTOR &Pos);
|
||||||
virtual bool getFXParentPos(DVECTOR &Pos);
|
bool getFXParentPos(DVECTOR &Pos);
|
||||||
|
|
||||||
virtual void killFX();
|
virtual void killFX();
|
||||||
virtual void toggleVisible() {Flags ^=FX_FLAG_HIDDEN;}
|
void toggleVisible() {Flags ^=FX_FLAG_HIDDEN;}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void collidedWith(CThing *_thisThing);
|
void collidedWith(CThing *_thisThing);
|
||||||
|
|
|
@ -23,10 +23,10 @@ virtual void render();
|
||||||
|
|
||||||
void setBaseData(void *Data);
|
void setBaseData(void *Data);
|
||||||
|
|
||||||
virtual void SetScale(int S) {CurrentScaleX=CurrentScaleY=S;}
|
/*virtual */void SetScale(int S) {CurrentScaleX=CurrentScaleY=S;}
|
||||||
virtual void SetScaleX(int S) {CurrentScaleX=S;}
|
/*virtual */void SetScaleX(int S) {CurrentScaleX=S;}
|
||||||
virtual void SetScaleY(int S) {CurrentScaleY=S;}
|
/*virtual */void SetScaleY(int S) {CurrentScaleY=S;}
|
||||||
virtual void SetHeading(int H) {CurrentHeading=H;}
|
/*virtual */void SetHeading(int H) {CurrentHeading=H;}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool HasInit;
|
bool HasInit;
|
||||||
|
|
|
@ -31,11 +31,11 @@ public:
|
||||||
LIST_SIZE = 16
|
LIST_SIZE = 16
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual void init(DVECTOR const &Pos);
|
/*virtual */void init(DVECTOR const &Pos);
|
||||||
virtual void think(int _frames);
|
/*virtual */void think(int _frames);
|
||||||
virtual void render();
|
/*virtual */void render();
|
||||||
|
|
||||||
virtual sList &moveHead();
|
/*virtual */sList &moveHead();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
sList List[LIST_SIZE];
|
sList List[LIST_SIZE];
|
||||||
|
|
|
@ -12,9 +12,9 @@ class CFXFallingTile : public CFX
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual void init(DVECTOR const &Pos);
|
/*virtual */void init(DVECTOR const &Pos);
|
||||||
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;}
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|
|
@ -12,9 +12,9 @@
|
||||||
class CFXGeyser : public CFX
|
class CFXGeyser : public CFX
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual void init(DVECTOR const &Pos);
|
/*virtual */void init(DVECTOR const &Pos);
|
||||||
virtual void think(int Frames);
|
/*virtual */void think(int Frames);
|
||||||
virtual void render();
|
/*virtual */void render();
|
||||||
|
|
||||||
void setHeight(int H) {TargetHeight=H;}
|
void setHeight(int H) {TargetHeight=H;}
|
||||||
|
|
||||||
|
|
|
@ -12,9 +12,9 @@ class CFXJellyFishLegs : public CFX
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual void init(DVECTOR const &Pos);
|
/*virtual */void init(DVECTOR const &Pos);
|
||||||
virtual void think(int _frames);
|
/*virtual */void think(int _frames);
|
||||||
virtual void render();
|
/*virtual */void render();
|
||||||
|
|
||||||
void Setup(int XOfs,int YOfs,bool XFlip);
|
void Setup(int XOfs,int YOfs,bool XFlip);
|
||||||
void setScale( s16 newScale ) {Scale = newScale;}
|
void setScale( s16 newScale ) {Scale = newScale;}
|
||||||
|
|
|
@ -14,8 +14,8 @@ public:
|
||||||
void init(DVECTOR const &Pos);
|
void init(DVECTOR const &Pos);
|
||||||
void think(int _frames);
|
void think(int _frames);
|
||||||
void render();
|
void render();
|
||||||
virtual int canCollide() {return true;}
|
/*virtual */int canCollide() {return true;}
|
||||||
virtual int checkCollisionAgainst(CThing *_thisThing, int _frames);
|
/*virtual */int checkCollisionAgainst(CThing *_thisThing, int _frames);
|
||||||
|
|
||||||
void setOffset(DVECTOR &Pos);
|
void setOffset(DVECTOR &Pos);
|
||||||
void setTarget(DVECTOR &Pos);
|
void setTarget(DVECTOR &Pos);
|
||||||
|
@ -23,7 +23,7 @@ virtual int checkCollisionAgainst(CThing *_thisThing, int _frames);
|
||||||
void setRGB(u8 r,u8 g,u8 b) {R=r; G=g; B=g;}
|
void setRGB(u8 r,u8 g,u8 b) {R=r; G=g; B=g;}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void collidedWith(CThing *_thisThing);
|
/*virtual */void collidedWith(CThing *_thisThing);
|
||||||
DVECTOR Offset,Target;
|
DVECTOR Offset,Target;
|
||||||
u8 R,G,B;
|
u8 R,G,B;
|
||||||
};
|
};
|
||||||
|
|
|
@ -12,9 +12,9 @@ class CFXNRGBar : public CFX
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual void init(DVECTOR const &Pos);
|
/*virtual*/ void init(DVECTOR const &Pos);
|
||||||
virtual void think(int _frames);
|
/*virtual*/ void think(int _frames);
|
||||||
virtual void render();
|
/*virtual*/ void render();
|
||||||
|
|
||||||
void SetMax(int Max) {MaxHealth=Max-1;}
|
void SetMax(int Max) {MaxHealth=Max-1;}
|
||||||
bool alwaysThink() {return(true);}
|
bool alwaysThink() {return(true);}
|
||||||
|
|
|
@ -12,8 +12,8 @@ class CFXSmoke : public CFX
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual void init(DVECTOR const &Pos);
|
/*virtual*/ void init(DVECTOR const &Pos);
|
||||||
virtual void think(int _frames);
|
/*virtual*/ void think(int _frames);
|
||||||
|
|
||||||
void setRate(int R) {Rate=R;}
|
void setRate(int R) {Rate=R;}
|
||||||
|
|
||||||
|
@ -26,9 +26,9 @@ class CFXSmokePuff : public CFX
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual void init(DVECTOR const &Pos);
|
/*virtual*/ void init(DVECTOR const &Pos);
|
||||||
virtual void think(int _frames);
|
/*virtual*/ void think(int _frames);
|
||||||
virtual void render();
|
/*virtual*/ void render();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
POLY_FT4 *Frame;
|
POLY_FT4 *Frame;
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
class CFXThwack : public CFX
|
class CFXThwack : public CFX
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual void init(DVECTOR const &Pos);
|
/*virtual*/ void init(DVECTOR const &Pos);
|
||||||
virtual void render();
|
/*virtual*/ void render();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
u16 Angle,Scale;
|
u16 Angle,Scale;
|
||||||
|
|
|
@ -9,7 +9,8 @@
|
||||||
#include "gfx\animtex.h"
|
#include "gfx\animtex.h"
|
||||||
#include "gfx\tpage.h"
|
#include "gfx\tpage.h"
|
||||||
#include "utils\utils.h"
|
#include "utils\utils.h"
|
||||||
#include "utils\pak.h"
|
//#include "utils\pak.h"
|
||||||
|
#include "utils\lznp.h"
|
||||||
|
|
||||||
#ifndef __SYSTEM_GSTATE_H__
|
#ifndef __SYSTEM_GSTATE_H__
|
||||||
#include "system\gstate.h"
|
#include "system\gstate.h"
|
||||||
|
@ -212,7 +213,9 @@ void CPakTex::DMAPakTex()
|
||||||
for (int i=0; i<PakTexCount; i++)
|
for (int i=0; i<PakTexCount; i++)
|
||||||
{
|
{
|
||||||
ASSERT(UnpackBuffer);
|
ASSERT(UnpackBuffer);
|
||||||
PAK_doUnpak(UnpackBuffer,PakTexList[i].PakSpr);
|
// PAK_doUnpak(UnpackBuffer,PakTexList[i].PakSpr);
|
||||||
|
// PAK_doUnpak(UnpackBuffer,PakTexList[i].PakSpr);
|
||||||
|
LZNP_Decode(PakTexList[i].PakSpr,UnpackBuffer);
|
||||||
LoadImage( PakTexList[i].DstRect, (u32*)UnpackBuffer);
|
LoadImage( PakTexList[i].DstRect, (u32*)UnpackBuffer);
|
||||||
}
|
}
|
||||||
PakTexCount=0;
|
PakTexCount=0;
|
||||||
|
|
|
@ -105,10 +105,7 @@ sBBox CThingManager::m_ThinkBBox;
|
||||||
|
|
||||||
#ifdef USE_FREE_LIST
|
#ifdef USE_FREE_LIST
|
||||||
CThing **CThingManager::s_FreeList[CThing::MAX_TYPE];
|
CThing **CThingManager::s_FreeList[CThing::MAX_TYPE];
|
||||||
CThing *DuffList;
|
|
||||||
int FreeListCount=0;
|
int FreeListCount=0;
|
||||||
int DuffListCount=0;
|
|
||||||
|
|
||||||
|
|
||||||
struct sFreeListTable
|
struct sFreeListTable
|
||||||
{
|
{
|
||||||
|
@ -436,7 +433,7 @@ DVECTOR const &CamPos=CLevel::getCameraPos();
|
||||||
case 0: // 0 0
|
case 0: // 0 0
|
||||||
break;
|
break;
|
||||||
case 1: // 0 1
|
case 1: // 0 1
|
||||||
thing->enterThinkZone(_frames);
|
// thing->enterThinkZone(_frames);
|
||||||
break;
|
break;
|
||||||
case 2: // 1 0
|
case 2: // 1 0
|
||||||
thing->leftThinkZone(_frames);
|
thing->leftThinkZone(_frames);
|
||||||
|
@ -896,7 +893,6 @@ void CThingManager::initFreeList()
|
||||||
s_FreeList[ThisType.Type]=List;
|
s_FreeList[ThisType.Type]=List;
|
||||||
|
|
||||||
}
|
}
|
||||||
DuffList=0;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -916,7 +912,7 @@ void CThingManager::resetFreeList()
|
||||||
while (ThisThing)
|
while (ThisThing)
|
||||||
{
|
{
|
||||||
CThing *Next=ThisThing->NextFreeThing;
|
CThing *Next=ThisThing->NextFreeThing;
|
||||||
ThisThing->destroy();
|
// ThisThing->destroy();
|
||||||
delete ThisThing;
|
delete ThisThing;
|
||||||
FreeListCount--;
|
FreeListCount--;
|
||||||
ThisThing=Next;
|
ThisThing=Next;
|
||||||
|
@ -924,14 +920,6 @@ void CThingManager::resetFreeList()
|
||||||
List[t]=0;
|
List[t]=0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CThing *Duff=DuffList;
|
|
||||||
while (Duff)
|
|
||||||
{
|
|
||||||
CThing *next=Duff->NextFreeThing;
|
|
||||||
delete Duff;
|
|
||||||
DuffListCount--;
|
|
||||||
Duff=next;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -981,7 +969,7 @@ CThing **List=s_FreeList[Type];
|
||||||
|
|
||||||
// Check its been aquired/set correctly
|
// Check its been aquired/set correctly
|
||||||
|
|
||||||
ASSERT(SubType!=1234);
|
ASSERT(SubType!=255);
|
||||||
|
|
||||||
Thing->NextFreeThing=List[SubType];
|
Thing->NextFreeThing=List[SubType];
|
||||||
List[SubType]=Thing;
|
List[SubType]=Thing;
|
||||||
|
|
|
@ -122,11 +122,11 @@ public:
|
||||||
CThing()
|
CThing()
|
||||||
{
|
{
|
||||||
initDef();
|
initDef();
|
||||||
m_SubType=1234;
|
m_SubType=255;
|
||||||
}
|
}
|
||||||
virtual ~CThing() {;}
|
virtual ~CThing() {;}
|
||||||
|
|
||||||
virtual void initDef()
|
/*virtual*/ void initDef()
|
||||||
{
|
{
|
||||||
Pos.vx=0; Pos.vy=0;
|
Pos.vx=0; Pos.vy=0;
|
||||||
PosDelta=Pos;
|
PosDelta=Pos;
|
||||||
|
@ -135,22 +135,22 @@ virtual void initDef()
|
||||||
NextFreeThing=0;
|
NextFreeThing=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual TYPE getThingType()=0;
|
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 create() {;} // Once only init (for mem alloc)
|
//virtual void create() {;} // Once only init (for mem alloc)
|
||||||
virtual void init(); // re-usable init
|
virtual void init(); // re-usable init
|
||||||
virtual void shutdown(); // re-usable shutdown
|
virtual void shutdown(); // re-usable shutdown
|
||||||
virtual void destroy() {;} // memory clean up when totally killing the poor things
|
//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;}
|
||||||
u8 isSetToShutdown() {return( m_isShuttingDown);}
|
u8 isSetToShutdown() {return( m_isShuttingDown);}
|
||||||
virtual int dontKillDuringLevelRespawn() {return false;}
|
virtual int dontKillDuringLevelRespawn() {return false;}
|
||||||
void calcRenderPos(DVECTOR const &Pos,DVECTOR &renderPos);
|
void calcRenderPos(DVECTOR const &Pos,DVECTOR &renderPos);
|
||||||
|
|
||||||
// Linkage
|
// Linkage
|
||||||
void addChild(CThing *Child);
|
void addChild(CThing *Child);
|
||||||
|
@ -173,7 +173,7 @@ protected:
|
||||||
|
|
||||||
// Parent Child Linkage
|
// Parent Child Linkage
|
||||||
CThing *ParentThing,*NextThing;
|
CThing *ParentThing,*NextThing;
|
||||||
int m_numChildren;
|
u8 m_numChildren;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Collision/List Link List
|
// Collision/List Link List
|
||||||
|
@ -189,13 +189,13 @@ 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 leftThinkZone(int _frames) {}
|
virtual void leftThinkZone(int _frames) {}
|
||||||
virtual void enterThinkZone(int _frames) {}
|
//virtual void enterThinkZone(int _frames) {}
|
||||||
|
|
||||||
void ShowBBox();
|
void ShowBBox();
|
||||||
DVECTOR const &getCollisionCentre() {return m_collisionCentre;}
|
DVECTOR const &getCollisionCentre() {return m_collisionCentre;}
|
||||||
DVECTOR const &getCollisionCentreOffset() {return m_collisionCentreOffset;}
|
DVECTOR const &getCollisionCentreOffset() {return m_collisionCentreOffset;}
|
||||||
int getCollisionRadius() {return m_collisionRadius;}
|
int getCollisionRadius() {return m_collisionRadius;}
|
||||||
virtual CRECT const &getCollisionArea() {return m_collisionArea;}
|
/*virtual */CRECT const &getCollisionArea() {return m_collisionArea;}
|
||||||
DVECTOR const &getCollisionSize() {return m_collisionSize;}
|
DVECTOR const &getCollisionSize() {return m_collisionSize;}
|
||||||
|
|
||||||
virtual int canCollide() {return true;}
|
virtual int canCollide() {return true;}
|
||||||
|
@ -215,20 +215,20 @@ public:
|
||||||
bool canThink() {return (m_thinkFlag);}
|
bool canThink() {return (m_thinkFlag);}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool m_renderFlag,m_thinkFlag;
|
|
||||||
DVECTOR m_RenderPos;
|
DVECTOR m_RenderPos;
|
||||||
bool m_isShuttingDown;
|
u8 m_renderFlag,m_thinkFlag;
|
||||||
int m_SubType;
|
u8 m_isShuttingDown;
|
||||||
|
u8 m_SubType;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void setCollisionSize(int _w,int _h);
|
/*virtual */void setCollisionSize(int _w,int _h);
|
||||||
virtual void setCollisionCentreOffset(int _x,int _y) {m_collisionCentreOffset.vx=_x;m_collisionCentreOffset.vy=_y;}
|
/*virtual */void setCollisionCentreOffset(int _x,int _y) {m_collisionCentreOffset.vx=_x;m_collisionCentreOffset.vy=_y;}
|
||||||
virtual void setCollisionCentreOffset(DVECTOR xy) {m_collisionCentreOffset=xy;}
|
/*virtual */void setCollisionCentreOffset(DVECTOR xy) {m_collisionCentreOffset=xy;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DVECTOR m_collisionSize;
|
DVECTOR m_collisionSize;
|
||||||
DVECTOR m_collisionCentreOffset;
|
DVECTOR m_collisionCentreOffset;
|
||||||
int m_collisionRadius;
|
s16 m_collisionRadius;
|
||||||
CRECT m_collisionArea;
|
CRECT m_collisionArea;
|
||||||
DVECTOR m_collisionCentre;
|
DVECTOR m_collisionCentre;
|
||||||
|
|
||||||
|
|
Binary file not shown.
Loading…
Add table
Reference in a new issue