Crossfire Client, Trunk
mapdata.c File Reference
#include "client.h"
#include <assert.h>
#include <stdbool.h>
#include "external.h"
#include "mapdata.h"
+ Include dependency graph for mapdata.c:

Go to the source code of this file.

Data Structures

struct  BigCell
 

Macros

#define CURRENT_MAX_VIEW   33
 
#define FOG_BORDER_MIN   128
 
#define FOG_MAP_SIZE   512
 
#define MAX_FACE_SIZE   16
 

Functions

static void clear_cells (int x, int y, int len_y)
 
void clear_move_to ()
 
static void expand_clear_bigface (int x, int y, int w, int h, int layer, int set_need_update)
 
static void expand_clear_bigface_from_layer (int x, int y, int layer, int set_need_update)
 
static void expand_clear_face (int x, int y, int w, int h, int layer)
 
static void expand_clear_face_from_layer (int x, int y, int layer)
 
static void expand_need_update (int x, int y, int w, int h)
 
static void expand_need_update_from_layer (int x, int y, int layer)
 
static void expand_set_bigface (int x, int y, int layer, gint16 face, int clear)
 
static void expand_set_face (int x, int y, int layer, gint16 face, int clear)
 
bool is_at_moveto ()
 
static void mapdata_alloc (struct Map *const map, const int width, const int height)
 
void mapdata_animation (void)
 
gint16 mapdata_bigface (int x, int y, int layer, int *ww, int *hh)
 
gint16 mapdata_bigface_head (int x, int y, int layer, int *ww, int *hh)
 
bool mapdata_can_smooth (int x, int y, int layer)
 
struct MapCellmapdata_cell (const int x, const int y)
 
void mapdata_clear_old (int x, int y)
 
void mapdata_clear_space (int x, int y)
 
bool mapdata_contains (int x, int y)
 
gint16 mapdata_face (int x, int y, int layer)
 
gint16 mapdata_face_info (int mx, int my, int layer, int *dx, int *dy)
 
void mapdata_free (void)
 
static void mapdata_get_image_size (int face, guint8 *w, guint8 *h)
 
static bool mapdata_has_tile (int x, int y, int layer)
 
static void mapdata_init (void)
 
int mapdata_is_inside (int x, int y)
 
void mapdata_newmap (void)
 
void mapdata_scroll (int dx, int dy)
 
void mapdata_set_anim_layer (int x, int y, guint16 anim, guint8 anim_speed, int layer)
 
void mapdata_set_check_space (int x, int y)
 
void mapdata_set_darkness (int x, int y, int darkness)
 
void mapdata_set_face_layer (int x, int y, gint16 face, int layer)
 
void mapdata_set_size (int viewx, int viewy)
 
void mapdata_set_smooth (int x, int y, guint8 smooth, int layer)
 
void mapdata_size (int *x, int *y)
 
static void mark_resmooth (int x, int y, int layer)
 
void pl_mpos (int *px, int *py)
 
static void recenter_virtual_map_view (int diff_x, int diff_y)
 
void run_move_to ()
 
static void set_darkness (int x, int y, int darkness)
 
void set_move_to (int dx, int dy)
 

Variables

static struct BigCell bigfaces [MAX_VIEW][MAX_VIEW][MAXLAYERS]
 
static struct BigCellbigfaces_head
 
int global_offset_x = 0
 
int global_offset_y = 0
 
static int height
 
bool move_to_attack = false
 
int move_to_x = 0
 
int move_to_y = 0
 
PlayerPosition pl_pos
 
PlayerPosition script_pos
 
static struct Map the_map
 
int want_offset_x = 0
 
int want_offset_y = 0
 
static int width
 

Detailed Description

Map processing functions.

Definition in file mapdata.c.

Macro Definition Documentation

◆ CURRENT_MAX_VIEW

#define CURRENT_MAX_VIEW   33

Definition at line 63 of file mapdata.c.

◆ FOG_BORDER_MIN

#define FOG_BORDER_MIN   128

After shifting the virtual map: new minimum distance of the view area to the new virtual map border.

Definition at line 51 of file mapdata.c.

◆ FOG_MAP_SIZE

#define FOG_MAP_SIZE   512

Size of virtual map.

Definition at line 45 of file mapdata.c.

◆ MAX_FACE_SIZE

#define MAX_FACE_SIZE   16

