projects
/
supertux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
973648e
)
Sector::is_free_space knows about slope tiles
author
Christoph Sommer
<mail@christoph-sommer.de>
Mon, 17 Jul 2006 00:36:19 +0000
(
00:36
+0000)
committer
Christoph Sommer
<mail@christoph-sommer.de>
Mon, 17 Jul 2006 00:36:19 +0000
(
00:36
+0000)
SVN-Revision: 4034
src/sector.cpp
patch
|
blob
|
history
diff --git
a/src/sector.cpp
b/src/sector.cpp
index
247a3de
..
1afc787
100644
(file)
--- 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;
}