Update of /cvsroot/wpdev/wolfpack/muls
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29663/muls
Modified Files:
maps.cpp maps.h multiscache.h tilecache.h
Log Message:
New sectors code and more. A changelog will be sent to the mailing list.
Index: maps.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/muls/maps.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** maps.cpp 9 Oct 2004 14:32:22 -0000 1.16
--- maps.cpp 3 Nov 2004 02:09:31 -0000 1.17
***************
*** 28,37 ****
#include "maps.h"
#include "tilecache.h"
- #include "../sectors.h"
#include "multiscache.h"
! #include "../defines.h"
#include "../items.h"
#include "../console.h"
! #include "../log.h"
#include "../serverconfig.h"
--- 28,37 ----
#include "maps.h"
#include "tilecache.h"
#include "multiscache.h"
! #include "../log.h"
#include "../items.h"
#include "../console.h"
! #include "../defines.h"
! #include "../mapobjects.h"
#include "../serverconfig.h"
***************
*** 382,390 ****
\overload
Overloaded method, like the above, but takes coordinates and map id out of
! a Coord_cl instance.
! \sa Coord_cl
\sa map_st
*/
! map_st cMaps::seekMap( const Coord_cl& p ) const
{
return seekMap( p.map, p.x, p.y );
--- 382,390 ----
\overload
Overloaded method, like the above, but takes coordinates and map id out of
! a Coord instance.
! \sa Coord
\sa map_st
*/
! map_st cMaps::seekMap( const Coord& p ) const
{
return seekMap( p.map, p.x, p.y );
***************
*** 394,398 ****
Returns the elevation (z) of map tile located at \a p.
*/
! signed char cMaps::mapElevation( const Coord_cl& p ) const
{
map_st map = seekMap( p );
--- 394,398 ----
Returns the elevation (z) of map tile located at \a p.
*/
! signed char cMaps::mapElevation( const Coord& p ) const
{
map_st map = seekMap( p );
***************
*** 430,434 ****
}
! void cMaps::mapTileSpan(const Coord_cl &pos, unsigned short &id, int &bottom, int &top) const {
int topZ, bottomZ, leftZ, rightZ;
--- 430,435 ----
}
! void cMaps::mapTileSpan( const Coord &pos, unsigned short &id, int &bottom, int &top ) const
! {
int topZ, bottomZ, leftZ, rightZ;
***************
*** 448,455 ****
// 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);
}
--- 449,456 ----
// Get the smallest of the z values
! bottom = wpMin<int>( wpMin<int>( wpMin<int>( topZ, leftZ ), rightZ ), bottomZ );
// Get the highest of the z values
! top = wpMax<int>( wpMax<int>( wpMax<int>( topZ, leftZ ), rightZ ), bottomZ );
}
***************
*** 462,466 ****
and lowerst values that composes the average
*/
! signed char cMaps::mapAverageElevation( const Coord_cl& p, int* top /* = 0 */, int* botton /* = 0 */ ) const
{
// first thing is to get the map where we are standing
--- 463,467 ----
and lowerst values that composes the average
*/
! signed char cMaps::mapAverageElevation( const Coord& p, int* top /* = 0 */, int* botton /* = 0 */ ) const
{
// first thing is to get the map where we are standing
***************
*** 471,477 ****
{
// get three other nearby titles to decide on an average z?
! Q_INT8 map2z = mapElevation( p + Coord_cl( 1, 0, 0 ) );
! Q_INT8 map3z = mapElevation( p + Coord_cl( 0, 1, 0 ) );
! Q_INT8 map4z = mapElevation( p + Coord_cl( 1, 1, 0 ) );
Q_INT8 testz = 0;
--- 472,478 ----
{
// get three other nearby titles to decide on an average z?
! Q_INT8 map2z = mapElevation( p + Coord( 1, 0, 0 ) );
! Q_INT8 map3z = mapElevation( p + Coord( 0, 1, 0 ) );
! Q_INT8 map4z = mapElevation( p + Coord( 1, 1, 0 ) );
Q_INT8 testz = 0;
***************
*** 526,530 ****
// check statics too
! StaticsIterator StaticTiles = staticsIterator( Coord_cl( x, y, z, map ) );
for ( ; !StaticTiles.atEnd(); ++StaticTiles )
{
--- 527,531 ----
// check statics too
! StaticsIterator StaticTiles = staticsIterator( Coord( x, y, z, map ) );
for ( ; !StaticTiles.atEnd(); ++StaticTiles )
{
***************
*** 553,564 ****
}
! signed char cMaps::dynamicElevation( const Coord_cl& pos ) const
{
! //int z = ILLEGAL_Z;
! signed char z = ILLEGAL_Z;
! RegionIterator4Items ri( pos );
! for ( ri.Begin(); !ri.atEnd(); ri++ )
{
- P_ITEM mapitem = ri.GetData();
if ( mapitem != NULL )
{
--- 554,563 ----
}
! signed char cMaps::dynamicElevation( const Coord& pos ) const
{
! SI08 z = ILLEGAL_Z;
! MapItemsIterator ri = MapObjects::instance()->listItemsInCircle( pos, 18 );
! for ( P_ITEM mapitem = ri.first(); mapitem; mapitem = ri.next() )
{
if ( mapitem != NULL )
{
***************
*** 587,591 ****
}
! signed char cMaps::staticTop( const Coord_cl& pos ) const
{
signed char top = ILLEGAL_Z;
--- 586,590 ----
}
! signed char cMaps::staticTop( const Coord& pos ) const
{
signed char top = ILLEGAL_Z;
***************
*** 605,609 ****
// Return new height of player who walked to X/Y but from OLDZ
! signed char cMaps::height( const Coord_cl& pos )
{
// let's check in this order.. dynamic, static, then the map
--- 604,608 ----
// Return new height of player who walked to X/Y but from OLDZ
! signed char cMaps::height( const Coord& pos )
{
// let's check in this order.. dynamic, static, then the map
***************
*** 630,634 ****
}
! StaticsIterator cMaps::staticsIterator( const Coord_cl& p, bool exact /* = true */ ) const throw( wpException )
{
return staticsIterator( p.map, p.x, p.y, exact );
--- 629,633 ----
}
! StaticsIterator cMaps::staticsIterator( const Coord& p, bool exact /* = true */ ) const throw( wpException )
{
return staticsIterator( p.map, p.x, p.y, exact );
Index: tilecache.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/muls/tilecache.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** tilecache.h 19 Aug 2004 01:22:55 -0000 1.3
--- tilecache.h 3 Nov 2004 02:09:31 -0000 1.4
***************
*** 172,176 ****
};
! typedef SingletonHolder<cTileCache> TileCache;
#endif
--- 172,176 ----
};
! typedef Singleton<cTileCache> TileCache;
#endif
Index: maps.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/muls/maps.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** maps.h 21 Oct 2004 12:11:19 -0000 1.6
--- maps.h 3 Nov 2004 02:09:31 -0000 1.7
***************
*** 40,44 ****
// Forward definitions
class MapsPrivate;
! class Coord_cl;
class wpException;
--- 40,44 ----
// Forward definitions
class MapsPrivate;
! class Coord;
class wpException;
***************
*** 122,138 ****
unsigned int staticPatches( unsigned int id );
map_st seekMap( uint id, ushort x, ushort y ) const;
! map_st seekMap( const Coord_cl& ) const;
bool hasMap( uint id ) const;
! 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 );
uint mapTileWidth( uint ) const;
uint mapTileHeight( uint ) const;
! signed char staticTop( const Coord_cl& pos ) const;
bool canFit( int x, int y, int z, uint map ) const;
StaticsIterator staticsIterator( uint id, ushort x, ushort y, bool exact = true ) const throw( wpException );
! StaticsIterator staticsIterator( const Coord_cl&, bool exact = true ) const throw( wpException );
};
--- 122,138 ----
unsigned int staticPatches( unsigned int id );
map_st seekMap( uint id, ushort x, ushort y ) const;
! map_st seekMap( const Coord& ) const;
bool hasMap( uint id ) const;
! signed char mapElevation( const Coord& p ) const;
! signed char mapAverageElevation( const Coord& p, int* top = 0, int* botton = 0 ) const;
! void mapTileSpan(const Coord &pos, unsigned short &id, int &bottom, int &top) const;
! signed char dynamicElevation( const Coord& pos ) const;
! signed char height( const Coord& pos );
uint mapTileWidth( uint ) const;
uint mapTileHeight( uint ) const;
! signed char staticTop( const Coord& pos ) const;
bool canFit( int x, int y, int z, uint map ) const;
StaticsIterator staticsIterator( uint id, ushort x, ushort y, bool exact = true ) const throw( wpException );
! StaticsIterator staticsIterator( const Coord&, bool exact = true ) const throw( wpException );
};
***************
*** 189,193 ****
}
! typedef SingletonHolder<cMaps> Maps;
#endif // __MAPS_H__
--- 189,193 ----
}
! typedef Singleton<cMaps> Maps;
#endif // __MAPS_H__
Index: multiscache.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/muls/multiscache.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** multiscache.h 21 Oct 2004 12:11:19 -0000 1.4
--- multiscache.h 3 Nov 2004 02:09:31 -0000 1.5
***************
*** 101,105 ****
};
! typedef SingletonHolder<cMultiCache> MultiCache;
#endif // __MULTISCACHE_H__
--- 101,105 ----
};
! typedef Singleton<cMultiCache> MultiCache;
#endif // __MULTISCACHE_H__
|