Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields

Map Class Reference

Collaboration diagram for Map:

Collaboration graph
[legend]

Detailed Description

Author:
Gabor Torok


Public Member Functions

 Map (Session *session)
void reset ()
bool getHasWater ()
void setHasWater (bool b)
int toggleLightMap ()
void setSelectedDropTarget (Location *loc)
LocationgetSelectedDropTarget ()
void setZoomIn (bool b)
void setZoomOut (bool b)
float getZoom ()
void setXRot (float b)
void setYRot (float b)
void setZRot (float b)
float getXRot ()
float getYRot ()
float getZRot ()
void addXPos (float f)
void addYPos (float f)
void addZPos (float f)
float getXPos ()
float getYPos ()
float getZPos ()
bool isLocationVisible (int x, int y)
bool isLocationInLight (int x, int y)
void draw ()
void drawBorder ()
int getX ()
 The map top left x coordinate.
int getY ()
 The map top left y coordinate.
void setXY (int x, int y)
void center (Sint16 x, Sint16 y, bool force=false)
void startEffect (Sint16 x, Sint16 y, Sint16 z, int effect_type, GLuint duration=Constants::DAMAGE_DURATION, int width=1, int height=1, GLuint delay=0)
void setPosition (Sint16 x, Sint16 y, Sint16 z, Shape *shape)
Shape * removePosition (Sint16 x, Sint16 y, Sint16 z)
void setItem (Sint16 x, Sint16 y, Sint16 z, Item *item)
ItemremoveItem (Sint16 x, Sint16 y, Sint16 z)
void setCreature (Sint16 x, Sint16 y, Sint16 z, Creature *creature)
Creature * removeCreature (Sint16 x, Sint16 y, Sint16 z)
LocationmoveCreature (Sint16 x, Sint16 y, Sint16 z, Uint16 dir, Creature *newCreature)
 if you can't move to this spot (blocked) returns the blocking shape, otherwise returns NULL and moves the shape.
LocationmoveCreature (Sint16 x, Sint16 y, Sint16 z, Sint16 nx, Sint16 ny, Sint16 nz, Creature *newCreature)
void setFloorPosition (Sint16 x, Sint16 y, Shape *shape)
Shape * removeFloorPosition (Sint16 x, Sint16 y)
LocationisBlocked (Sint16 x, Sint16 y, Sint16 z, Sint16 shapex, Sint16 shapey, Sint16 shapez, Shape *shape, int *newz=NULL)
 Can shape at shapeX, shapeY, shapeZ move to location x, y, z? returns NULL if ok, or the blocking Shape* otherwise.
LocationgetPosition (Sint16 x, Sint16 y, Sint16 z)
 This one only returns if the shape originates at xyz.
LocationgetLocation (Sint16 x, Sint16 y, Sint16 z)
 This one returns even if shape doesn't originate at xyz.
Shape * getFloorPosition (Sint16 x, Sint16 y)
void showCreatureInfo (Creature *creature, bool player, bool selected, bool groupMode)
void initMapView (bool ignoreRot=false)
 Initialize the map view (translater, rotate).
void addDescription (char *description, float r=1.0f, float g=1.0f, float b=0.4f)
void drawDescriptions (ScrollingList *list)
void handleMouseMove (Uint16 mapx, Uint16 mapy, Uint16 mapz)
Uint16 getSelX ()
Uint16 getSelY ()
Uint16 getSelZ ()
void move (int dir)
 Move and rotate map.
bool isWallBetweenShapes (int x1, int y1, int z1, Shape *shape1, int x2, int y2, int z2, Shape *shape2)
bool isWallBetween (int x1, int y1, int z1, int x2, int y2, int z2)
bool shapeFits (Shape *shape, int x, int y, int z)
LocationgetBlockingLocation (Shape *shape, int x, int y, int z)
LocationgetDropLocation (Shape *shape, int x, int y, int z)
 Return the drop location, or NULL if none.
void updateLightMap ()
void refresh ()
void refreshTransparency ()
void setViewArea (int x, int y, int w, int h)
int getViewWidth ()
int getViewHeight ()
void dropItemsAbove (int x, int y, int z, Item *item)
int getCreaturesInArea (int x, int y, int radius, Creature *targets[])
 Find the creatures in this area and add them to the targets array.
bool isOnScreen (Uint16 mapx, Uint16 mapy, Uint16 mapz)
void doDrawShape (DrawLater *later, int effect=0)
void doDrawShape (float xpos2, float ypos2, float zpos2, Shape *shape, GLuint name, int effect=0, DrawLater *later=NULL)
bool isDoor (int x, int y)
bool isDoor (Shape *shape)
void setLocked (int doorX, int doorY, int doorZ, bool value)
void removeLocked (int doorX, int doorY, int doorZ)
void clearLocked ()
bool isLocked (int doorX, int doorY, int doorZ)
void getDoorLocation (int keyX, int keyY, int keyZ, int *doorX, int *doorY, int *doorZ)
void updateDoorLocation (int oldDoorX, int oldDoorY, int oldDoorZ, int newDoorX, int newDoorY, int newDoorZ)
void setKeyLocation (int doorX, int doorY, int doorZ, int keyX, int keyY, int keyZ)
void configureAccessMap (int fromX, int fromY)
bool isPositionAccessible (int atX, int atY)

Data Fields

bool useFrustum
int debugX
int debugY
int debugZ
bool selectMode
bool floorOnly

Static Public Attributes

static bool debugMd2Shapes = false

Protected Member Functions

Uint32 createTripletKey (int x, int y, int z)
void decodeTripletKey (Uint32 key, int *x, int *y, int *z)
Uint32 createPairKey (int x, int y)
void decodePairKey (Uint32 key, int *x, int *y)
void setupShapes (bool ground, bool water, int *csx=NULL, int *cex=NULL, int *csy=NULL, int *cey=NULL)
 If 'ground' is true, it draws the ground layer.
void setupPosition (int posX, int posY, int posZ, float xpos2, float ypos2, float zpos2, Shape *shape, Item *item, Creature *creature, EffectLocation *effect)
void drawGroundPosition (int posX, int posY, float xpos2, float ypos2, Shape *shape)
void drawWaterPosition (int posX, int posY, float xpos2, float ypos2, Shape *shape)
bool isWall (int x, int y, int z)
void configureLightMap ()
void traceLight (int chunkX, int chunkY, int lightMap[MAP_WIDTH/MAP_UNIT][MAP_DEPTH/MAP_UNIT], bool onlyLockedDoors)
bool isLocationBlocked (int x, int y, int z, bool onlyLockedDoors)
void drawShade ()
void drawProjectiles ()
void drawCube (float x, float y, float z, float r)
void createOverlayTexture ()
void removeEffect (Sint16 x, Sint16 y, Sint16 z)
void removeAllEffects ()
void moveCreaturePos (Sint16 nx, Sint16 ny, Sint16 nz, Sint16 ox, Sint16 oy, Sint16 oz, Creature *creature)
void drawWater ()
void removeCurrentEffects ()
void sortShapes (DrawLater *playerDrawLater, DrawLater *shapes, int shapeCount)

Protected Attributes

CFrustumfrustum
CVector3 chunks [100]
int chunkCount
DrawLater later [100]
DrawLater stencil [1000]
DrawLater other [1000]
DrawLater damage [1000]
int laterCount
int stencilCount
int otherCount
int damageCount
map< Uint32, EffectLocation * > currentEffectsMap

Data Structures

struct  _WaterTile


Member Function Documentation

int Map::getCreaturesInArea int  x,
int  y,
int  radius,
Creature *  targets[]
 

Find the creatures in this area and add them to the targets array.

Returns the number of creatures found. (0 if none.) It's the caller responsibility to create the targets array.

Location * Map::getDropLocation Shape *  shape,
int  x,
int  y,
int  z
 

Return the drop location, or NULL if none.

Location* Map::getLocation Sint16  x,
Sint16  y,
Sint16  z
 

This one returns even if shape doesn't originate at xyz.

Location * Map::getPosition Sint16  x,
Sint16  y,
Sint16  z
 

This one only returns if the shape originates at xyz.

int Map::getX  ) 
 

The map top left x coordinate.

int Map::getY  ) 
 

The map top left y coordinate.

void Map::initMapView bool  ignoreRot = false  ) 
 

Initialize the map view (translater, rotate).

Location * Map::isBlocked Sint16  x,
Sint16  y,
Sint16  z,
Sint16  shapex,
Sint16  shapey,
Sint16  shapez,
Shape *  shape,
int *  newz = NULL
 

Can shape at shapeX, shapeY, shapeZ move to location x, y, z? returns NULL if ok, or the blocking Shape* otherwise.

if newz is not null, it will ignore blocking "item"-s and instead stack the new shape on top, returning the new z position in newz.

void Map::move int  dir  ) 
 

Move and rotate map.

Modifiers: -CTRL + arrow keys / mouse at edge of screen: rotate map -arrow keys / mouse at edge of screen: move map fast -SHIFT + arrow keys / mouse at edge of screen: slow move map -SHIFT + CTRL + arrow keys / mouse at edge of screen: slow rotate map

Location * Map::moveCreature Sint16  x,
Sint16  y,
Sint16  z,
Uint16  dir,
Creature *  newCreature
 

if you can't move to this spot (blocked) returns the blocking shape, otherwise returns NULL and moves the shape.

void Map::setupShapes bool  ground,
bool  water,
int *  csx = NULL,
int *  cex = NULL,
int *  csy = NULL,
int *  cey = NULL
[protected]
 

If 'ground' is true, it draws the ground layer.

Otherwise the shape arrays (other, stencil, later) are populated.


The documentation for this class was generated from the following files:
Generated on Thu Jun 16 21:50:47 2005 for scourge by  doxygen 1.4.0