Atrinik Client 2.5
Defines | Functions | Variables
gui/region_map.c File Reference
#include <global.h>
#include <region_map.h>

Go to the source code of this file.

Defines

#define RM_TOOLTIP_HEIGHT   150

Functions

static region_map_structrm_def_get_map (const char *path)
static region_label_structrm_find_label (const char *name)
static region_map_tooltiprm_find_tooltip (const char *name)
static void rm_def_create (char *str)
static void rm_def_free ()
static int rm_label_in_cmd (const char *name)
static int rm_tooltip_in_cmd (const char *name)
static int region_map_is_same (const char *url)
void RegionMapCmd (uint8 *data, int len)
void region_map_clear ()
static void region_map_resize (int adjust)
void region_map_handle_key (SDLKey key)
void region_map_handle_event (SDL_Event *event)
void region_map_show ()

Variables

static curl_datadata_png = NULL
static curl_datadata_def = NULL
static SDL_Surface * region_map_png = NULL
static SDL_Surface * region_map_png_orig
static region_map_defrm_def = NULL
static char current_map [MAX_BUF]
static sint16 current_x
static sint16 current_y
static char ** cmd_labels = NULL
static size_t num_cmd_labels = 0
static char ** cmd_tooltips = NULL
static size_t num_cmd_tooltips = 0
static int region_map_zoom
static SDL_Rect region_map_pos
static uint32 region_mouse_ticks = 0

Detailed Description

The region map dialog.

Definition in file region_map.c.


Define Documentation

#define RM_TOOLTIP_HEIGHT   150

Height of the tooltip area of the bitmap.

Definition at line 68 of file region_map.c.


Function Documentation

void region_map_clear ( )

Clears the cached png and definitions.

Definition at line 530 of file region_map.c.

void region_map_handle_event ( SDL_Event *  event)

Handle mouse event.

Parameters:
eventThe event.

Definition at line 640 of file region_map.c.

void region_map_handle_key ( SDLKey  key)

Handle key press.

Parameters:
keyKey.

Definition at line 584 of file region_map.c.

static int region_map_is_same ( const char *  url) [static]

Check if the region map is the same as the one we already loaded previously.

Parameters:
urlURL of the region map image.
Returns:
1 if it's same, 0 otherwise.

Definition at line 386 of file region_map.c.

static void region_map_resize ( int  adjust) [static]

Resize the region map surface.

Parameters:
adjustHow much to zoom by.

Definition at line 551 of file region_map.c.

void region_map_show ( )

Show the region map menu.

Definition at line 670 of file region_map.c.

void RegionMapCmd ( uint8 data,
int  len 
)

Parse a region map command from the server.

Parameters:
dataData to parse.
lenLength of 'data'.

Definition at line 437 of file region_map.c.

static void rm_def_create ( char *  str) [static]

Initializes the map definitions from a string.

Parameters:
strString to initialize from.

Definition at line 130 of file region_map.c.

static void rm_def_free ( ) [static]

Free rm_def.

Definition at line 298 of file region_map.c.

static region_map_struct* rm_def_get_map ( const char *  path) [static]

Find a map by path in rm_def.

Parameters:
pathMap path to find.
Returns:
Pointer to the map if found, NULL otherwise.

Definition at line 74 of file region_map.c.

static region_label_struct* rm_find_label ( const char *  name) [static]

Find unique label name in rm_def.

Parameters:
nameLabel name to find.
Returns:
Pointer to the label if found, NULL otherwise.

Definition at line 93 of file region_map.c.

static region_map_tooltip* rm_find_tooltip ( const char *  name) [static]

Find unique tooltip name in rm_def.

Parameters:
nameTooltip name to find.
Returns:
Pointer to the tooltip if found, NULL otherwise.

Definition at line 112 of file region_map.c.

static int rm_label_in_cmd ( const char *  name) [static]

Check if the specified label name exists in cmd_labels.

Parameters:
nameLabel name to check for.
Returns:
1 if the label name exists in cmd_labels, 0 otherwise.

Definition at line 347 of file region_map.c.

static int rm_tooltip_in_cmd ( const char *  name) [static]

Check if the specified tooltip name exists in cmd_tooltips.

Parameters:
nameTooltip name to check for.
Returns:
1 if the tooltip name exists in cmd_tooltips, 0 otherwise.

Definition at line 366 of file region_map.c.


Variable Documentation

char** cmd_labels = NULL [static]

Array of label names parsed from the socket command.

Definition at line 53 of file region_map.c.

char** cmd_tooltips = NULL [static]

Array of tooltip names parsed from the socket command.

Definition at line 57 of file region_map.c.

char current_map[MAX_BUF] [static]

Path name of the map the player is on.

Definition at line 47 of file region_map.c.

sint16 current_x [static]

X position of the player.

Definition at line 49 of file region_map.c.

sint16 current_y [static]

Y position of the player.

Definition at line 51 of file region_map.c.

curl_data* data_def = NULL [static]

cURL data pointer to the downloaded map definitions text file.

Definition at line 36 of file region_map.c.

curl_data* data_png = NULL [static]

cURL data pointer to the downloaded map PNG.

Definition at line 34 of file region_map.c.

size_t num_cmd_labels = 0 [static]

Number of entries in cmd_labels.

Definition at line 55 of file region_map.c.

size_t num_cmd_tooltips = 0 [static]

Number of entries in cmd_tooltips.

Definition at line 59 of file region_map.c.

SDL_Surface* region_map_png = NULL [static]

Pointer to the currently displayed map surface.

Definition at line 38 of file region_map.c.

SDL_Surface* region_map_png_orig [static]

Pointer to the original map surface. This is same as region_map_png unless zoom is in effect, in which case region_map_png points to the zoomed surface.

Definition at line 43 of file region_map.c.

SDL_Rect region_map_pos [static]

Contains coordinates for the region map surface.

Definition at line 63 of file region_map.c.

int region_map_zoom [static]

Currently applied zoom.

Definition at line 61 of file region_map.c.

uint32 region_mouse_ticks = 0 [static]

Count for mouse clicks.

Definition at line 65 of file region_map.c.

region_map_def* rm_def = NULL [static]

Definitions parsed from data_def file.

Definition at line 45 of file region_map.c.