Crossfire Client, Branches  R11627
mapdata.h File Reference
#include "client-types.h"
+ Include dependency graph for mapdata.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Map
 
struct  MapCell
 
struct  MapCellLayer
 

Macros

#define MAP1_LAYERS   3
 
#define MAX_VIEW   64
 
#define MAXLAYERS   10
 

Functions

sint16 mapdata_bigface (int x, int y, int layer, int *ww, int *hh)
 
sint16 mapdata_face (int x, int y, int layer)
 
void mapdata_init (void)
 
int mapdata_is_inside (int x, int y)
 
void mapdata_newmap (void)
 
void mapdata_reset (void)
 
void mapdata_scroll (int dx, int dy)
 
void mapdata_set_size (int viewx, int viewy)
 

Variables

struct Map the_map
 

Macro Definition Documentation

#define MAP1_LAYERS   3

Definition at line 42 of file mapdata.h.

Function Documentation

sint16 mapdata_bigface ( int  x,
int  y,
int  layer,
int *  ww,
int *  hh 
)

Returns the face to display at a given location. This function returns the "tail" information, i.e. big faces expanded by the client.

*ww and *hh return the offset of the current tile relative to the head; 0 <= *ww < (width of face), 0 <= *hh < (height of face).

When drawing the map view, this function must be used instead than a direct access to the_map.cells[]. This is because the_map.cells[] eventually still contains obsolete (fog of war) big face information; this function detects and clears such faces.

Definition at line 966 of file mapdata.c.

sint16 mapdata_face ( int  x,
int  y,
int  layer 
)

Returns the face to display at a given location. This function returns the "head" information, i.e. the face information sent by the server.

Definition at line 955 of file mapdata.c.

void mapdata_init ( void  )

Initializes the module. Allocates memory for the_map. This functions must be called before any other function is used.

Definition at line 514 of file mapdata.c.

int mapdata_is_inside ( int  x,
int  y 
)

Checks whether the given coordinates are within the current display size (as set by mapdata_set_size).

Definition at line 587 of file mapdata.c.

void mapdata_newmap ( void  )

Clears the map view. Must be called whenever a newmap command was received from the server.

Definition at line 935 of file mapdata.c.

void mapdata_reset ( void  )

Resets all stored information.

Definition at line 572 of file mapdata.c.

void mapdata_scroll ( int  dx,
int  dy 
)

Scrolls the map view. Must be called whenever a map_scroll command was received from the server.

Definition at line 859 of file mapdata.c.

void mapdata_set_size ( int  viewx,
int  viewy 
)

Sets the current display size. Must be called whenever a new display size was negotiated with the server.

Definition at line 577 of file mapdata.c.

Variable Documentation

struct Map the_map

Definition at line 121 of file mapdata.c.