This commit is contained in:
Daveo 2001-08-15 16:12:20 +00:00
parent 9d6724287c
commit 85c6e48333
3 changed files with 16 additions and 5 deletions

View File

@ -385,6 +385,7 @@ void CLevel::initLayers()
MapSize.vy=Layer->Height;
MapSize16.vx=Layer->Width*16;
MapSize16.vy=Layer->Height*16;
CThingManager::setMapWH(MapSize);
}
// Collision

View File

@ -102,6 +102,7 @@ CThing *CThingManager::s_CollisionLists[CThing::MAX_TYPE];
int CThingManager::s_initialised=false;
sBBox CThingManager::m_RenderBBox;
sBBox CThingManager::m_ThinkBBox;
DVECTOR CThingManager::MapWH,CThingManager::MapWH16;
#ifdef USE_FREE_LIST
CThing **CThingManager::s_FreeList[CThing::MAX_TYPE];
@ -143,6 +144,13 @@ void CThingManager::init()
s_initialised=true;
}
/************************************************************************/
void CThingManager::setMapWH(DVECTOR const &WH)
{
MapWH=WH;
MapWH16.vx=MapWH.vx*16;
MapWH16.vy=MapWH.vy*16;
}
/*----------------------------------------------------------------------
Function:
Purpose:
@ -440,8 +448,9 @@ DVECTOR const &CamPos=CLevel::getCameraPos();
m_ThinkBBox.XMax=s_ThinkBBoxX1+CamPos.vx;
m_ThinkBBox.YMin=s_ThinkBBoxY0+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;
CThing *thing;
@ -461,10 +470,10 @@ DVECTOR const &MapSize=Lvl.getMapSize16();
DVECTOR const &ThingPos=thing->getPos();
// 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();
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
{

View File

@ -69,6 +69,7 @@ static void shakePlatformLoose();
static sBBox &getRenderBBox() {return(m_RenderBBox);}
static sBBox &getThinkBBox() {return(m_ThinkBBox);}
static void setMapWH(DVECTOR const &WH);
protected:
static void initList(CThing **List);
@ -76,7 +77,6 @@ static void addToThingList(CThing *_this);
static void removeFromThingList(CThing *_this);
static void addToCollisionList(CThing *_this);
friend class CThing;
private:
@ -96,6 +96,7 @@ static void DeleteThing(CThing *Thing);
private:
static CThing **s_FreeList[];
static DVECTOR MapWH,MapWH16;
};