This commit is contained in:
parent
9d6724287c
commit
85c6e48333
3 changed files with 16 additions and 5 deletions
|
@ -385,6 +385,7 @@ void CLevel::initLayers()
|
||||||
MapSize.vy=Layer->Height;
|
MapSize.vy=Layer->Height;
|
||||||
MapSize16.vx=Layer->Width*16;
|
MapSize16.vx=Layer->Width*16;
|
||||||
MapSize16.vy=Layer->Height*16;
|
MapSize16.vy=Layer->Height*16;
|
||||||
|
CThingManager::setMapWH(MapSize);
|
||||||
}
|
}
|
||||||
// Collision
|
// Collision
|
||||||
|
|
||||||
|
|
|
@ -102,6 +102,7 @@ CThing *CThingManager::s_CollisionLists[CThing::MAX_TYPE];
|
||||||
int CThingManager::s_initialised=false;
|
int CThingManager::s_initialised=false;
|
||||||
sBBox CThingManager::m_RenderBBox;
|
sBBox CThingManager::m_RenderBBox;
|
||||||
sBBox CThingManager::m_ThinkBBox;
|
sBBox CThingManager::m_ThinkBBox;
|
||||||
|
DVECTOR CThingManager::MapWH,CThingManager::MapWH16;
|
||||||
|
|
||||||
#ifdef USE_FREE_LIST
|
#ifdef USE_FREE_LIST
|
||||||
CThing **CThingManager::s_FreeList[CThing::MAX_TYPE];
|
CThing **CThingManager::s_FreeList[CThing::MAX_TYPE];
|
||||||
|
@ -143,6 +144,13 @@ void CThingManager::init()
|
||||||
s_initialised=true;
|
s_initialised=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/************************************************************************/
|
||||||
|
void CThingManager::setMapWH(DVECTOR const &WH)
|
||||||
|
{
|
||||||
|
MapWH=WH;
|
||||||
|
MapWH16.vx=MapWH.vx*16;
|
||||||
|
MapWH16.vy=MapWH.vy*16;
|
||||||
|
}
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
Function:
|
Function:
|
||||||
Purpose:
|
Purpose:
|
||||||
|
@ -440,8 +448,9 @@ DVECTOR const &CamPos=CLevel::getCameraPos();
|
||||||
m_ThinkBBox.XMax=s_ThinkBBoxX1+CamPos.vx;
|
m_ThinkBBox.XMax=s_ThinkBBoxX1+CamPos.vx;
|
||||||
m_ThinkBBox.YMin=s_ThinkBBoxY0+CamPos.vy;
|
m_ThinkBBox.YMin=s_ThinkBBoxY0+CamPos.vy;
|
||||||
m_ThinkBBox.YMax=s_ThinkBBoxY1+CamPos.vy;
|
m_ThinkBBox.YMax=s_ThinkBBoxY1+CamPos.vy;
|
||||||
CLevel &Lvl=GameScene.GetLevel();
|
|
||||||
DVECTOR const &MapSize=Lvl.getMapSize16();
|
//CLevel &Lvl=GameScene.GetLevel();
|
||||||
|
//DVECTOR const &MapSize=Lvl.getMapSize16();
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
CThing *thing;
|
CThing *thing;
|
||||||
|
@ -461,10 +470,10 @@ DVECTOR const &MapSize=Lvl.getMapSize16();
|
||||||
DVECTOR const &ThingPos=thing->getPos();
|
DVECTOR const &ThingPos=thing->getPos();
|
||||||
|
|
||||||
// Will speed this up - doubt it, not now!!
|
// Will speed this up - doubt it, not now!!
|
||||||
if (!thing->allowOffMap() && (ThingPos.vx<0 || ThingPos.vx>=MapSize.vx || ThingPos.vy<0 || ThingPos.vy>=MapSize.vy))
|
if (!thing->allowOffMap() && (ThingPos.vx<0 || ThingPos.vx>=MapWH16.vx || ThingPos.vy<0 || ThingPos.vy>=MapWH16.vy))
|
||||||
{
|
{
|
||||||
thing->setToShutdown();
|
thing->setToShutdown();
|
||||||
SYSTEM_DBGMSG("ThingOffMap: T:%i S:%i TXY%i %i, MWH%i %i\n",(int)thing->getThingType(),(int)thing->getThingSubType(),ThingPos.vx,ThingPos.vy,MapSize.vx,MapSize.vy);
|
SYSTEM_DBGMSG("ThingOffMap: T:%i S:%i TXY%i %i, MWH%i %i\n",(int)thing->getThingType(),(int)thing->getThingSubType(),ThingPos.vx,ThingPos.vy,MapWH16.vx,MapWH16.vy);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -69,6 +69,7 @@ static void shakePlatformLoose();
|
||||||
|
|
||||||
static sBBox &getRenderBBox() {return(m_RenderBBox);}
|
static sBBox &getRenderBBox() {return(m_RenderBBox);}
|
||||||
static sBBox &getThinkBBox() {return(m_ThinkBBox);}
|
static sBBox &getThinkBBox() {return(m_ThinkBBox);}
|
||||||
|
static void setMapWH(DVECTOR const &WH);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static void initList(CThing **List);
|
static void initList(CThing **List);
|
||||||
|
@ -76,7 +77,6 @@ static void addToThingList(CThing *_this);
|
||||||
static void removeFromThingList(CThing *_this);
|
static void removeFromThingList(CThing *_this);
|
||||||
|
|
||||||
static void addToCollisionList(CThing *_this);
|
static void addToCollisionList(CThing *_this);
|
||||||
|
|
||||||
friend class CThing;
|
friend class CThing;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -96,6 +96,7 @@ static void DeleteThing(CThing *Thing);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static CThing **s_FreeList[];
|
static CThing **s_FreeList[];
|
||||||
|
static DVECTOR MapWH,MapWH16;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue