This commit is contained in:
parent
aeb6181757
commit
174c47da1a
1 changed files with 13 additions and 21 deletions
|
@ -696,15 +696,24 @@ DVECTOR DP;
|
|||
}
|
||||
}
|
||||
/*****************************************************************************/
|
||||
// fixed now, so takes out whole vertical section, wherever it is hit
|
||||
// Note: relies on tiles not being top or bottom of map tho!!
|
||||
void CLevel::destroyMapTile(DVECTOR const &Pos)
|
||||
{
|
||||
DVECTOR MP=Pos;
|
||||
int Width=CollisionLayer->getMapWidth();
|
||||
u8 *ColElem=CollisionLayer->getMapPtr(Pos.vx,Pos.vy);
|
||||
sTileMapElem *MapElem=TileLayers[CLayerTile::LAYER_TILE_TYPE_ACTION]->getMapPtr(Pos.vx,Pos.vy);
|
||||
DVECTOR MP=Pos;
|
||||
const int ColT=COLLISION_TYPE_DESTRUCTABLE_FLOOR;
|
||||
|
||||
u8 ColT=*ColElem>>COLLISION_TYPE_FLAG_SHIFT;
|
||||
// Goto Top
|
||||
while (*CollisionLayer->getMapPtr(MP.vx,MP.vy-1)>>COLLISION_TYPE_FLAG_SHIFT==ColT)
|
||||
{
|
||||
MP.vy-=16;
|
||||
}
|
||||
|
||||
u8 *ColElem=CollisionLayer->getMapPtr(MP.vx,MP.vy);
|
||||
sTileMapElem *MapElem=TileLayers[CLayerTile::LAYER_TILE_TYPE_ACTION]->getMapPtr(MP.vx,MP.vy);
|
||||
|
||||
// Thrash em down
|
||||
while (*ColElem>>COLLISION_TYPE_FLAG_SHIFT==ColT)
|
||||
{
|
||||
CFXFallingTile *FX=(CFXFallingTile*)CFX::Create(CFX::FX_TYPE_FALLINGTILE,MP);
|
||||
|
@ -718,24 +727,7 @@ u8 ColT=*ColElem>>COLLISION_TYPE_FLAG_SHIFT;
|
|||
}
|
||||
|
||||
}
|
||||
/*
|
||||
void CLevel::destroyMapTile(DVECTOR const &Pos)
|
||||
{
|
||||
u8 *ColElem=CollisionLayer->getMapPtr(Pos.vx,Pos.vy);
|
||||
sTileMapElem *MapElem=TileLayers[CLayerTile::LAYER_TILE_TYPE_ACTION]->getMapPtr(Pos.vx,Pos.vy);
|
||||
|
||||
if (MapElem->Tile)
|
||||
{
|
||||
CFXFallingTile *FX=(CFXFallingTile*)CFX::Create(CFX::FX_TYPE_FALLINGTILE,Pos);
|
||||
FX->SetTile(MapElem->Tile);
|
||||
MapElem->Tile=0;
|
||||
*ColElem=0;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue