[Super-tux-commit] supertux/src worldmap.cpp,1.28,1.29 worldmap.h,1.17,1.18
Brought to you by:
wkendrick
From: Ingo R. <gr...@us...> - 2004-04-17 14:14:02
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5424 Modified Files: worldmap.cpp worldmap.h Log Message: sik0fewl's worldmap patch Index: worldmap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- worldmap.cpp 17 Apr 2004 13:56:48 -0000 1.28 +++ worldmap.cpp 17 Apr 2004 14:13:53 -0000 1.29 @@ -181,7 +181,7 @@ { // We reached the next tile, so we check what to do now offset -= 32; - if (worldmap->at(tile_pos)->stop) + if (worldmap->at(tile_pos)->stop || worldmap->at_level()) { stop(); } @@ -490,6 +490,20 @@ return TileManager::instance()->get(tilemap[width * p.y + p.x]); } +bool +WorldMap::at_level() +{ + for(Levels::iterator i = levels.begin(); i != levels.end(); ++i) + { + if (i->x == tux->get_tile_pos().x && + i->y == tux->get_tile_pos().y) + return true; + } + + return false; +} + + void WorldMap::draw(const Point& offset) { Index: worldmap.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- worldmap.h 17 Apr 2004 13:56:48 -0000 1.17 +++ worldmap.h 17 Apr 2004 14:13:53 -0000 1.18 @@ -166,6 +166,7 @@ Point get_next_tile(Point pos, Direction direction); Tile* at(Point pos); + bool at_level(); /** Check if it is possible to walk from \a pos into \a direction, if possible, write the new position to \a new_pos */ |