This commit is contained in:
parent
1e47392e29
commit
58912c6f9e
2 changed files with 9 additions and 6 deletions
|
@ -200,12 +200,12 @@ DVECTOR const &CamPos=CLevel::getCameraPos();
|
||||||
while(thing)
|
while(thing)
|
||||||
{
|
{
|
||||||
// Check If in Thinkable range
|
// Check If in Thinkable range
|
||||||
CRECT const &ThingRect= thing->getCollisionArea();
|
CRECT const *ThingRect= thing->getThinkBBox();
|
||||||
bool Flag=true;
|
bool Flag=true;
|
||||||
// Will speed this up
|
// Will speed this up
|
||||||
|
|
||||||
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)
|
if (thing->getThingType()==CThing::TYPE_PLAYER)
|
||||||
|
@ -622,7 +622,7 @@ int showthings=false;
|
||||||
void CThing::render()
|
void CThing::render()
|
||||||
{
|
{
|
||||||
// Check Is Onscreen
|
// Check Is Onscreen
|
||||||
CRECT const &ThingRect= getCollisionArea();
|
CRECT const *ThingRect= getRenderBBox();
|
||||||
sBBox &ScrBBox=CThingManager::getRenderBBox();
|
sBBox &ScrBBox=CThingManager::getRenderBBox();
|
||||||
DVECTOR const &CamPos=CLevel::getCameraPos();
|
DVECTOR const &CamPos=CLevel::getCameraPos();
|
||||||
|
|
||||||
|
@ -631,8 +631,8 @@ DVECTOR const &CamPos=CLevel::getCameraPos();
|
||||||
|
|
||||||
// Will speed this up
|
// Will speed this up
|
||||||
m_renderFlag=true;
|
m_renderFlag=true;
|
||||||
if (ThingRect.x2<ScrBBox.XMin || ThingRect.x1>ScrBBox.XMax) m_renderFlag=false;
|
if (ThingRect->x2<ScrBBox.XMin || ThingRect->x1>ScrBBox.XMax) m_renderFlag=false;
|
||||||
if (ThingRect.y2<ScrBBox.YMin || ThingRect.y1>ScrBBox.YMax) m_renderFlag=false;
|
if (ThingRect->y2<ScrBBox.YMin || ThingRect->y1>ScrBBox.YMax) m_renderFlag=false;
|
||||||
|
|
||||||
/***/
|
/***/
|
||||||
#ifdef SHOW_BBOX
|
#ifdef SHOW_BBOX
|
||||||
|
|
|
@ -147,6 +147,9 @@ public:
|
||||||
|
|
||||||
// -- Collision --
|
// -- Collision --
|
||||||
public:
|
public:
|
||||||
|
virtual CRECT const *getRenderBBox() {return &m_collisionArea;}
|
||||||
|
virtual CRECT const *getThinkBBox() {return &m_collisionArea;}
|
||||||
|
|
||||||
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;}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue