This commit is contained in:
Daveo 2001-05-10 16:16:57 +00:00
parent 0b65d9d4a7
commit c110d56dc5
15 changed files with 403 additions and 536 deletions

View File

@ -240,30 +240,19 @@ void CNpcFriend::render()
{ {
CNpcThing::render(); CNpcThing::render();
// Render // Render
DVECTOR renderPos;
DVECTOR offset = CLevel::getCameraPos();
renderPos.vx = Pos.vx - offset.vx; if (canRender())
renderPos.vy = Pos.vy - offset.vy;
CRECT collisionRect = getCollisionArea();
collisionRect.x1 -= Pos.vx;
collisionRect.x2 -= Pos.vx;
collisionRect.y1 -= Pos.vy;
collisionRect.y2 -= Pos.vy;
if ( renderPos.vx + collisionRect.x2 >= 0 && renderPos.vx + collisionRect.x1 <= VidGetScrW() )
{ {
if ( renderPos.vy + collisionRect.y2 >= 0 && renderPos.vy + collisionRect.y1 <= VidGetScrH() ) DVECTOR &renderPos=getRenderPos();
{
m_actorGfx->Render(renderPos,m_animNo,(m_frame>>8),m_reversed);
sBBox boundingBox = m_actorGfx->GetBBox(); m_actorGfx->Render(renderPos,m_animNo,(m_frame>>8),m_reversed);
setCollisionSize( ( boundingBox.XMax - boundingBox.XMin ), ( boundingBox.YMax - boundingBox.YMin ) );
setCollisionCentreOffset( ( boundingBox.XMax + boundingBox.XMin ) >> 1, ( boundingBox.YMax + boundingBox.YMin ) >> 1 ); sBBox boundingBox = m_actorGfx->GetBBox();
} setCollisionSize( ( boundingBox.XMax - boundingBox.XMin ), ( boundingBox.YMax - boundingBox.YMin ) );
setCollisionCentreOffset( ( boundingBox.XMax + boundingBox.XMin ) >> 1, ( boundingBox.YMax + boundingBox.YMin ) >> 1 );
} }
} }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -119,7 +119,7 @@ s16 *dH=HeightTable;
_MapOfs.vx+=LX; _MapOfs.vx+=LX;
_MapOfs.vy+=LY; _MapOfs.vy+=LY;
if (!Parent->getOnScreenFlag()) return; if (!Parent->canRender()) return;
MapOfs.vx=_MapOfs.vx+XOfs; MapOfs.vx=_MapOfs.vx+XOfs;
for (int L=0; L<Width; L++) for (int L=0; L<Width; L++)

View File

@ -26,36 +26,36 @@ class CLevel
public: public:
CLevel(); CLevel();
// Scene Handlers // Scene Handlers
void init(int LevelNo); void init(int LevelNo);
void shutdown(); void shutdown();
void render(); void render();
void think(int _frames); void think(int _frames);
void setCameraCentre(DVECTOR _pos) {MapPos=_pos;} void setCameraCentre(DVECTOR _pos) {MapPos=_pos;}
static DVECTOR getCameraPos() {return MapPos;} static DVECTOR const &getCameraPos() {return MapPos;}
static DVECTOR getPlayerSpawnPos() {return s_playerSpawnPos;} static DVECTOR const &getPlayerSpawnPos() {return s_playerSpawnPos;}
static int getCurrentChapter(); static int getCurrentChapter();
static int getCurrentChapterLevel(); static int getCurrentChapterLevel();
int getActorCount() {return ActorCount;} int getActorCount() {return ActorCount;}
sThingActor **getActorList() {return ActorList;} sThingActor **getActorList() {return ActorList;}
int getPlatformCount() {return PlatformCount;} int getPlatformCount() {return PlatformCount;}
sThingPlatform **getPlatformList() {return PlatformList;} sThingPlatform **getPlatformList() {return PlatformList;}
int getHazardCount() {return HazardCount;} int getHazardCount() {return HazardCount;}
sThingHazard **getHazardList() {return HazardList;} sThingHazard **getHazardList() {return HazardList;}
CLayerCollision *getCollisionLayer() {return CollisionLayer;} CLayerCollision *getCollisionLayer() {return CollisionLayer;}
DVECTOR getMapSize(); DVECTOR getMapSize();
bool GetNextLevel(int &Lvl); bool GetNextLevel(int &Lvl);
void respawnLevel(); void respawnLevel();
static u8 getIsBossRespawn() {return m_isBossRespawn;} static u8 getIsBossRespawn() {return m_isBossRespawn;}
static s32 getBossHealth() {return m_bossHealth;} static s32 getBossHealth() {return m_bossHealth;}
static void setIsBossRespawn( u8 newIsBossRespawn ) {m_isBossRespawn=newIsBossRespawn;} static void setIsBossRespawn( u8 newIsBossRespawn ) {m_isBossRespawn=newIsBossRespawn;}
static void setBossHealth( s32 newBossHealth ) {m_bossHealth=newBossHealth;} static void setBossHealth( s32 newBossHealth ) {m_bossHealth=newBossHealth;}
private: private:

View File

@ -230,47 +230,33 @@ void CNpcBranchPlatform::render()
{ {
CPlatformThing::render(); CPlatformThing::render();
// Render if (canRender())
DVECTOR renderPos;
DVECTOR offset = CLevel::getCameraPos();
renderPos.vx = Pos.vx - offset.vx ;
renderPos.vy = Pos.vy - offset.vy ;
CRECT collisionRect = getCollisionArea();
collisionRect.x1 -= Pos.vx;
collisionRect.x2 -= Pos.vx;
collisionRect.y1 -= Pos.vy;
collisionRect.y2 -= Pos.vy;
if ( renderPos.vx + collisionRect.x2 >= 0 && renderPos.vx + collisionRect.x1 <= VidGetScrW() )
{ {
if ( renderPos.vy + collisionRect.y2 >= 0 && renderPos.vy + collisionRect.y1 <= VidGetScrH() ) DVECTOR &renderPos=getRenderPos();
SVECTOR rotation;
rotation.vx = 0;
if ( m_reversed )
{ {
SVECTOR rotation; rotation.vy = 0;
rotation.vx = 0; rotation.vz = getCollisionAngle();
if ( m_reversed ) renderPos.vx-= BX;
{ renderPos.vy+= BY;
rotation.vy = 0; }
rotation.vz = getCollisionAngle(); else
renderPos.vx-= BX; {
renderPos.vy+= BY; rotation.vy = 0;
} rotation.vz = getCollisionAngle();
else renderPos.vx+= BX;
{ renderPos.vy+= BY;
rotation.vy = 0; }
rotation.vz = getCollisionAngle();
renderPos.vx+= BX;
renderPos.vy+= BY;
}
VECTOR scale; VECTOR scale;
scale.vx = ONE; scale.vx = ONE;
scale.vy = ONE; scale.vy = ONE;
scale.vz = ONE; scale.vz = ONE;
m_modelGfx->Render(renderPos,&rotation,&scale);
m_modelGfx->Render(renderPos,&rotation,&scale);
#if defined (__USER_paul__) || defined (__USER_charles__) #if defined (__USER_paul__) || defined (__USER_charles__)
DVECTOR size; DVECTOR size;
DVECTOR centre; DVECTOR centre;
@ -306,7 +292,7 @@ void CNpcBranchPlatform::render()
DrawLine(x1,y1,x2,y2,0,255,0,0); DrawLine(x1,y1,x2,y2,0,255,0,0);
#endif #endif
}
} }
} }
} }

