Atrinik Client  4.0
Functions | Variables
region_map.c File Reference
#include <global.h>
#include <region_map.h>
#include <toolkit/string.h>
#include <toolkit/path.h>

Go to the source code of this file.

Functions

static region_map_def_tregion_map_def_new (void)
 
static void region_map_def_load (region_map_def_t *def, const char *str)
 
static void region_map_def_free (region_map_def_t *def)
 
static region_map_fow_tregion_map_fow_new (void)
 
static void region_map_fow_create (region_map_t *region_map)
 
static void region_map_fow_free (region_map_t *region_map)
 
static void region_map_fow_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_reset (region_map_t *region_map)
 
void region_map_update (region_map_t *region_map, const char *region_name)
 
bool region_map_ready (region_map_t *region_map)
 
region_map_def_map_tregion_map_find_map (region_map_t *region_map, const char *map_path)
 
SDL_Surface * region_map_surface (region_map_t *region_map)
 
void region_map_pan (region_map_t *region_map)
 
void region_map_resize (region_map_t *region_map, int adjust)
 
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_map, SDL_Surface *surface, int x, int y)
 
static bool region_map_fow_update_regions (region_map_t *region_map, const uint32_t *color)
 
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)
 
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)
 
SDL_Surface * region_map_fow_surface (region_map_t *region_map)
 

Variables

static UT_icd icd = {sizeof(region_map_fow_tile_t), NULL, NULL, NULL}
 

Detailed Description

Region map API.

Author
Alex Tokar

Definition in file region_map.c.

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.

static void region_map_def_free ( region_map_def_t def)
static

Frees data inside a region_map_def_t structure.

Note that the structure itself is not freed.

Parameters
defRegion map definitions structure.

Definition at line 623 of file region_map.c.

static void region_map_def_load ( region_map_def_t def,
const char *  str 
)
static

Loads region map definitions from a string.

Parameters
defDefinitions structure to load into.
strString to load from.

Definition at line 491 of file region_map.c.

static region_map_def_t * region_map_def_new ( void  )
static

Allocates a new ::region_map_def_t structure.

Returns
The allocated structure.

Definition at line 474 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.

static region_map_fow_t * region_map_fow_new ( void  )
static

Allocates a new region_map_fow_t structure.

Returns
The allocated structure.

Definition at line 678 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.