Maximum size of a big face image in tiles. Larger faces will be clipped top/left.

Definition at line 56 of file mapdata.c.

Function Documentation

◆ clear_cells()

static void clear_cells ( int  x,
int  y,
int  len_y 
)
static

Clear cells the_map.cells[x][y..y+len_y-1].

Definition at line 119 of file mapdata.c.

References MapCell::heads, mapdata_cell(), MAXLAYERS, MapCellLayer::size_x, and MapCellLayer::size_y.

Referenced by mapdata_init(), mapdata_newmap(), and recenter_virtual_map_view().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clear_move_to()

void clear_move_to ( )

Definition at line 1478 of file mapdata.c.

References move_to_attack, move_to_x, and move_to_y.

Referenced by mapdata_newmap(), run_move_to(), and send_command().

+ Here is the caller graph for this function:

◆ expand_clear_bigface()

static void expand_clear_bigface ( int  x,
int  y,
int  w,
int  h,
int  layer,
int  set_need_update 
)
static

Clear a face from bigfaces[].

x, y, and layer are the coordinates and layer of the head relative to pl_pos.

w and h give the width and height of the face to clear.

If set_need_update is set, all affected tiles are marked as "need_update".

Definition at line 341 of file mapdata.c.

References bigfaces, MapCellLayer::face, MapCellTailLayer::face, BigCell::head, Map::height, height, mapdata_cell(), MAX_FACE_SIZE, MAX_VIEW, MAXLAYERS, MapCell::need_update, pl_pos, MapCellLayer::size_x, MapCellTailLayer::size_x, MapCellLayer::size_y, MapCellTailLayer::size_y, BigCell::tail, the_map, Map::width, width, PlayerPosition::x, and PlayerPosition::y.

Referenced by expand_clear_bigface_from_layer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ expand_clear_bigface_from_layer()

static void expand_clear_bigface_from_layer ( int  x,
int  y,
int  layer,
int  set_need_update 
)
static

Clear a face from bigfaces[].

x, y, and layer are the coordinates and layer of the head relative to pl_pos.

If set_need_update is set, all affected tiles are marked as "need_update".

Definition at line 395 of file mapdata.c.

References bigfaces, bigfaces_head, expand_clear_bigface(), MapCellLayer::face, BigCell::head, MAX_VIEW, MAXLAYERS, BigCell::next, BigCell::prev, MapCellLayer::size_x, and MapCellLayer::size_y.

Referenced by expand_set_bigface(), mapdata_newmap(), and mapdata_scroll().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ expand_clear_face()

static void expand_clear_face ( int  x,
int  y,
int  w,
int  h,
int  layer 
)
static

Clear a face from the_map.cells[].

x, y, and layer are the coordinates of the head and layer relative to pl_pos.

w and h give the width and height of the face to clear.

Definition at line 208 of file mapdata.c.

References MapCellLayer::animation, MapCellLayer::animation_left, MapCellLayer::animation_phase, MapCellLayer::animation_speed, MapCellLayer::face, MapCellTailLayer::face, MapCell::heads, Map::height, mapdata_cell(), mark_resmooth(), MAX_FACE_SIZE, MAXLAYERS, MapCell::need_resmooth, MapCell::need_update, MapCellLayer::size_x, MapCellTailLayer::size_x, MapCellLayer::size_y, MapCellTailLayer::size_y, MapCell::tails, the_map, and Map::width.

Referenced by expand_clear_face_from_layer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ expand_clear_face_from_layer()

static void expand_clear_face_from_layer ( int  x,
int  y,
int  layer 
)
static

Clear a face from the_map.cells[].

x, y, and layer are the coordinates of the head and layer relative to pl_pos.

Definition at line 263 of file mapdata.c.

References expand_clear_face(), MapCell::heads, Map::height, mapdata_cell(), MAXLAYERS, MapCellLayer::size_x, MapCellLayer::size_y, the_map, and Map::width.

Referenced by expand_set_face(), mapdata_animation(), mapdata_bigface(), mapdata_clear_old(), mapdata_set_anim_layer(), and mapdata_set_face_layer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ expand_need_update()

static void expand_need_update ( int  x,
int  y,
int  w,
int  h 
)
static

Mark a face as "need_update".

x and y are the coordinates of the head relative to pl_pos.

w and h is the size of the face.

Definition at line 506 of file mapdata.c.

