diff --git a/source/thing/thing.cpp b/source/thing/thing.cpp index 1357f4dae..92b3399a0 100644 --- a/source/thing/thing.cpp +++ b/source/thing/thing.cpp @@ -200,12 +200,12 @@ DVECTOR const &CamPos=CLevel::getCameraPos(); while(thing) { // Check If in Thinkable range - CRECT const &ThingRect= thing->getCollisionArea(); + CRECT const *ThingRect= thing->getThinkBBox(); bool Flag=true; // Will speed this up - if (ThingRect.x2m_ThinkBBox.XMax) Flag=false; - if (ThingRect.y2m_ThinkBBox.YMax) Flag=false; + 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) @@ -622,7 +622,7 @@ int showthings=false; void CThing::render() { // Check Is Onscreen -CRECT const &ThingRect= getCollisionArea(); +CRECT const *ThingRect= getRenderBBox(); sBBox &ScrBBox=CThingManager::getRenderBBox(); DVECTOR const &CamPos=CLevel::getCameraPos(); @@ -631,8 +631,8 @@ DVECTOR const &CamPos=CLevel::getCameraPos(); // Will speed this up m_renderFlag=true; - if (ThingRect.x2ScrBBox.XMax) m_renderFlag=false; - if (ThingRect.y2ScrBBox.YMax) m_renderFlag=false; + if (ThingRect->x2x1>ScrBBox.XMax) m_renderFlag=false; + if (ThingRect->y2y1>ScrBBox.YMax) m_renderFlag=false; /***/ #ifdef SHOW_BBOX diff --git a/source/thing/thing.h b/source/thing/thing.h index b7d440bd5..d8c8f4f44 100644 --- a/source/thing/thing.h +++ b/source/thing/thing.h @@ -147,6 +147,9 @@ public: // -- Collision -- public: +virtual CRECT const *getRenderBBox() {return &m_collisionArea;} +virtual CRECT const *getThinkBBox() {return &m_collisionArea;} + void ShowBBox(); DVECTOR const &getCollisionCentre() {return m_collisionCentre;} DVECTOR const &getCollisionCentreOffset() {return m_collisionCentreOffset;}