Atrinik Client  4.0
Data Structures | Macros | Typedefs | Functions
region_map.h File Reference
#include <toolkit/curl.h>

Go to the source code of this file.

Data Structures

struct  region_map_def_map
 
struct  region_map_def_label
 
struct  region_map_def_tooltip
 
struct  region_map_def
 
struct  region_map_fow_tile
 
struct  region_map_fow
 
struct  region_map
 

Macros

#define RM_ZOOM_DEFAULT   100
 
#define RM_ZOOM_MIN   50
 
#define RM_ZOOM_MAX   200
 
#define RM_ZOOM_PROGRESS   10
 
#define RM_MAP_FOW_BITMAP_SIZE(region_map)
 

Typedefs

typedef struct region_map_def_map region_map_def_map_t
 
typedef struct region_map_def_label region_map_def_label_t
 
typedef struct
region_map_def_tooltip 
region_map_def_tooltip_t
 
typedef struct region_map_def region_map_def_t
 
typedef struct region_map_fow_tile region_map_fow_tile_t
 
typedef struct region_map_fow region_map_fow_t
 
typedef struct region_map region_map_t
 

Functions

region_map_def_map_tregion_map_find_map (region_map_t *region_map, const char *map_path)
 
void region_map_resize (region_map_t *region_map, int adjust)
 
bool region_map_ready (region_map_t *region_map)
 
void region_map_pan (region_map_t *region_map)
 
void region_map_render_marker (region_map_t *region_map, SDL_Surface *surface, int x, int y)
 
void region_map_render_fow (region_map_t *region, SDL_Surface *surface, int x, int y)
 
SDL_Surface * region_map_surface (region_map_t *region_map)
 
void region_map_reset (region_map_t *region_map)
 
region_map_tregion_map_create (void)
 
region_map_tregion_map_clone (region_map_t *region_map)
 
void region_map_free (region_map_t *region_map)
 
void region_map_update (region_map_t *region_map, const char *region_name)
 
void region_map_fow_update (region_map_t *region_map)
 
bool region_map_fow_set_visited (region_map_t *region_map, region_map_def_map_t *map, const char *map_path, int x, int y)
 
SDL_Surface * region_map_fow_surface (region_map_t *region_map)
 
bool region_map_fow_is_visited (region_map_t *region_map, int x, int y)
 
bool region_map_fow_is_visible (region_map_t *region_map, int x, int y)
 

Detailed Description

Header file for the region map code.

Author
Alex Tokar

Definition in file region_map.h.

Macro Definition Documentation

#define RM_MAP_FOW_BITMAP_SIZE (   region_map)
Value:
(sizeof(*(region_map)->fow->bitmap) * \
(((region_map)->surface->w / (region_map)->def->pixel_size + 31) / 32) * \
((region_map)->surface->h / (region_map)->def->pixel_size))
static region_map_t * region_map
Definition: region_map.c:145

Definition at line 237 of file region_map.h.

#define RM_ZOOM_DEFAULT   100

Default zoom level.

Definition at line 38 of file region_map.h.

#define RM_ZOOM_MAX   200

Maximum zoom level.

Definition at line 42 of file region_map.h.

#define RM_ZOOM_MIN   50

Minimum zoom level.

Definition at line 40 of file region_map.h.

#define RM_ZOOM_PROGRESS   10

How much to progress the zoom level with a single mouse wheel event.

Definition at line 44 of file region_map.h.

Typedef Documentation

Single map label.

Single map.

Map tooltips.

Fog of war.

Tile entry array. Used as a buffer to store visited locations in the region while the region map is still being downloaded.

typedef struct region_map region_map_t

Region map structure.

Function Documentation

region_map_t* region_map_clone ( region_map_t region_map)

Clone a region map structure.

Parameters
region_map
Returns

Definition at line 73 of file region_map.c.

region_map_t* region_map_create ( void  )

Allocates and initializes a new region map structure.

Returns
Region map.

Definition at line 54 of file region_map.c.

region_map_def_map_t* region_map_find_map ( region_map_t region_map,
const char *  map_path 
)

Find a map identified by its path in the region map's definitions.

Parameters
region_mapRegion map to search in.
map_pathMap path to find.
Returns
Pointer to the map if found, NULL otherwise.

Definition at line 295 of file region_map.c.

SDL_Surface* region_map_fow_surface ( region_map_t region_map)

Get the region map fow image surface.

Parameters
region_mapRegion map.
Returns
Image surface, never NULL.

Definition at line 1025 of file region_map.c.

void region_map_free ( region_map_t region_map)

Frees a region map and all data associated with it.

Parameters
region_mapRegion map.

Definition at line 93 of file region_map.c.

bool region_map_ready ( region_map_t region_map)

Checks if the specified region map is ready to be rendered.

Parameters
region_mapRegion map.
Returns
Whether the region map is ready to be rendered.

Definition at line 200 of file region_map.c.

void region_map_render_marker ( region_map_t region_map,
SDL_Surface *  surface,
int  x,
int  y 
)

Render a region map marker, showing the player's position on the region map.

Parameters
region_mapRegion map.
surfaceWhere to render.
xX coordinate.
yY coordinate.

Definition at line 417 of file region_map.c.

void region_map_reset ( region_map_t region_map)

Resets data associated with the region map.

Parameters
region_mapRegion map.

Definition at line 110 of file region_map.c.

void region_map_resize ( region_map_t region_map,
int  adjust 
)

Resize the region map.

Parameters
region_mapRegion map to resize.
adjustHow much to zoom by.

Definition at line 362 of file region_map.c.

SDL_Surface* region_map_surface ( region_map_t region_map)

Get the region map image surface.

Parameters
region_mapRegion map.
Returns
Image surface, never NULL.

Definition at line 319 of file region_map.c.