References Map::height, mapdata_cell(), MAX_FACE_SIZE, MapCell::need_update, the_map, and Map::width.

Referenced by expand_need_update_from_layer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ expand_need_update_from_layer()

static void expand_need_update_from_layer ( int  x,
int  y,
int  layer 
)
static

Mark a face as "need_update".

x, y, and layer are the coordinates and layer of the head relative to pl_pos.

Definition at line 534 of file mapdata.c.

References expand_need_update(), MapCellLayer::face, MapCell::heads, Map::height, mapdata_cell(), MAXLAYERS, MapCellLayer::size_x, MapCellLayer::size_y, the_map, and Map::width.

Referenced by mapdata_clear_space(), and mapdata_set_check_space().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ expand_set_bigface()

static void expand_set_bigface ( int  x,
int  y,
int  layer,
gint16  face,
int  clear 
)
static

Update a face into bigfaces[].

x, y, and layer are the coordinates and layer of the head relative to pl_pos.

face is the new face to set.

Definition at line 441 of file mapdata.c.

References bigfaces, bigfaces_head, expand_clear_bigface_from_layer(), MapCellLayer::face, MapCellTailLayer::face, BigCell::head, Map::height, height, mapdata_cell(), mapdata_get_image_size(), MAX_FACE_SIZE, MAX_VIEW, MAXLAYERS, MapCell::need_update, BigCell::next, pl_pos, BigCell::prev, MapCellLayer::size_x, MapCellTailLayer::size_x, MapCellLayer::size_y, MapCellTailLayer::size_y, BigCell::tail, the_map, Map::width, width, PlayerPosition::x, and PlayerPosition::y.

Referenced by mapdata_animation(), mapdata_clear_space(), mapdata_set_anim_layer(), and mapdata_set_face_layer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ expand_set_face()

static void expand_set_face ( int  x,
int  y,
int  layer,
gint16  face,
int  clear 
)
static

Update a face into the_map.cells[].

x, y, and layer are the coordinates and layer of the head relative to pl_pos.

face is the new face to set. if clear is set, clear this face. If not set, don't clear. the reason clear may not be set is because this is an animation update - animations must all be the same size, so when we set the data for the space, we will just overwrite the old data. Problem with clearing is that clobbers the animation data.

Definition at line 290 of file mapdata.c.

References expand_clear_face_from_layer(), MapCellLayer::face, MapCellTailLayer::face, MapCell::heads, Map::height, mapdata_cell(), mapdata_get_image_size(), mark_resmooth(), MAX_FACE_SIZE, MAXLAYERS, MapCell::need_update, MapCellLayer::size_x, MapCellTailLayer::size_x, MapCellLayer::size_y, MapCellTailLayer::size_y, MapCell::tails, the_map, and Map::width.

Referenced by mapdata_animation(), mapdata_set_anim_layer(), and mapdata_set_face_layer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_at_moveto()

bool is_at_moveto ( )

Definition at line 1484 of file mapdata.c.

References move_to_x, move_to_y, and pl_mpos().

Referenced by gtk_map_redraw(), and run_move_to().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mapdata_alloc()

static void mapdata_alloc ( struct Map *const  map,
const int  width,
const int  height 
)
static

Allocate and set up pointers for a map, with cells represented as a C-style multi-dimensional array.

Definition at line 555 of file mapdata.c.

References height, map, and width.

Referenced by mapdata_init().

+ Here is the caller graph for this function:

◆ mapdata_animation()

◆ mapdata_bigface()

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

Return the face number of a multi-square pixmap at the given map tile.

Parameters
xX-coordinate of tile on-screen
yY-coordinate of tile on-screen
layer
ww
hh
Returns
Pixmap face number, or zero if the tile does not exist

Definition at line 1081 of file mapdata.c.

References bigfaces, MapCell::cleared, expand_clear_face_from_layer(), MapCellLayer::face, MapCellTailLayer::face, BigCell::head, MapCell::heads, height, mapdata_cell(), mapdata_has_tile(), MAX_FACE_SIZE, pl_pos, MapCellLayer::size_x, MapCellTailLayer::size_x, MapCellLayer::size_y, MapCellTailLayer::size_y, BigCell::tail, MapCell::tails, width, PlayerPosition::x, and PlayerPosition::y.

+ Here is the call graph for this function:

◆ mapdata_bigface_head()

