diff --git a/source/thing/thing.cpp b/source/thing/thing.cpp index 92b3399a0..4ab6af071 100644 --- a/source/thing/thing.cpp +++ b/source/thing/thing.cpp @@ -54,15 +54,14 @@ Vars ---- */ -static int s_RenderBBoxX0=0; -static int s_RenderBBoxX1=512; -static int s_RenderBBoxY0=0; -static int s_RenderBBoxY1=256; -static int s_ThinkBBoxX0=0-256; -static int s_ThinkBBoxX1=512+526; -static int s_ThinkBBoxY0=0-128; -static int s_ThinkBBoxY1=256+128; - +static const int s_RenderBBoxX0=0; +static const int s_RenderBBoxX1=512; +static const int s_RenderBBoxY0=0; +static const int s_RenderBBoxY1=256; +static const int s_ThinkBBoxX0=0-256; +static const int s_ThinkBBoxX1=512+526; +static const int s_ThinkBBoxY0=0-128; +static const int s_ThinkBBoxY1=256+128; CThing *CThingManager::s_thingLists[CThing::MAX_TYPE];//={NULL,NULL}; CThing *CThingManager::s_CollisionLists[CThing::MAX_TYPE]; @@ -204,12 +203,13 @@ DVECTOR const &CamPos=CLevel::getCameraPos(); bool Flag=true; // Will speed this up - if (ThingRect->x2x1>m_ThinkBBox.XMax) Flag=false; - if (ThingRect->y2y1>m_ThinkBBox.YMax) Flag=false; + if (!thing->alwaysThink()) + { + if (ThingRect->x2x1>m_ThinkBBox.XMax) Flag=false; + if (ThingRect->y2y1>m_ThinkBBox.YMax) Flag=false; + } thing->setThinkFlag(Flag); - if (thing->getThingType()==CThing::TYPE_PLAYER) - Flag=true; if (Flag) { thing->think(_frames); diff --git a/source/thing/thing.h b/source/thing/thing.h index d8c8f4f44..79705e926 100644 --- a/source/thing/thing.h +++ b/source/thing/thing.h @@ -149,6 +149,7 @@ public: public: virtual CRECT const *getRenderBBox() {return &m_collisionArea;} virtual CRECT const *getThinkBBox() {return &m_collisionArea;} +virtual bool alwaysThink() {return(false);} void ShowBBox(); DVECTOR const &getCollisionCentre() {return m_collisionCentre;} @@ -205,6 +206,8 @@ class CPlayerThing : public CThing { public: virtual TYPE getThingType() {return TYPE_PLAYER;} +virtual bool alwaysThink() {return(true);} + }; class CPlayerProjectileThing : public CThing diff --git a/source/utils/utils.cpp b/source/utils/utils.cpp index cac52fd8b..bf64be36a 100644 --- a/source/utils/utils.cpp +++ b/source/utils/utils.cpp @@ -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 = { {{ONE, 0, 0}, @@ -37,10 +28,10 @@ const MATRIX IdentityMtx = { 0, 0,ONE}}, { 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; /*****************************************************************************/ @@ -52,6 +43,7 @@ u8 *Ret; } /*****************************************************************************/ +/* void RotateBox(sBox *B,int W,int H,int _xScale,int _yScale,int _rot) { int halfW,halfH; @@ -79,3 +71,4 @@ int aspect; B->x3=+cw-sh; B->y3=+sw+ch; } +*/ \ No newline at end of file diff --git a/source/utils/utils.h b/source/utils/utils.h index 96f484cd7..74ec40fae 100644 --- a/source/utils/utils.h +++ b/source/utils/utils.h @@ -18,10 +18,11 @@ #define SINMASK (NO_SIN - 1) #define COSPOS (NO_SIN / 4) -extern const s16 c_circle[ NO_SIN ]; -extern const MATRIX IdentityMtx; +//extern const s16 c_circle[ NO_SIN ]; +//extern const MATRIX IdentityMtx; /*****************************************************************************/ +/* struct sBox { s16 x0,y0; @@ -29,10 +30,10 @@ struct sBox s16 x2,y2; s16 x3,y3; }; - +*/ /*****************************************************************************/ 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 ********************************************************/