View File

@ -150,34 +150,21 @@ void CNpcCartPlatform::render()
{ {
CPlatformThing::render(); CPlatformThing::render();
// Render if (canRender())
DVECTOR renderPos;
DVECTOR offset = CLevel::getCameraPos();
renderPos.vx = Pos.vx - offset.vx ;
renderPos.vy = Pos.vy - offset.vy ;
CRECT collisionRect = getCollisionArea();
collisionRect.x1 -= Pos.vx;
collisionRect.x2 -= Pos.vx;
collisionRect.y1 -= Pos.vy;
collisionRect.y2 -= Pos.vy;
if ( renderPos.vx + collisionRect.x2 >= 0 && renderPos.vx + collisionRect.x1 <= VidGetScrW() )
{ {
if ( renderPos.vy + collisionRect.y2 >= 0 && renderPos.vy + collisionRect.y1 <= VidGetScrH() ) DVECTOR &renderPos=getRenderPos();
{ SVECTOR rotation;
SVECTOR rotation;
rotation.vx = 0;
rotation.vy = 0;
rotation.vz = getCollisionAngle();
VECTOR scale; rotation.vx = 0;
scale.vx = ONE; rotation.vy = 0;
scale.vy = ONE; rotation.vz = getCollisionAngle();
scale.vz = ONE;
m_modelGfx->Render(renderPos,&rotation,&scale); VECTOR scale;
scale.vx = ONE;
scale.vy = ONE;
scale.vz = ONE;
m_modelGfx->Render(renderPos,&rotation,&scale);
#if defined (__USER_paul__) || defined (__USER_charles__) #if defined (__USER_paul__) || defined (__USER_charles__)
DVECTOR size; DVECTOR size;
@ -203,7 +190,7 @@ void CNpcCartPlatform::render()
DrawLine(x1,y1,x2,y2,0,255,0,0); DrawLine(x1,y1,x2,y2,0,255,0,0);
#endif #endif
}
} }
} }
} }

View File

@ -205,34 +205,15 @@ void CNpcDualPlatform::render()
{ {
int x1,y1,x2,y2; int x1,y1,x2,y2;
setOnScreenFlag(false);
if ( m_isActive ) if ( m_isActive )
{ {
CPlatformThing::render(); CPlatformThing::render();
// Render if (canRender())
DVECTOR renderPos;
DVECTOR offset = CLevel::getCameraPos();
renderPos.vx = Pos.vx - offset.vx;
renderPos.vy = Pos.vy - offset.vy;
CRECT collisionRect = getCollisionArea();
collisionRect.x1 -= Pos.vx;
collisionRect.x2 -= Pos.vx;
collisionRect.y1 -= Pos.vy;
collisionRect.y2 -= Pos.vy;
if ( renderPos.vx + collisionRect.x2 >= 0 && renderPos.vx + collisionRect.x1 <= VidGetScrW() )
{ {
if ( renderPos.vy + collisionRect.y2 >= 0 && renderPos.vy + collisionRect.y1 <= VidGetScrH() ) DVECTOR &renderPos=getRenderPos();
{
setOnScreenFlag(true); m_modelGfx->Render(renderPos);
m_modelGfx->Render(renderPos);
// POLY_F4 *F4=GetPrimF4();
// setXYWH(F4,renderPos.vx-32,renderPos.vy-32,64,16);
// setRGB0(F4,127,127,64);
// AddPrimToList(F4,2);
#if defined (__USER_paul__) || defined (__USER_charles__) #if defined (__USER_paul__) || defined (__USER_charles__)
DVECTOR size; DVECTOR size;
@ -257,9 +238,7 @@ void CNpcDualPlatform::render()
DrawLine(x1,y1,x2,y2,0,255,0,0); DrawLine(x1,y1,x2,y2,0,255,0,0);
#endif #endif
} /*
}
x1 = Pos.vx - offset.vx; x1 = Pos.vx - offset.vx;
x2 = m_lineBase.vx - offset.vx; x2 = m_lineBase.vx - offset.vx;
@ -339,6 +318,7 @@ void CNpcDualPlatform::render()
DrawLine( x1, y1, x2, y2, 0, 0, 0, 0 ); DrawLine( x1, y1, x2, y2, 0, 0, 0, 0 );
} }
} }
*/
} }
} }
} }

View File

