This commit is contained in:
parent
1e6fb59d99
commit
87042023f8
4 changed files with 26 additions and 29 deletions
|
@ -54,15 +54,14 @@
|
||||||
Vars
|
Vars
|
||||||
---- */
|
---- */
|
||||||
|
|
||||||
static int s_RenderBBoxX0=0;
|
static const int s_RenderBBoxX0=0;
|
||||||
static int s_RenderBBoxX1=512;
|
static const int s_RenderBBoxX1=512;
|
||||||
static int s_RenderBBoxY0=0;
|
static const int s_RenderBBoxY0=0;
|
||||||
static int s_RenderBBoxY1=256;
|
static const int s_RenderBBoxY1=256;
|
||||||
static int s_ThinkBBoxX0=0-256;
|
static const int s_ThinkBBoxX0=0-256;
|
||||||
static int s_ThinkBBoxX1=512+526;
|
static const int s_ThinkBBoxX1=512+526;
|
||||||
static int s_ThinkBBoxY0=0-128;
|
static const int s_ThinkBBoxY0=0-128;
|
||||||
static int s_ThinkBBoxY1=256+128;
|
static const int s_ThinkBBoxY1=256+128;
|
||||||
|
|
||||||
|
|
||||||
CThing *CThingManager::s_thingLists[CThing::MAX_TYPE];//={NULL,NULL};
|
CThing *CThingManager::s_thingLists[CThing::MAX_TYPE];//={NULL,NULL};
|
||||||
CThing *CThingManager::s_CollisionLists[CThing::MAX_TYPE];
|
CThing *CThingManager::s_CollisionLists[CThing::MAX_TYPE];
|
||||||
|
@ -204,12 +203,13 @@ DVECTOR const &CamPos=CLevel::getCameraPos();
|
||||||
bool Flag=true;
|
bool Flag=true;
|
||||||
// Will speed this up
|
// Will speed this up
|
||||||
|
|
||||||
|
if (!thing->alwaysThink())
|
||||||
|
{
|
||||||
if (ThingRect->x2<m_ThinkBBox.XMin || ThingRect->x1>m_ThinkBBox.XMax) Flag=false;
|
if (ThingRect->x2<m_ThinkBBox.XMin || ThingRect->x1>m_ThinkBBox.XMax) Flag=false;
|
||||||
if (ThingRect->y2<m_ThinkBBox.YMin || ThingRect->y1>m_ThinkBBox.YMax) Flag=false;
|
if (ThingRect->y2<m_ThinkBBox.YMin || ThingRect->y1>m_ThinkBBox.YMax) Flag=false;
|
||||||
|
}
|
||||||
thing->setThinkFlag(Flag);
|
thing->setThinkFlag(Flag);
|
||||||
|
|
||||||
if (thing->getThingType()==CThing::TYPE_PLAYER)
|
|
||||||
Flag=true;
|
|
||||||
if (Flag)
|
if (Flag)
|
||||||
{
|
{
|
||||||
thing->think(_frames);
|
thing->think(_frames);
|
||||||
|
|
|
@ -149,6 +149,7 @@ public:
|
||||||
public:
|
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);}
|
||||||
|
|
||||||
void ShowBBox();
|
void ShowBBox();
|
||||||
DVECTOR const &getCollisionCentre() {return m_collisionCentre;}
|
DVECTOR const &getCollisionCentre() {return m_collisionCentre;}
|
||||||
|
@ -205,6 +206,8 @@ class CPlayerThing : public CThing
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual TYPE getThingType() {return TYPE_PLAYER;}
|
virtual TYPE getThingType() {return TYPE_PLAYER;}
|
||||||
|
virtual bool alwaysThink() {return(true);}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class CPlayerProjectileThing : public CThing
|
class CPlayerProjectileThing : public CThing
|
||||||
|
|
|
@ -20,16 +20,7 @@
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
/*
|
||||||
const s16 c_circle[ NO_SIN ] =
|
|
||||||
{
|
|
||||||
0,25,49,74,97,120,142,162,181,197,212,225,236,244,251,254,
|
|
||||||
255,254,251,244,236,225,212,197,181,162,142,120,97,74,49,25,
|
|
||||||
0,-25,-49,-74,-97,-120,-142,-162,-181,-197,-212,-225,-236,-244,-251,-254,
|
|
||||||
-255,-254,-251,-244,-236,-225,-212,-197,-181,-162,-142,-120,-97,-74,-49,-25
|
|
||||||
};
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
const MATRIX IdentityMtx =
|
const MATRIX IdentityMtx =
|
||||||
{
|
{
|
||||||
{{ONE, 0, 0},
|
{{ONE, 0, 0},
|
||||||
|
@ -37,10 +28,10 @@ const MATRIX IdentityMtx =
|
||||||
{ 0, 0,ONE}},
|
{ 0, 0,ONE}},
|
||||||
{ 0, 0, 0},
|
{ 0, 0, 0},
|
||||||
};
|
};
|
||||||
|
*/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
const u32 NOTNEG = ((u32)1<<(u32)31) | ((u32)1<<(u32)15);
|
//const u32 NOTNEG = ((u32)1<<(u32)31) | ((u32)1<<(u32)15);
|
||||||
long s_randomSeed;
|
long s_randomSeed;
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -52,6 +43,7 @@ u8 *Ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
/*
|
||||||
void RotateBox(sBox *B,int W,int H,int _xScale,int _yScale,int _rot)
|
void RotateBox(sBox *B,int W,int H,int _xScale,int _yScale,int _rot)
|
||||||
{
|
{
|
||||||
int halfW,halfH;
|
int halfW,halfH;
|
||||||
|
@ -79,3 +71,4 @@ int aspect;
|
||||||
B->x3=+cw-sh; B->y3=+sw+ch;
|
B->x3=+cw-sh; B->y3=+sw+ch;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
*/
|
|
@ -18,10 +18,11 @@
|
||||||
#define SINMASK (NO_SIN - 1)
|
#define SINMASK (NO_SIN - 1)
|
||||||
#define COSPOS (NO_SIN / 4)
|
#define COSPOS (NO_SIN / 4)
|
||||||
|
|
||||||
extern const s16 c_circle[ NO_SIN ];
|
//extern const s16 c_circle[ NO_SIN ];
|
||||||
extern const MATRIX IdentityMtx;
|
//extern const MATRIX IdentityMtx;
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
/*
|
||||||
struct sBox
|
struct sBox
|
||||||
{
|
{
|
||||||
s16 x0,y0;
|
s16 x0,y0;
|
||||||
|
@ -29,10 +30,10 @@ struct sBox
|
||||||
s16 x2,y2;
|
s16 x2,y2;
|
||||||
s16 x3,y3;
|
s16 x3,y3;
|
||||||
};
|
};
|
||||||
|
*/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
u8 *MakePtr(void *BasePtr,int Offset);
|
u8 *MakePtr(void *BasePtr,int Offset);
|
||||||
void RotateBox(sBox *B,int W,int H,int _xScale,int _yScale,int _rot);
|
//void RotateBox(sBox *B,int W,int H,int _xScale,int _yScale,int _rot);
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*** Loads of inlines ********************************************************/
|
/*** Loads of inlines ********************************************************/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue