From 08d0d2af4a39a46634a85a026b3eefb55d3efb1b Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Thu, 11 Mar 2010 08:47:06 +0000 Subject: [PATCH] supertux/tile.hpp: Implement Tile::is_unisolid(). SVN-Revision: 6594 --- src/supertux/sector.cpp | 4 ++-- src/supertux/tile.hpp | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/supertux/sector.cpp b/src/supertux/sector.cpp index fbf0f368b..b60a70ea9 100644 --- a/src/supertux/sector.cpp +++ b/src/supertux/sector.cpp @@ -1273,7 +1273,7 @@ Sector::collision_tilemap(collision::Constraints* constraints, // only handle unisolid when the player is falling down and when he was // above the tile before - if(tile->getAttributes() & Tile::UNISOLID) { + if(tile->is_unisolid ()) { int status; Vector relative_movement = movement - solids->get_movement(/* actual = */ true); @@ -1681,7 +1681,7 @@ Sector::is_free_of_tiles(const Rectf& rect, const bool ignoreUnisolid) const if(!tile) continue; if(!(tile->getAttributes() & Tile::SOLID)) continue; - if((tile->getAttributes() & Tile::UNISOLID) && ignoreUnisolid) + if(tile->is_unisolid () && ignoreUnisolid) continue; if(tile->is_slope ()) { AATriangle triangle; diff --git a/src/supertux/tile.hpp b/src/supertux/tile.hpp index 4351f115f..465c55995 100644 --- a/src/supertux/tile.hpp +++ b/src/supertux/tile.hpp @@ -128,6 +128,11 @@ public: return ((attributes & SLOPE) != 0); } + bool is_unisolid (void) const + { + return ((attributes & UNISOLID) != 0); + } + void print_debug(int id) const; private: -- 2.11.0