@ -77,34 +77,14 @@ void CNpcFishHookPlatform::render()
{ {
int x1,y1,x2,y2; int x1,y1,x2,y2;
setOnScreenFlag(false);
if ( m_isActive ) if ( m_isActive )
{ {
CPlatformThing::render(); CPlatformThing::render();
// Render DVECTOR &renderPos=getRenderPos();
DVECTOR renderPos; if (canRender())
DVECTOR offset = CLevel::getCameraPos();
renderPos.vx = Pos.vx - offset.vx;
renderPos.vy = Pos.vy - offset.vy;
CRECT collisionRect = getCollisionArea();
collisionRect.x1 -= Pos.vx;
collisionRect.x2 -= Pos.vx;
collisionRect.y1 -= Pos.vy;
collisionRect.y2 -= Pos.vy;
if ( renderPos.vx + collisionRect.x2 >= 0 && renderPos.vx + collisionRect.x1 <= VidGetScrW() )
{ {
if ( renderPos.vy + collisionRect.y2 >= 0 && renderPos.vy + collisionRect.y1 <= VidGetScrH() ) m_modelGfx->Render(renderPos);
{
setOnScreenFlag(true);
m_modelGfx->Render(renderPos);
// POLY_F4 *F4=GetPrimF4();
// setXYWH(F4,renderPos.vx-32,renderPos.vy-32,64,16);
// setRGB0(F4,127,127,64);
// AddPrimToList(F4,2);
#if defined (__USER_paul__) || defined (__USER_charles__) #if defined (__USER_paul__) || defined (__USER_charles__)
DVECTOR size; DVECTOR size;
@ -129,45 +109,45 @@ void CNpcFishHookPlatform::render()
DrawLine(x1,y1,x2,y2,0,255,0,0); DrawLine(x1,y1,x2,y2,0,255,0,0);
#endif #endif
}
} }
// draw Line (Literally!!)
x1 = Pos.vx - offset.vx; if (renderPos.vx>0 && renderPos.vx<512)
x2 = m_lineBase.vx - offset.vx;
if ( x1 > x2 )
{ {
int tempX = x1; DVECTOR const &CamPos=CLevel::getCameraPos();
x1 = x2;
x2 = tempX;
}
y1 = Pos.vy - offset.vy;
y2 = m_lineBase.vy - offset.vy;
if ( y1 > y2 )
{
int tempY = y1;
y1 = y2;
y2 = tempY;
}
if ( y1 < 0 )
{
y1 = 0;
}
if ( y2 > VidGetScrH() ) x1 = renderPos.vx;
{ x2 = m_lineBase.vx - CamPos.vx;
y2 = VidGetScrH();
}
if ( x2 >= 0 && x1 <= VidGetScrW() ) if ( x1 > x2 )
{
if ( y2 >= 0 && y1 <= VidGetScrH() )
{ {
DrawLine( x1, y1, x2, y2, 0, 0, 0, 0 ); int tempX = x1;
x1 = x2;
x2 = tempX;
} }
y1 = renderPos.vy;
y2 = m_lineBase.vy - CamPos.vy;
if ( y1 > y2 )
{
int tempY = y1;
y1 = y2;
y2 = tempY;
}
if ( y1 < 0 )
{
y1 = 0;
}
if ( y2 > VidGetScrH() )
{
y2 = VidGetScrH();
}
DrawLine( x1, y1, x2, y2, 0, 0, 0, 0 );
} }
} }
} }

View File

@ -30,60 +30,3 @@
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcJellyfishPlatform::render()
{
if ( m_isActive )
{
CPlatformThing::render();
// Render
DVECTOR renderPos;
DVECTOR offset = CLevel::getCameraPos();
renderPos.vx = Pos.vx - offset.vx;
renderPos.vy = Pos.vy - offset.vy;
CRECT collisionRect = getCollisionArea();
collisionRect.x1 -= Pos.vx;
collisionRect.x2 -= Pos.vx;
collisionRect.y1 -= Pos.vy;
collisionRect.y2 -= Pos.vy;
if ( renderPos.vx + collisionRect.x2 >= 0 && renderPos.vx + collisionRect.x1 <= VidGetScrW() )
{
if ( renderPos.vy + collisionRect.y2 >= 0 && renderPos.vy + collisionRect.y1 <= VidGetScrH() )
{
m_modelGfx->Render(renderPos);
// POLY_F4 *F4=GetPrimF4();
// setXYWH(F4,renderPos.vx-32,renderPos.vy-32,64,16);
// setRGB0(F4,127,127,64);
// AddPrimToList(F4,2);
#if defined (__USER_paul__) || defined (__USER_charles__)
DVECTOR size;
DVECTOR centre;
int halfLength;
int x1,y1,x2,y2;
centre=getCollisionCentre();
size=getCollisionSize();
halfLength=size.vx>>1;
x1=-halfLength*mcos(getCollisionAngle()&4095)>>12;
y1=-halfLength*msin(getCollisionAngle()&4095)>>12;
x2=+halfLength*mcos(getCollisionAngle()&4095)>>12;
y2=+halfLength*msin(getCollisionAngle()&4095)>>12;
centre.vx-=offset.vx;
centre.vy-=offset.vy;
x1+=centre.vx;
y1+=centre.vy;
x2+=centre.vx;
y2+=centre.vy;
DrawLine(x1,y1,x2,y2,0,255,0,0);
#endif
}
}
}
}

View File

@ -21,7 +21,7 @@
class CNpcJellyfishPlatform : public CNpcPlatform class CNpcJellyfishPlatform : public CNpcPlatform
{ {
public: public:
virtual void render();
}; };
#endif #endif

View File

@ -884,34 +884,17 @@ void CNpcPlatform::processMovement( int _frames )
void CNpcPlatform::render() void CNpcPlatform::render()
{ {
setOnScreenFlag(false);
if ( m_isActive ) if ( m_isActive )
{ {
CPlatformThing::render(); CPlatformThing::render();
// Render // Render
DVECTOR renderPos; if (canRender())
DVECTOR offset = CLevel::getCameraPos();
renderPos.vx = Pos.vx - offset.vx;
renderPos.vy = Pos.vy - offset.vy;
CRECT collisionRect = getCollisionArea();
collisionRect.x1 -= Pos.vx;
collisionRect.x2 -= Pos.vx;
collisionRect.y1 -= Pos.vy;
collisionRect.y2 -= Pos.vy;
if ( renderPos.vx + collisionRect.x2 >= 0 && renderPos.vx + collisionRect.x1 <= VidGetScrW() )
{ {
if ( renderPos.vy + collisionRect.y2 >= 0 && renderPos.vy + collisionRect.y1 <= VidGetScrH() ) DVECTOR &renderPos=getRenderPos();
{
setOnScreenFlag(true); m_modelGfx->Render(renderPos);
m_modelGfx->Render(renderPos); }
// POLY_F4 *F4=GetPrimF4();
// setXYWH(F4,renderPos.vx-32,renderPos.vy-32,64,16);
// setRGB0(F4,127,127,64);
// AddPrimToList(F4,2);
#if defined (__USER_paul__) || defined (__USER_charles__) #if defined (__USER_paul__) || defined (__USER_charles__)
DVECTOR size; DVECTOR size;
@ -937,8 +920,6 @@ void CNpcPlatform::render()
DrawLine(x1,y1,x2,y2,0,255,0,0); DrawLine(x1,y1,x2,y2,0,255,0,0);
#endif #endif
}
}
} }
} }

View File

