From: Christoph Sommer Date: Mon, 17 Jul 2006 00:36:19 +0000 (+0000) Subject: Sector::is_free_space knows about slope tiles X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=34358bd66972e94745ccd8e8eecc67cff739f883;p=supertux.git Sector::is_free_space knows about slope tiles SVN-Revision: 4034 --- diff --git a/src/sector.cpp b/src/sector.cpp index 247a3dec3..1afc7873b 100644 --- a/src/sector.cpp +++ b/src/sector.cpp @@ -1170,6 +1170,15 @@ Sector::is_free_space(const Rect& rect) const const Tile* tile = solids->get_tile(x, y); if(!tile) continue; + if(tile->getAttributes() & Tile::SLOPE) { + AATriangle triangle; + Vector p1(x*32, y*32); + Vector p2((x+1)*32, (y+1)*32); + triangle = AATriangle(p1, p2, tile->getData()); + Constraints constraints; + return collision::rectangle_aatriangle(&constraints, rect, triangle); + } + // FIXME: also test unisolid tiles if(tile->getAttributes() & Tile::SOLID) return false; }