gint16 mapdata_bigface_head ( int  x,
int  y,
int  layer,
int *  ww,
int *  hh 
)

Definition at line 1162 of file mapdata.c.

References bigfaces, MapCellLayer::face, BigCell::head, mapdata_has_tile(), MapCellLayer::size_x, and MapCellLayer::size_y.

+ Here is the call graph for this function:

◆ mapdata_can_smooth()

bool mapdata_can_smooth ( int  x,
int  y,
int  layer 
)

Definition at line 150 of file mapdata.c.

References MapCell::heads, mapdata_cell(), and MapCell::smooth.

Referenced by drawsmooth().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mapdata_cell()

◆ mapdata_clear_old()

void mapdata_clear_old ( int  x,
int  y 
)

Definition at line 798 of file mapdata.c.

References MapCell::cleared, MapCell::darkness, expand_clear_face_from_layer(), MapCell::have_darkness, Map::height, height, mapdata_cell(), MAX_VIEW, MAXLAYERS, pl_pos, the_map, Map::width, width, PlayerPosition::x, and PlayerPosition::y.

Referenced by Map2Cmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mapdata_clear_space()

void mapdata_clear_space ( int  x,
int  y 
)

Definition at line 644 of file mapdata.c.

References MapCell::cleared, expand_need_update_from_layer(), expand_set_bigface(), MapCell::heads, Map::height, height, mapdata_cell(), MAX_VIEW, MAXLAYERS, MapCell::need_update, pl_pos, the_map, Map::width, width, PlayerPosition::x, and PlayerPosition::y.

Referenced by Map2Cmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mapdata_contains()

bool mapdata_contains ( int  x,
int  y 
)

Determine whether the map data contains the given cell.

Definition at line 142 of file mapdata.c.

References Map::height, the_map, and Map::width.

Referenced by drawsmooth(), ExtSmooth(), and send_map().

+ Here is the caller graph for this function:

◆ mapdata_face()

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

Return the face number of a single-square pixmap at the given map tile.

Parameters
xX-coordinate of tile on-screen
yY-coordinate of tile on-screen
layer
Returns
Pixmap face number, or zero if the tile does not exist

Definition at line 1047 of file mapdata.c.

References MapCellLayer::face, MapCell::heads, BigCell::layer, mapdata_cell(), mapdata_has_tile(), pl_pos, BigCell::x, PlayerPosition::x, BigCell::y, and PlayerPosition::y.

+ Here is the call graph for this function:

◆ mapdata_face_info()

gint16 mapdata_face_info ( int  mx,
int  my,
int  layer,
int *  dx,
int *  dy 
)

Return the face number of the pixmap in the given map cell and set the offset pointers to indicate where to correctly draw the face. Offsets are zero for single-tile maps and negative for multi-tile maps. This provides a consistent way to draw tiles no matter single or multi part.

Parameters
mxVirtual map x-coordinate
myVirtual map y-coordinate
layerMap layer number
dxPointer to store x-offset
dyPointer to store y-offset
Returns
Pixmap face number, zero if the tile does not exist

Definition at line 1055 of file mapdata.c.

References MapCellLayer::face, MapCellTailLayer::face, MapCell::heads, height, mapdata_cell(), MapCellLayer::size_x, MapCellTailLayer::size_x, MapCellLayer::size_y, MapCellTailLayer::size_y, MapCell::tails, and width.

Referenced by map_draw_layer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mapdata_free()

void mapdata_free ( void  )

Deallocate map data. Do not call functions other than mapdata_set_size() after calling mapdata_free().

Definition at line 615 of file mapdata.c.

References Map::_cells, Map::height, the_map, and Map::width.

Referenced by mapdata_set_size(), and reset_vars_common().

+ Here is the caller graph for this function:

◆ mapdata_get_image_size()

static void mapdata_get_image_size ( int  face,
guint8 *  w,
guint8 *  h 
)
static

Return the size of a face in tiles. The returned size is at between 1 and MAX_FACE_SIZE (inclusive).

Definition at line 1348 of file mapdata.c.

References MapCellLayer::face, get_map_image_size(), and MAX_FACE_SIZE.

Referenced by expand_set_bigface(), and expand_set_face().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mapdata_has_tile()

static bool mapdata_has_tile ( int  x,
int  y,
int  layer 
)
static

Check if the given map tile is a valid slot in the map array.

Definition at line 1030 of file mapdata.c.