@ -126,34 +126,15 @@ void CNpcPendulumPlatform::render()
int x1,y1,x2,y2; int x1,y1,x2,y2;
int x1Boundary,y1Boundary,x2Boundary,y2Boundary; int x1Boundary,y1Boundary,x2Boundary,y2Boundary;
setOnScreenFlag(false);
if ( m_isActive ) if ( m_isActive )
{ {
CPlatformThing::render(); CPlatformThing::render();
// Render if (canRender())
DVECTOR renderPos;
DVECTOR offset = CLevel::getCameraPos();
renderPos.vx = Pos.vx - offset.vx;
renderPos.vy = Pos.vy - offset.vy;
CRECT collisionRect = getCollisionArea();
collisionRect.x1 -= Pos.vx;
collisionRect.x2 -= Pos.vx;
collisionRect.y1 -= Pos.vy;
collisionRect.y2 -= Pos.vy;
if ( renderPos.vx + collisionRect.x2 >= 0 && renderPos.vx + collisionRect.x1 <= VidGetScrW() )
{ {
if ( renderPos.vy + collisionRect.y2 >= 0 && renderPos.vy + collisionRect.y1 <= VidGetScrH() ) DVECTOR &renderPos=getRenderPos();
{
setOnScreenFlag(true); m_modelGfx->Render(renderPos);
m_modelGfx->Render(renderPos);
// POLY_F4 *F4=GetPrimF4();
// setXYWH(F4,renderPos.vx-32,renderPos.vy-32,64,16);
// setRGB0(F4,127,127,64);
// AddPrimToList(F4,2);
#if defined (__USER_paul__) || defined (__USER_charles__) #if defined (__USER_paul__) || defined (__USER_charles__)
DVECTOR size; DVECTOR size;
@ -178,53 +159,53 @@ void CNpcPendulumPlatform::render()
DrawLine(x1,y1,x2,y2,0,255,0,0); DrawLine(x1,y1,x2,y2,0,255,0,0);
#endif #endif
} /*
} x1 = x1Boundary = Pos.vx - offset.vx;
x2 = x2Boundary = m_lineBase.vx - offset.vx;
x1 = x1Boundary = Pos.vx - offset.vx; y1 = y1Boundary = Pos.vy - offset.vy;
x2 = x2Boundary = m_lineBase.vx - offset.vx; y2 = y2Boundary = m_lineBase.vy - offset.vy;
y1 = y1Boundary = Pos.vy - offset.vy; int angle = ratan2( x1 - x2, y1 - y2 );
y2 = y2Boundary = m_lineBase.vy - offset.vy;
int angle = ratan2( x1 - x2, y1 - y2 ); if ( y2 < 0 )
if ( y2 < 0 )
{
int yDiff = -y2;
y2 = y2Boundary = 0;
int hyp = ( yDiff << 12 ) / rcos( angle );
x2 += ( hyp * rsin( angle ) ) >> 12;
}
if ( y1 > VidGetScrH() )
{
int yDiff = y1 - VidGetScrH();
y1 = y1Boundary = VidGetScrH();
int hyp = ( yDiff << 12 ) / rcos( angle );
x1 -= ( hyp * rsin( angle ) ) >> 12;
}
if ( x1Boundary > x2Boundary )
{
int tempX = x1Boundary;
x1Boundary = x2Boundary;
x2Boundary = tempX;
}
if ( y1Boundary > y2Boundary )
{
int tempY = y1Boundary;
y1Boundary = y2Boundary;
y2Boundary = tempY;
}
if ( x2Boundary >= 0 && x1Boundary <= VidGetScrW() )
{
if ( y2Boundary >= 0 && y1Boundary <= VidGetScrH() )
{ {
DrawLine( x1, y1, x2, y2, 0, 0, 0, 0 ); int yDiff = -y2;
y2 = y2Boundary = 0;
int hyp = ( yDiff << 12 ) / rcos( angle );
x2 += ( hyp * rsin( angle ) ) >> 12;
} }
if ( y1 > VidGetScrH() )
{
int yDiff = y1 - VidGetScrH();
y1 = y1Boundary = VidGetScrH();
int hyp = ( yDiff << 12 ) / rcos( angle );
x1 -= ( hyp * rsin( angle ) ) >> 12;
}
if ( x1Boundary > x2Boundary )
{
int tempX = x1Boundary;
x1Boundary = x2Boundary;
x2Boundary = tempX;
}
if ( y1Boundary > y2Boundary )
{
int tempY = y1Boundary;
y1Boundary = y2Boundary;
y2Boundary = tempY;
}
if ( x2Boundary >= 0 && x1Boundary <= VidGetScrW() )
{
if ( y2Boundary >= 0 && y1Boundary <= VidGetScrH() )
{
DrawLine( x1, y1, x2, y2, 0, 0, 0, 0 );
}
}
*/
} }
} }
} }

View File

@ -107,33 +107,23 @@ void CNpcRetractingPlatform::render()
CPlatformThing::render(); CPlatformThing::render();
// Render // Render
DVECTOR renderPos; CPlatformThing::render();
DVECTOR offset = CLevel::getCameraPos();
renderPos.vx = Pos.vx - offset.vx ; if (canRender())
renderPos.vy = Pos.vy - offset.vy ;
CRECT collisionRect = getCollisionArea();
collisionRect.x1 -= Pos.vx;
collisionRect.x2 -= Pos.vx;
collisionRect.y1 -= Pos.vy;
collisionRect.y2 -= Pos.vy;
if ( renderPos.vx + collisionRect.x2 >= 0 && renderPos.vx + collisionRect.x1 <= VidGetScrW() )
{ {
if ( renderPos.vy + collisionRect.y2 >= 0 && renderPos.vy + collisionRect.y1 <= VidGetScrH() ) DVECTOR &renderPos=getRenderPos();
{ SVECTOR rotation;
SVECTOR rotation;
rotation.vx = 0;
rotation.vy = 0;
rotation.vz = 0;
VECTOR scale; rotation.vx = 0;
scale.vx = ONE; rotation.vy = 0;
scale.vy = ONE; rotation.vz = 0;
scale.vz = m_extension;
m_modelGfx->Render(renderPos,&rotation,&scale); VECTOR scale;
scale.vx = ONE;
scale.vy = ONE;
scale.vz = m_extension;
m_modelGfx->Render(renderPos,&rotation,&scale);
#if defined (__USER_paul__) || defined (__USER_charles__) #if defined (__USER_paul__) || defined (__USER_charles__)
DVECTOR size; DVECTOR size;
@ -159,7 +149,6 @@ void CNpcRetractingPlatform::render()
DrawLine(x1,y1,x2,y2,0,255,0,0); DrawLine(x1,y1,x2,y2,0,255,0,0);
#endif #endif
}
} }
} }
} }

View File

@ -117,34 +117,21 @@ void CNpcSeesawPlatform::render()
{ {
CPlatformThing::render(); CPlatformThing::render();
// Render if (canRender())
DVECTOR renderPos;
DVECTOR offset = CLevel::getCameraPos();
renderPos.vx = Pos.vx - offset.vx;
renderPos.vy = Pos.vy - offset.vy;
CRECT collisionRect = getCollisionArea();
collisionRect.x1 -= Pos.vx;
collisionRect.x2 -= Pos.vx;
collisionRect.y1 -= Pos.vy;
collisionRect.y2 -= Pos.vy;
if ( renderPos.vx + collisionRect.x2 >= 0 && renderPos.vx + collisionRect.x1 <= VidGetScrW() )
{ {
if ( renderPos.vy + collisionRect.y2 >= 0 && renderPos.vy + collisionRect.y1 <= VidGetScrH() ) DVECTOR &renderPos=getRenderPos();
{ SVECTOR rotation;
SVECTOR rotation;
rotation.vx = 0;
rotation.vy = 0;
rotation.vz = getCollisionAngle();
VECTOR scale; rotation.vx = 0;
scale.vx = ONE; rotation.vy = 0;
scale.vy = ONE; rotation.vz = getCollisionAngle();
scale.vz = ONE;
m_modelGfx->Render(renderPos,&rotation,&scale); VECTOR scale;
scale.vx = ONE;
scale.vy = ONE;
scale.vz = ONE;
m_modelGfx->Render(renderPos,&rotation,&scale);
#if defined (__USER_paul__) || defined (__USER_charles__) #if defined (__USER_paul__) || defined (__USER_charles__)
DVECTOR size; DVECTOR size;
@ -170,7 +157,6 @@ void CNpcSeesawPlatform::render()
DrawLine(x1,y1,x2,y2,0,255,0,0); DrawLine(x1,y1,x2,y2,0,255,0,0);
#endif #endif
}
} }
} }
} }

View File

