This commit is contained in:
Daveo 2001-05-30 17:07:26 +00:00
parent cc21912c1a
commit 5fe1a58de3
7 changed files with 39 additions and 32 deletions

View File

@ -70,9 +70,9 @@ CLayerCollision::CLayerCollision(sLayerHdr *Hdr)
map=Map;
for(i=0;i<MapWidth*MapHeight;i++)
{
originalTile=*map;
finalTile=(originalTile&0xe0)|s_collisionTileRemapTable[originalTile&0x1f];
*map++=finalTile;
// originalTile=*map;
// finalTile=(originalTile&0xe0)|s_collisionTileRemapTable[originalTile&0x1f];
// *map++=finalTile;
}
}

View File

@ -636,14 +636,14 @@ sLayerHdr *layer;
void CLevel::destroyMapArea(DVECTOR const &Pos)
{
DVECTOR TL,BR;
const int ColT=COLLISION_TYPE_DESTRUCTABLE;
const int ColT=COLLISION_TYPE_DESTRUCTABLE_WALL;
TL.vx=Pos.vx&-16;;
TL.vy=Pos.vy&-16;;
BR=TL;
if (CollisionLayer->getCollisionBlock(TL.vx,TL.vy)>>COLLISION_TYPE_FLAG_SHIFT==ColT)printf ("!!");
// if (CollisionLayer->getCollisionBlock(TL.vx,TL.vy)>>COLLISION_TYPE_FLAG_SHIFT==ColT)printf ("!!");
// Left
while (CollisionLayer->getCollisionBlock(TL.vx-16,TL.vy)>>COLLISION_TYPE_FLAG_SHIFT==ColT) TL.vx-=16;

View File

@ -60,7 +60,7 @@ void CNpcFallingNoRespawnPlatform::processMovement( int _frames )
if ( groundHeight < moveY )
{
if ( ( CGameScene::getCollision()->getCollisionBlock( Pos.vx, Pos.vy + groundHeight + 8 ) & COLLISION_TYPE_MASK ) != COLLISION_TYPE_FLAG_DEATH )
if ( ( CGameScene::getCollision()->getCollisionBlock( Pos.vx, Pos.vy + groundHeight + 8 ) & COLLISION_TYPE_MASK ) != COLLISION_TYPE_FLAG_DEATH_FALL )
{
moveY = groundHeight;
moveX = 2 * _frames;

View File

@ -1838,7 +1838,7 @@ int CPlayer::canDoLookAround()
void CPlayer::inSoakUpState()
{
if(isWearingDivingHelmet()&&
(CGameScene::getCollision()->getCollisionBlock(Pos.vx,Pos.vy)&COLLISION_TYPE_MASK)==COLLISION_TYPE_FLAG_WATER)
(CGameScene::getCollision()->getCollisionBlock(Pos.vx,Pos.vy)&COLLISION_TYPE_MASK)==COLLISION_TYPE_FLAG_DEATH_LIQUID)
{
m_healthWaterLevel+=waterSoakUpSpeed;
if(m_healthWaterLevel>WATERMAXHEALTH)
@ -2344,7 +2344,7 @@ int CPlayer::moveVertical(int _moveDistance)
if(colHeightBefore>=0&&colHeightAfter<=0)
{
// About to hit a 'fall to death' block?
if((CGameScene::getCollision()->getCollisionBlock(pos.vx,pos.vy+_moveDistance)&COLLISION_TYPE_MASK)!=COLLISION_TYPE_FLAG_DEATH)
if((CGameScene::getCollision()->getCollisionBlock(pos.vx,pos.vy+_moveDistance)&COLLISION_TYPE_MASK)!=COLLISION_TYPE_FLAG_DEATH_FALL)
{
// No
// Stick at ground level

View File

@ -297,7 +297,7 @@ void CPlayerModeBase::thinkVerticalMovement()
playerHasHitGround();
pos=m_player->getPlayerPos();
if(m_player->getHeightFromGround(pos.vx,pos.vy,5)==0&&
(CGameScene::getCollision()->getCollisionBlock(pos.vx,pos.vy)&COLLISION_TYPE_MASK)==COLLISION_TYPE_FLAG_WATER&&
(CGameScene::getCollision()->getCollisionBlock(pos.vx,pos.vy)&COLLISION_TYPE_MASK)==COLLISION_TYPE_FLAG_DEATH_LIQUID&&
!m_player->getIsHealthSoFullThatIDontNeedToSoakUp())
{
// Hit water - Go into soakup mode

Binary file not shown.

View File

@ -5,35 +5,42 @@
#ifndef __DATA_STRUCTS_HEADER__
#define __DATA_STRUCTS_HEADER__
//***************************************************************************
// Taken from Map editor layerdef.h
enum PSX_COLLSION_ENUM
{
COLLISION_TYPE_BLANK =0,
COLLISION_TYPE_NORMAL =0,
COLLISION_TYPE_DAMAGE =1,
COLLISION_TYPE_SLIPPERY =2,
COLLISION_TYPE_ELECTRIC =3,
COLLISION_TYPE_STICKY =4,
COLLISION_TYPE_WATER =5,
COLLISION_TYPE_SOLID =6,
COLLISION_TYPE_DEATH =7,
// COLLISION_TYPE_DESTRUCTABLE =8,
COLLISION_TYPE_DESTRUCTABLE =COLLISION_TYPE_STICKY,
COLLISION_TYPE_BLANK =0,
COLLISION_TYPE_NORMAL =0,
COLLISION_TYPE_DAMAGE =1,
COLLISION_TYPE_SLIPPERY =2,
COLLISION_TYPE_ELECTRIC =3,
COLLISION_TYPE_DESTRUCTABLE_WALL =4,
COLLISION_TYPE_DEATH_LIQUID =5,
COLLISION_TYPE_SOLID =6,
COLLISION_TYPE_DEATH_FALL =7,
COLLISION_TYPE_DESTRUCTABLE_FLOOR =8,
COLLISION_TYPE_DEATH_INSTANT =9,
COLLISION_TYPE_MOVE_LEFT =10,
COLLISION_TYPE_MOVE_RIGHT =11,
COLLISION_TYPE_FLAG_SHIFT =5,
COLLISION_TYPE_FLAG_NORMAL =COLLISION_TYPE_NORMAL << COLLISION_TYPE_FLAG_SHIFT,
COLLISION_TYPE_FLAG_DAMAGE =COLLISION_TYPE_DAMAGE << COLLISION_TYPE_FLAG_SHIFT,
COLLISION_TYPE_FLAG_SLIPPERY =COLLISION_TYPE_SLIPPERY << COLLISION_TYPE_FLAG_SHIFT,
COLLISION_TYPE_FLAG_ELECTRIC =COLLISION_TYPE_ELECTRIC << COLLISION_TYPE_FLAG_SHIFT,
COLLISION_TYPE_FLAG_STICKY =COLLISION_TYPE_STICKY << COLLISION_TYPE_FLAG_SHIFT,
COLLISION_TYPE_FLAG_WATER =COLLISION_TYPE_WATER << COLLISION_TYPE_FLAG_SHIFT,
COLLISION_TYPE_FLAG_SOLID =COLLISION_TYPE_SOLID << COLLISION_TYPE_FLAG_SHIFT,
COLLISION_TYPE_FLAG_DEATH =COLLISION_TYPE_DEATH << COLLISION_TYPE_FLAG_SHIFT,
COLLISION_TYPE_FLAG_DESTRUCTABLE =COLLISION_TYPE_DESTRUCTABLE << COLLISION_TYPE_FLAG_SHIFT,
COLLISION_TYPE_FLAG_SHIFT =3,
COLLISION_TYPE_FLAG_NORMAL =COLLISION_TYPE_NORMAL << COLLISION_TYPE_FLAG_SHIFT,
COLLISION_TYPE_FLAG_DAMAGE =COLLISION_TYPE_DAMAGE << COLLISION_TYPE_FLAG_SHIFT,
COLLISION_TYPE_FLAG_SLIPPERY =COLLISION_TYPE_SLIPPERY << COLLISION_TYPE_FLAG_SHIFT,
COLLISION_TYPE_FLAG_ELECTRIC =COLLISION_TYPE_ELECTRIC << COLLISION_TYPE_FLAG_SHIFT,
COLLISION_TYPE_FLAG_DESTRUCTABLE_WALL =COLLISION_TYPE_DESTRUCTABLE_WALL << COLLISION_TYPE_FLAG_SHIFT,
COLLISION_TYPE_FLAG_DEATH_LIQUID =COLLISION_TYPE_DEATH_LIQUID << COLLISION_TYPE_FLAG_SHIFT,
COLLISION_TYPE_FLAG_SOLID =COLLISION_TYPE_SOLID << COLLISION_TYPE_FLAG_SHIFT,
COLLISION_TYPE_FLAG_DEATH_FALL =COLLISION_TYPE_DEATH_FALL << COLLISION_TYPE_FLAG_SHIFT,
COLLISION_TYPE_FLAG_DESTRUCTABLE_FLOOR =COLLISION_TYPE_DESTRUCTABLE_FLOOR << COLLISION_TYPE_FLAG_SHIFT,
COLLISION_TYPE_FLAG_DEATH_INSTANT =COLLISION_TYPE_DEATH_INSTANT << COLLISION_TYPE_FLAG_SHIFT,
COLLISION_TYPE_FLAG_MOVE_LEFT =COLLISION_TYPE_MOVE_LEFT << COLLISION_TYPE_FLAG_SHIFT,
COLLISION_TYPE_FLAG_MOVE_RIGHT =COLLISION_TYPE_MOVE_RIGHT << COLLISION_TYPE_FLAG_SHIFT,
COLLISION_TYPE_MASK = ((0xff<<COLLISION_TYPE_FLAG_SHIFT)&0xff),
COLLISION_TILE_MASK = (0xff - COLLISION_TYPE_MASK)
COLLISION_TYPE_MASK = ((0xff<<COLLISION_TYPE_FLAG_SHIFT)&0xff),
COLLISION_TILE_MASK = (0xff - COLLISION_TYPE_MASK)
};
enum PSX_DATA_ENUM