From b1753d59caa299c668b9c269e87f96c46e0ab33a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 7 Aug 2016 18:23:39 +0300 Subject: Add player wall collision type (5). --- src/resources/map/map.cpp | 7 +++++++ src/resources/map/map.h | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src/resources/map') diff --git a/src/resources/map/map.cpp b/src/resources/map/map.cpp index e86c0c2a4..073adb2ed 100644 --- a/src/resources/map/map.cpp +++ b/src/resources/map/map.cpp @@ -591,6 +591,7 @@ void Map::drawCollision(Graphics *restrict const graphics, fillCollision(BlockMask::AIR, AIR_COLLISION_HIGHLIGHT); fillCollision(BlockMask::WATER, WATER_COLLISION_HIGHLIGHT); fillCollision(BlockMask::GROUNDTOP, GROUNDTOP_COLLISION_HIGHLIGHT); + fillCollision(BlockMask::PLAYERWALL, COLLISION_HIGHLIGHT); } } } @@ -709,6 +710,9 @@ void Map::addBlockMask(const int x, const int y, case BlockType::GROUNDTOP: mMetaTiles[tileNum].blockmask |= BlockMask::GROUNDTOP; break; + case BlockType::PLAYERWALL: + mMetaTiles[tileNum].blockmask |= BlockMask::PLAYERWALL; + break; default: case BlockType::NONE: case BlockType::NB_BLOCKTYPES: @@ -742,6 +746,9 @@ void Map::setBlockMask(const int x, const int y, case BlockType::GROUNDTOP: mMetaTiles[tileNum].blockmask = BlockMask::GROUNDTOP; break; + case BlockType::PLAYERWALL: + mMetaTiles[tileNum].blockmask = BlockMask::PLAYERWALL; + break; default: case BlockType::NONE: case BlockType::NB_BLOCKTYPES: diff --git a/src/resources/map/map.h b/src/resources/map/map.h index c658b9b30..5abc9c964 100644 --- a/src/resources/map/map.h +++ b/src/resources/map/map.h @@ -77,7 +77,8 @@ class Map final : public Properties, COLLISION_AIR = 2, // air units can walk COLLISION_WATER = 3, // water units can walk COLLISION_GROUNDTOP = 4, // no collision (chair, bed, etc) - COLLISION_MAX = 5 // count index + COLLISION_PLAYER_WALL = 5, // full collision for player + COLLISION_MAX = 6 // count index }; /** -- cgit v1.2.3-70-g09d2