@ -29,6 +29,8 @@
#include "utils\utils.h" #include "utils\utils.h"
#endif #endif
#include "level\level.h"
/* Std Lib /* Std Lib
------- */ ------- */
@ -52,9 +54,13 @@
Vars Vars
---- */ ---- */
CThing *CThingManager::s_thingLists[CThing::MAX_TYPE]={NULL,NULL}; CThing *CThingManager::s_thingLists[CThing::MAX_TYPE];//={NULL,NULL};
CThing *CThingManager::s_CollisionLists[CThing::MAX_TYPE];
int CThingManager::s_initialised=false; int CThingManager::s_initialised=false;
sBBox CThingManager::m_RenderBBox;
sBBox CThingManager::m_ThinkBBox;
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
Function: Function:
Purpose: Purpose:
@ -63,13 +69,9 @@ int CThingManager::s_initialised=false;
---------------------------------------------------------------------- */ ---------------------------------------------------------------------- */
void CThingManager::init() void CThingManager::init()
{ {
int i;
ASSERT(!s_initialised); ASSERT(!s_initialised);
for(i=0;i<CThing::MAX_TYPE;i++) initList(s_thingLists);
{ initList(s_CollisionLists);
s_thingLists[i]=NULL;
}
s_initialised=true; s_initialised=true;
} }
@ -97,6 +99,22 @@ void CThingManager::shutdown()
s_initialised=false; s_initialised=false;
} }
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CThingManager::initList(CThing **List)
{
int i;
for(i=0 ;i<CThing::MAX_TYPE; i++)
{
List[i]=NULL;
}
}
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
Function: Function:
Purpose: Kills every CThing except the player Purpose: Kills every CThing except the player
@ -142,7 +160,7 @@ void CThingManager::thinkAllThings(int _frames)
{ {
thing->think(_frames); thing->think(_frames);
thing->updateCollisionArea(); thing->updateCollisionArea();
thing=thing->m_nextThing; thing=thing->m_nextListThing;
} }
} }
@ -168,7 +186,7 @@ void CThingManager::thinkAllThings(int _frames)
thing1->collidedWith(thing2); thing1->collidedWith(thing2);
} }
thing1=thing1->m_nextThing; thing1=thing1->m_nextListThing;
} }
// Player -> Pickup collision // Player -> Pickup collision
@ -181,7 +199,7 @@ void CThingManager::thinkAllThings(int _frames)
{ {
thing1->collidedWith(thing2); thing1->collidedWith(thing2);
} }
thing1=thing1->m_nextThing; thing1=thing1->m_nextListThing;
} }
// Player -> Enemy collision // Player -> Enemy collision
@ -194,7 +212,7 @@ void CThingManager::thinkAllThings(int _frames)
{ {
thing1->collidedWith(thing2); thing1->collidedWith(thing2);
} }
thing1=thing1->m_nextThing; thing1=thing1->m_nextListThing;
} }
// Player -> Friend collision // Player -> Friend collision
@ -207,7 +225,7 @@ void CThingManager::thinkAllThings(int _frames)
{ {
thing1->collidedWith(thing2); thing1->collidedWith(thing2);
} }
thing1=thing1->m_nextThing; thing1=thing1->m_nextListThing;
} }
// Player -> Hazard collision // Player -> Hazard collision
@ -220,7 +238,7 @@ void CThingManager::thinkAllThings(int _frames)
{ {
thing1->collidedWith(thing2); thing1->collidedWith(thing2);
} }
thing1=thing1->m_nextThing; thing1=thing1->m_nextListThing;
} }
// Player -> Enemy projectile collision // Player -> Enemy projectile collision
@ -233,7 +251,7 @@ void CThingManager::thinkAllThings(int _frames)
{ {
thing1->collidedWith(thing2); thing1->collidedWith(thing2);
} }
thing1=thing1->m_nextThing; thing1=thing1->m_nextListThing;
} }
// Player -> Trigger collision // Player -> Trigger collision
@ -246,7 +264,7 @@ void CThingManager::thinkAllThings(int _frames)
{ {
thing1->collidedWith(thing2); thing1->collidedWith(thing2);
} }
thing1=thing1->m_nextThing; thing1=thing1->m_nextListThing;
} }
// Enemy -> Player projectile collision // Enemy -> Player projectile collision
@ -262,9 +280,9 @@ void CThingManager::thinkAllThings(int _frames)
{ {
thing1->collidedWith(thing2); thing1->collidedWith(thing2);
} }
thing2=thing2->m_nextThing; thing2=thing2->m_nextListThing;
} }
thing1=thing1->m_nextThing; thing1=thing1->m_nextListThing;
} }
// Enemy -> Enemy collision // Enemy -> Enemy collision
@ -286,10 +304,10 @@ void CThingManager::thinkAllThings(int _frames)
} }
} }
thing2 = thing2->m_nextThing; thing2 = thing2->m_nextListThing;
} }
thing1 = thing1->m_nextThing; thing1 = thing1->m_nextListThing;
} }
// Hazard -> Platform collision // Hazard -> Platform collision
@ -311,10 +329,10 @@ void CThingManager::thinkAllThings(int _frames)
} }
} }
thing2 = thing2->m_nextThing; thing2 = thing2->m_nextListThing;
} }
thing1 = thing1->m_nextThing; thing1 = thing1->m_nextListThing;
} }
for(i=0;i<CThing::MAX_TYPE;i++) for(i=0;i<CThing::MAX_TYPE;i++)
@ -323,7 +341,7 @@ void CThingManager::thinkAllThings(int _frames)
CThing *nextThing = thing; CThing *nextThing = thing;
while(thing) while(thing)
{ {
nextThing=thing->m_nextThing; nextThing=thing->m_nextListThing;
if ( thing->isSetToShutdown() ) if ( thing->isSetToShutdown() )
{ {
@ -342,10 +360,32 @@ void CThingManager::thinkAllThings(int _frames)
Params: Params:
Returns: Returns:
---------------------------------------------------------------------- */ ---------------------------------------------------------------------- */
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;
void CThingManager::renderAllThings() void CThingManager::renderAllThings()
{ {
int i; // Setup Screen BBox's
CThing *thing; DVECTOR const &CamPos=CLevel::getCameraPos();
m_RenderBBox.XMin=s_RenderBBoxX0+CamPos.vx;
m_RenderBBox.XMax=s_RenderBBoxX1+CamPos.vx;
m_RenderBBox.YMin=s_RenderBBoxY0+CamPos.vy;
m_RenderBBox.YMax=s_RenderBBoxY1+CamPos.vy;
m_ThinkBBox.XMin=s_ThinkBBoxX0+CamPos.vx;
m_ThinkBBox.XMax=s_ThinkBBoxX1+CamPos.vx;
m_ThinkBBox.YMin=s_ThinkBBoxY0+CamPos.vy;
m_ThinkBBox.YMax=s_ThinkBBoxY1+CamPos.vy;
int i;
CThing *thing;
for(i=0;i<CThing::MAX_TYPE;i++) for(i=0;i<CThing::MAX_TYPE;i++)
{ {
@ -353,7 +393,7 @@ void CThingManager::renderAllThings()
while(thing) while(thing)
{ {
thing->render(); thing->render();
thing=thing->m_nextThing; thing=thing->m_nextListThing;
} }
} }
} }
@ -375,7 +415,7 @@ void CThingManager::processEventAllThings(GAME_EVENT _event,CThing *_sourceThin
while(thing) while(thing)
{ {
thing->processEvent(_event,_sourceThing); thing->processEvent(_event,_sourceThing);
thing=thing->m_nextThing; thing=thing->m_nextListThing;
} }
} }
} }
@ -403,7 +443,7 @@ CThing *CThingManager::checkCollisionAreaAgainstThings(CRECT *_area,int _type,i
if(_continue) if(_continue)
{ {
ASSERT(thing); ASSERT(thing);
thing=thing->m_nextThing; thing=thing->m_nextListThing;
} }
else else
{ {
@ -416,7 +456,7 @@ CThing *CThingManager::checkCollisionAreaAgainstThings(CRECT *_area,int _type,i
{ {
return thing; return thing;
} }
thing=thing->m_nextThing; thing=thing->m_nextListThing;
} }
return NULL; return NULL;
@ -430,7 +470,7 @@ CThing *CThingManager::checkCollisionAreaAgainstThings(CRECT *_area,int _type,i
---------------------------------------------------------------------- */ ---------------------------------------------------------------------- */
void CThingManager::addToThingList(CThing *_this) void CThingManager::addToThingList(CThing *_this)
{ {
_this->m_nextThing=s_thingLists[_this->getThingType()]; _this->m_nextListThing=s_thingLists[_this->getThingType()];
s_thingLists[_this->getThingType()]=_this; s_thingLists[_this->getThingType()]=_this;
} }
@ -449,16 +489,16 @@ void CThingManager::removeFromThingList(CThing *_this)
while(thing!=_this) while(thing!=_this)
{ {
prevThing=thing; prevThing=thing;
thing=thing->m_nextThing; thing=thing->m_nextListThing;
ASSERT(thing); // Not in the list!?!? ASSERT(thing); // Not in the list!?!?
} }
if(prevThing) if(prevThing)
{ {
prevThing->m_nextThing=_this->m_nextThing; prevThing->m_nextListThing=_this->m_nextListThing;
} }
else else
{ {
s_thingLists[_this->getThingType()]=_this->m_nextThing; s_thingLists[_this->getThingType()]=_this->m_nextListThing;
} }
} }
@ -524,24 +564,48 @@ void CThing::think(int _frames)
Params: Params:
Returns: Returns:
---------------------------------------------------------------------- */ ---------------------------------------------------------------------- */
#if !defined(__USER_CDBUILD__) #if defined (__USER_paul__) || defined (__USER_charles__)
#include "gfx\prim.h" #define SHOW_BBOX 1
#include "level\level.h" int showthings=true;
#endif
#if defined (__USER_paul__) || defined (__USER_charles__) #if defined (__USER_daveo__)
int showthings=true; #define SHOW_BBOX 1
#else int showthings=false;
int showthings=false; #endif
#endif
void CThing::render() void CThing::render()
{
// Check Is Onscreen
CRECT const &collisionRect = getCollisionArea();
sBBox &ScrBBox=CThingManager::getRenderBBox();
DVECTOR const &CamPos=CLevel::getCameraPos();
m_RenderPos.vx = Pos.vx - CamPos.vx;
m_RenderPos.vy = Pos.vy - CamPos.vy;
// Will speed this up
m_renderFlag=true;
if (collisionRect.x2<ScrBBox.XMin || collisionRect.x1>ScrBBox.XMax) m_renderFlag=false;
if (collisionRect.y2<ScrBBox.YMin || collisionRect.y1>ScrBBox.YMax) m_renderFlag=false;
/***/
#ifdef SHOW_BBOX
if(showthings) ShowBBox();
#endif
}
/****************************************************************************************/
#ifdef SHOW_BBOX
#include "gfx\prim.h"
void CThing::ShowBBox()
{ {
if(showthings) if(showthings)
{ {
DVECTOR ofs; DVECTOR const &ofs=CLevel::getCameraPos();
CRECT area; CRECT area;
ofs=CLevel::getCameraPos();
area=getCollisionArea(); area=getCollisionArea();
area.x1-=ofs.vx; area.x1-=ofs.vx;
area.y1-=ofs.vy; area.y1-=ofs.vy;
@ -636,10 +700,6 @@ void CThing::render()
*/ */
} }
} }
#else
void CThing::render()
{
}
#endif #endif
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------

View File

@ -26,6 +26,7 @@
#include "game\event.h" #include "game\event.h"
#endif #endif
#include <dstructs.h>
/* Std Lib /* Std Lib
------- */ ------- */
@ -39,15 +40,15 @@
-------------------- */ -------------------- */
// Collision rectangle definition // Collision rectangle definition
typedef struct struct CRECT
{ {
int x1,y1,x2,y2; int x1,y1,x2,y2;
} };
CRECT;
/*----------------------------------------------------------------------*/
// Thing manager class // Thing manager class
class CThingManager class CThing;
class CThingManager
{ {
public: public:
static void init(); static void init();
@ -56,27 +57,38 @@ public:
static void thinkAllThings(int _frames); static void thinkAllThings(int _frames);
static void renderAllThings(); static void renderAllThings();
static void processEventAllThings(GAME_EVENT _event,class CThing *_sourceThing); static void processEventAllThings(GAME_EVENT _event,CThing *_sourceThing);
static CThing* checkCollisionAreaAgainstThings(CRECT *_area,int _type,int _continue); static CThing* checkCollisionAreaAgainstThings(CRECT *_area,int _type,int _continue);
static void initCollision();
static sBBox &getRenderBBox() {return(m_RenderBBox);}
static sBBox &getThinkBBox() {return(m_ThinkBBox);}
protected: protected:
static void addToThingList(class CThing *_this); static void initList(CThing **List);
static void removeFromThingList(CThing *_this); static void addToThingList(CThing *_this);
friend class CThing; static void removeFromThingList(CThing *_this);
static void addToCollisionList(CThing *_this);
friend class CThing;
private: private:
static class CThing *s_thingLists[]; static CThing *s_thingLists[];
static int s_initialised; static int s_initialised;
static CThing *s_CollisionLists[];
static sBBox m_RenderBBox;
static sBBox m_ThinkBBox;
}; };
/*----------------------------------------------------------------------*/
// Base thing class // Base thing class
class CThing class CThing
{ {
public: public:
typedef enum enum TYPE
{ {
TYPE_PICKUP, TYPE_PICKUP,
TYPE_PLATFORM, TYPE_PLATFORM,
@ -90,164 +102,157 @@ public:
TYPE_FX, TYPE_FX,
MAX_TYPE, MAX_TYPE,
} };
TYPE; // TYPE;
CThing() {;}
virtual ~CThing() {;}
CThing() {;} virtual TYPE getThingType()=0;
virtual ~CThing() {;}
virtual TYPE getThingType()=0; virtual void init();
virtual void shutdown();
virtual void think(int _frames);
virtual void init(); virtual void render();
virtual void shutdown(); virtual u8 isSetToShutdown() {return( false );}
virtual void think(int _frames);
virtual void render();
virtual u8 isSetToShutdown() {return( false );}
// Linkage // Linkage
void addChild(CThing *Child); void addChild(CThing *Child);
void removeChild(CThing *Child); void removeChild(CThing *Child);
void removeAllChild(); void removeAllChild();
void deleteAllChild(); void deleteAllChild();
bool hasChild(CThing *Child); bool hasChild(CThing *Child);
int getNumChildren(); int getNumChildren();
DVECTOR getPos() {return Pos;} DVECTOR const &getPos() {return Pos;}
void setPos(DVECTOR newPos) {Pos=newPos;} void setPos(DVECTOR newPos) {Pos=newPos;}
DVECTOR getPosDelta() {return PosDelta;} DVECTOR getPosDelta() {return PosDelta;}
CThing *getNext() {return Next;} CThing *getNext() {return Next;}
virtual void processEvent(GAME_EVENT _event,CThing *_sourceThing);
virtual void processEvent(GAME_EVENT _event,CThing *_sourceThing);
protected: protected:
// Parent Child Linkage
// Linkage CThing *Parent,*Next;
CThing *Parent,*Next;
// Count // Count
int m_numChildren; int m_numChildren;
// Pos // Pos
DVECTOR Pos, PosLast, PosDelta; DVECTOR Pos, PosLast, PosDelta;
public: public:
class CThing *m_nextThing; CThing *m_nextListThing;
CThing *m_nextCollisionThing;
// -- Collision -- // -- Collision --
public: public:
DVECTOR getCollisionCentre() {return m_collisionCentre;} void ShowBBox();
DVECTOR getCollisionCentreOffset() {return m_collisionCentreOffset;} DVECTOR const &getCollisionCentre() {return m_collisionCentre;}
int getCollisionRadius() {return m_collisionRadius;} DVECTOR const &getCollisionCentreOffset() {return m_collisionCentreOffset;}
CRECT getCollisionArea() {return m_collisionArea;} int getCollisionRadius() {return m_collisionRadius;}
s16 getCollisionAngle() {return m_collisionAngle;} // pkg - move to CNpcPlatform? CRECT const &getCollisionArea() {return m_collisionArea;}
DVECTOR getNewCollidedPos() {return m_newCollidedPos;} // pkg - to be removed? s16 getCollisionAngle() {return m_collisionAngle;} // pkg - move to CNpcPlatform?
DVECTOR getCollisionSize() {return m_collisionSize;} DVECTOR const &getNewCollidedPos() {return m_newCollidedPos;} // pkg - to be removed?
DVECTOR const &getCollisionSize() {return m_collisionSize;}
virtual int canCollide() {return true;} virtual int canCollide() {return true;}
virtual int checkCollisionAgainst(CThing *_thisThing, int _frames); virtual int checkCollisionAgainst(CThing *_thisThing, int _frames);
int checkCollisionAgainstArea(CRECT *_rect); int checkCollisionAgainstArea(CRECT *_rect);
void updateCollisionArea(); void updateCollisionArea();
virtual void collidedWith(CThing *_thisThing) {;} virtual void collidedWith(CThing *_thisThing) {;}
virtual void setHasPlatformCollided( bool newVal ) {;} virtual void setHasPlatformCollided( bool newVal ) {;}
virtual bool getHasPlatformCollided() {return false;} virtual bool getHasPlatformCollided() {return false;}
virtual s32 getNewYPos( CThing *_thisThing ); virtual s32 getNewYPos( CThing *_thisThing );
void setNewCollidedPos(DVECTOR newPos) {m_newCollidedPos = newPos;} // pkg - to be removed? void setNewCollidedPos(DVECTOR newPos) {m_newCollidedPos = newPos;} // pkg - to be removed?
bool IsOnScreen() {return(m_OnScreenFlag);/* Put check code here */} bool canRender() {return (m_renderFlag);}
bool getOnScreenFlag() {return(m_OnScreenFlag);} DVECTOR &getRenderPos() {return(m_RenderPos);}
void setOnScreenFlag(bool f) {m_OnScreenFlag=f;} bool canThink() {return (m_thinkFlag);}
protected: protected:
virtual void setCollisionSize(int _w,int _h); virtual void setCollisionSize(int _w,int _h);
virtual void setCollisionCentreOffset(int _x,int _y) {m_collisionCentreOffset.vx=_x;m_collisionCentreOffset.vy=_y;} virtual void setCollisionCentreOffset(int _x,int _y) {m_collisionCentreOffset.vx=_x;m_collisionCentreOffset.vy=_y;}
virtual void setCollisionCentreOffset(DVECTOR xy) {m_collisionCentreOffset=xy;} virtual void setCollisionCentreOffset(DVECTOR xy) {m_collisionCentreOffset=xy;}
virtual void setCollisionAngle(int newAngle) {m_collisionAngle = newAngle;} // pkg - move to CNpcPlatform? virtual void setCollisionAngle(int newAngle) {m_collisionAngle = newAngle;} // pkg - move to CNpcPlatform?
private: private:
DVECTOR m_collisionSize; DVECTOR m_collisionSize;
DVECTOR m_collisionCentreOffset; DVECTOR m_collisionCentreOffset;
int m_collisionRadius; int m_collisionRadius;
CRECT m_collisionArea; CRECT m_collisionArea;
DVECTOR m_collisionCentre; DVECTOR m_collisionCentre;
s16 m_collisionAngle; // pkg - move to CNpcPlatform? s16 m_collisionAngle; // pkg - move to CNpcPlatform?
DVECTOR m_newCollidedPos; // pkg - to be removed? DVECTOR m_newCollidedPos; // pkg - to be removed?
bool m_OnScreenFlag;
bool m_renderFlag,m_thinkFlag;
DVECTOR m_RenderPos;
}; };
/*---------------------------------------------------------------------- */
/* These are the individual base classes for each of the seperate thing types */ /* These are the individual base classes for each of the seperate thing types */
class CPickupThing : public CThing class CPickupThing : public CThing
{ {
public: public:
virtual TYPE getThingType() {return TYPE_PICKUP;} virtual TYPE getThingType() {return TYPE_PICKUP;}
}; };
class CPlayerThing : public CThing class CPlayerThing : public CThing
{ {
public: public:
virtual TYPE getThingType() {return TYPE_PLAYER;} virtual TYPE getThingType() {return TYPE_PLAYER;}
}; };
class CPlayerProjectileThing : public CThing class CPlayerProjectileThing : public CThing
{ {
public: public:
virtual TYPE getThingType() {return TYPE_PLAYERPROJECTILE;} virtual TYPE getThingType() {return TYPE_PLAYERPROJECTILE;}
}; };
class CNpcThing : public CThing class CNpcThing : public CThing
{ {
public: public:
virtual TYPE getThingType() {return TYPE_NPC;} virtual TYPE getThingType() {return TYPE_NPC;}
}; };
class CEnemyThing : public CThing class CEnemyThing : public CThing
{ {
public: public:
virtual TYPE getThingType() {return TYPE_ENEMY;} virtual TYPE getThingType() {return TYPE_ENEMY;}
}; };
class CEnemyProjectileThing : public CThing class CEnemyProjectileThing : public CThing
{ {
public: public:
virtual TYPE getThingType() {return TYPE_ENEMYPROJECTILE;} virtual TYPE getThingType() {return TYPE_ENEMYPROJECTILE;}
}; };
class CPlatformThing : public CThing class CPlatformThing : public CThing
{ {
public: public:
virtual TYPE getThingType() {return TYPE_PLATFORM;} virtual TYPE getThingType() {return TYPE_PLATFORM;}
}; };
class CTriggerThing : public CThing class CTriggerThing : public CThing
{ {
public: public:
virtual TYPE getThingType() {return TYPE_TRIGGER;} virtual TYPE getThingType() {return TYPE_TRIGGER;}
virtual void setPositionAndSize(int _x,int _y,int _w,int _h); // Wonder if this might be better in CThing? (pkg) virtual void setPositionAndSize(int _x,int _y,int _w,int _h); // Wonder if this might be better in CThing? (pkg)
virtual void setTargetBox(int _x,int _y,int _w,int _h); // Wonder if this might be better in CThing? (pkg) virtual void setTargetBox(int _x,int _y,int _w,int _h); // Wonder if this might be better in CThing? (pkg)
protected: protected:
int m_boxX1,m_boxY1,m_boxX2,m_boxY2; int m_boxX1,m_boxY1,m_boxX2,m_boxY2;
}; };
class CHazardThing : public CThing class CHazardThing : public CThing
{ {
public: public:
virtual TYPE getThingType() {return TYPE_HAZARD;} virtual TYPE getThingType() {return TYPE_HAZARD;}
}; };
class CFXThing : public CThing class CFXThing : public CThing
{ {
public: public:
virtual TYPE getThingType() {return TYPE_FX;} virtual TYPE getThingType() {return TYPE_FX;}
}; };
/*----------------------------------------------------------------------
Globals
------- */
/*----------------------------------------------------------------------
Functions
--------- */
/*---------------------------------------------------------------------- */
#endif /* __THING_THING_H__ */ #endif /* __THING_THING_H__ */
/*=========================================================================== /*===========================================================================