[wpdev-commits] wolfpack/muls maps.cpp,1.10,1.11 maps.h,1.3,1.4
Brought to you by:
rip,
thiagocorrea
From: Sebastian H. <dar...@us...> - 2004-09-16 01:40:26
|
Update of /cvsroot/wpdev/wolfpack/muls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4974/muls Modified Files: maps.cpp maps.h Log Message: New Line Of Sight Index: maps.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/muls/maps.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** maps.cpp 27 Aug 2004 18:56:59 -0000 1.10 --- maps.cpp 16 Sep 2004 01:40:17 -0000 1.11 *************** *** 400,403 **** --- 400,427 ---- } + void cMaps::mapTileSpan(const Coord_cl &pos, unsigned short &id, int &bottom, int &top) const { + int topZ, bottomZ, leftZ, rightZ; + + // Get the elevation of the tile itself + map_st tile = seekMap(pos.map, pos.x, pos.y); + topZ = tile.z; + id = tile.id; + + // Get the elevation of the tile on the lower left + leftZ = seekMap(pos.map, pos.x, pos.y + 1).z; + + // Get the elevation of the tile on the lower right + rightZ = seekMap(pos.map, pos.x + 1, pos.y).z; + + // Get the elevation of the tile below + bottomZ = seekMap(pos.map, pos.x + 1, pos.y + 1).z; + + // Get the smallest of the z values + bottom = QMIN( QMIN( QMIN(topZ, leftZ), rightZ), bottomZ); + + // Get the highest of the z values + top = QMAX( QMAX( QMAX(topZ, leftZ), rightZ), bottomZ); + } + /*! Returns the average elevation (z) of coordinates \a p and it's Index: maps.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/muls/maps.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** maps.h 13 Aug 2004 08:55:27 -0000 1.3 --- maps.h 16 Sep 2004 01:40:17 -0000 1.4 *************** *** 125,128 **** --- 125,129 ---- signed char mapElevation( const Coord_cl& p ) const; signed char mapAverageElevation( const Coord_cl& p, int* top = 0, int* botton = 0 ) const; + void mapTileSpan(const Coord_cl &pos, unsigned short &id, int &bottom, int &top) const; signed char dynamicElevation( const Coord_cl& pos ) const; signed char height( const Coord_cl& pos ); |