Crossfire Client, Branch  R11627
Data Structures | Defines | Functions | Variables
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
 The heads[] in the mapcell is used for single part objects or the head piece for multipart. More...
struct  MapCellLayer

Defines

#define MAP1_LAYERS   3
#define MAX_VIEW   64
 Maximum size of view area a server could support.
#define MAXLAYERS   10
 The protocol supports 10 layers, so set MAXLAYERS accordingly.

Functions

sint16 mapdata_bigface (int x, int y, int layer, int *ww, int *hh)
 Returns the face to display at a given location.
sint16 mapdata_face (int x, int y, int layer)
 Returns the face to display at a given location.
void mapdata_init (void)
 Initializes the module.
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).
void mapdata_newmap (void)
 Clears the map view.
void mapdata_reset (void)
 Resets all stored information.
void mapdata_scroll (int dx, int dy)
 Scrolls the map view.
void mapdata_set_size (int viewx, int viewy)
 Sets the current display size.

Variables

struct Map the_map

Define Documentation

#define MAP1_LAYERS   3

Definition at line 42 of file mapdata.h.

#define MAX_VIEW   64
#define MAXLAYERS   10

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.