References height, BigCell::layer, MAXLAYERS, width, BigCell::x, and BigCell::y.

Referenced by mapdata_bigface(), mapdata_bigface_head(), and mapdata_face().

+ Here is the caller graph for this function:

◆ mapdata_init()

◆ mapdata_is_inside()

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 635 of file mapdata.c.

References height.

◆ mapdata_newmap()

void mapdata_newmap ( void  )

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

Definition at line 996 of file mapdata.c.

References bigfaces_head, clear_cells(), clear_move_to(), csocket, ClientSocket::dir, expand_clear_bigface_from_layer(), global_offset_x, global_offset_y, Map::height, BigCell::layer, mapdata_cell(), MapCell::need_update, script_pos, the_map, want_offset_x, want_offset_y, Map::width, BigCell::x, PlayerPosition::x, BigCell::y, and PlayerPosition::y.

Referenced by NewmapCmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mapdata_scroll()

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 919 of file mapdata.c.

References bigfaces_head, MapCell::cleared, CONFIG_MAPSCROLL, display_mapscroll(), expand_clear_bigface_from_layer(), BigCell::head, height, BigCell::layer, mapdata_cell(), MapCell::need_update, BigCell::next, pl_pos, recenter_virtual_map_view(), run_move_to(), script_pos, MapCellLayer::size_x, MapCellLayer::size_y, want_config, width, BigCell::x, PlayerPosition::x, BigCell::y, and PlayerPosition::y.

Referenced by Map2Cmd(), and map_scrollCmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mapdata_set_anim_layer()

◆ mapdata_set_check_space()

void mapdata_set_check_space ( int  x,
int  y 
)

◆ mapdata_set_darkness()

void mapdata_set_darkness ( int  x,
int  y,
int  darkness 
)

Definition at line 741 of file mapdata.c.

References MapCell::darkness, Map::height, height, MAX_VIEW, pl_pos, set_darkness(), the_map, Map::width, width, PlayerPosition::x, and PlayerPosition::y.

Referenced by Map2Cmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mapdata_set_face_layer()

void mapdata_set_face_layer ( int  x,
int  y,
gint16  face,
int  layer 
)

Definition at line 826 of file mapdata.c.

References MapCell::cleared, expand_clear_face_from_layer(), expand_set_bigface(), expand_set_face(), Map::height, height, mapdata_cell(), MAX_VIEW, MapCell::need_update, pl_pos, the_map, Map::width, width, PlayerPosition::x, and PlayerPosition::y.

Referenced by Map2Cmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mapdata_set_size()

void mapdata_set_size ( int  viewx,
int  viewy 
)

Initializes the module. Allocates memory for the_map. This functions must be called before any other function is used, and whenever a new display size was negotiated with the server.

Definition at line 624 of file mapdata.c.

References Map::height, height, mapdata_free(), mapdata_init(), pl_pos, the_map, Map::width, width, PlayerPosition::x, and PlayerPosition::y.

Referenced by SetupCmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mapdata_set_smooth()

void mapdata_set_smooth ( int  x,
int  y,
guint8  smooth,
int  layer 
)

Definition at line 764 of file mapdata.c.

References Map::height, mapdata_cell(), MAX_VIEW, MapCell::need_resmooth, pl_pos, MapCell::smooth, the_map, Map::width, PlayerPosition::x, and PlayerPosition::y.

Referenced by Map2Cmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mapdata_size()

void mapdata_size ( int *  x,
int *  y 
)

Determine the size of the internal fog-of-war map.

Definition at line 158 of file mapdata.c.

References Map::height, the_map, and Map::width.

Referenced by script_process_cmd().

+ Here is the caller graph for this function:

◆ mark_resmooth()

static void mark_resmooth ( int  x,
int  y,
int  layer 
)
static

Definition at line 187 of file mapdata.c.

References Map::height, mapdata_cell(), MapCell::need_resmooth, MapCell::smooth, the_map, and Map::width.

Referenced by expand_clear_face(), and expand_set_face().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pl_mpos()

void pl_mpos ( int *  px,
int *  py 
)

Compute player position in map coordinates. Unlike pl_pos.x and pl_pos.y which store the top left corner of the virtual map, this returns the actual position of the player.

Definition at line 1455 of file mapdata.c.

References CONFIG_MAPHEIGHT, CONFIG_MAPWIDTH, pl_pos, use_config, PlayerPosition::x, and PlayerPosition::y.

Referenced by is_at_moveto(), run_move_to(), and set_move_to().

+ Here is the caller graph for this function:

◆ recenter_virtual_map_view()

static void recenter_virtual_map_view ( int  diff_x,
int  diff_y 
)
static

Check if current map position is out of bounds if shifted by (dx, dy). If so, shift the virtual map so that the map view is within bounds again.

Assures that [pl_pos.x-MAX_FACE_SIZE..pl_pos.x+MAX_VIEW+1] is within the bounds of the virtual map area. This covers the area a map1a command may affect plus a one tile border.

Definition at line 1191 of file mapdata.c.

References clear_cells(), FOG_BORDER_MIN, Map::height, height, mapdata_cell(), MAX_FACE_SIZE, MAX_VIEW, pl_pos, the_map, Map::width, width, PlayerPosition::x, and PlayerPosition::y.

Referenced by mapdata_scroll().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ run_move_to()

void run_move_to ( )

Definition at line 1494 of file mapdata.c.

References clear_move_to(), is_at_moveto(), move_to_attack, move_to_x, move_to_y, pl_mpos(), relative_direction(), run_dir(), stop_run(), and walk_dir().

Referenced by map_button_event(), and mapdata_scroll().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_darkness()

static void set_darkness ( int  x,
int  y,
int  darkness 
)
static

Update darkness information. This function is called whenever a map1a command from the server was received.

x and y are absolute coordinates into the_map.cells[].

darkness is the new darkness value.

Definition at line 176 of file mapdata.c.

References MapCell::darkness, MapCell::have_darkness, mapdata_cell(), and MapCell::need_update.

Referenced by mapdata_set_darkness().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_move_to()

void set_move_to ( int  dx,
int  dy 
)

Definition at line 1462 of file mapdata.c.

References move_to_attack, move_to_x, move_to_y, and pl_mpos().

Referenced by map_button_event().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ bigfaces

struct BigCell bigfaces[MAX_VIEW][MAX_VIEW][MAXLAYERS]
static

The variable bigfaces[] contains information about big faces (faces with a width or height >1). The viewable area bigfaces[0..width-1][0..height-1] is unused.

Definition at line 112 of file mapdata.c.

Referenced by expand_clear_bigface(), expand_clear_bigface_from_layer(), expand_set_bigface(), mapdata_animation(), mapdata_bigface(), mapdata_bigface_head(), and mapdata_init().

◆ bigfaces_head

struct BigCell* bigfaces_head
static

Contains the head of a list of all currently active big faces outside the view area. All entries are part of bigfaces[].

Definition at line 105 of file mapdata.c.

Referenced by expand_clear_bigface_from_layer(), expand_set_bigface(), mapdata_init(), mapdata_newmap(), and mapdata_scroll().

◆ global_offset_x

int global_offset_x = 0

◆ global_offset_y

int global_offset_y = 0

◆ height

◆ move_to_attack

bool move_to_attack = false

Definition at line 40 of file mapdata.c.

Referenced by clear_move_to(), gtk_map_redraw(), run_move_to(), and set_move_to().

◆ move_to_x

int move_to_x = 0

Move to coordinates on the current map. (0, 0) means no destination.

Definition at line 39 of file mapdata.c.

Referenced by clear_move_to(), gtk_map_redraw(), is_at_moveto(), run_move_to(), and set_move_to().

◆ move_to_y

int move_to_y = 0

Definition at line 39 of file mapdata.c.

Referenced by clear_move_to(), gtk_map_redraw(), is_at_moveto(), run_move_to(), and set_move_to().

◆ pl_pos

◆ script_pos

PlayerPosition script_pos

Position of the player reported to client scripts. It resets to (0, 0) after a 'newmap' command.

Definition at line 36 of file mapdata.c.

Referenced by mapdata_newmap(), mapdata_scroll(), and script_process_cmd().

◆ the_map

◆ want_offset_x

int want_offset_x = 0

Definition at line 92 of file mapdata.c.

Referenced by mapdata_init(), mapdata_newmap(), predict_scroll(), and update_global_offset().

◆ want_offset_y

int want_offset_y = 0

Definition at line 93 of file mapdata.c.

Referenced by mapdata_init(), mapdata_newmap(), predict_scroll(), and update_global_offset().

◆ width