Freeciv-3.1
|
Go to the source code of this file.
Macros | |
#define | MAX_LEN_MAPDEF 256 |
#define | SPECENUM_NAME mapimg_layer |
#define | SPECENUM_VALUE0 MAPIMG_LAYER_AREA |
#define | SPECENUM_VALUE0NAME "a" |
#define | SPECENUM_VALUE1 MAPIMG_LAYER_BORDERS |
#define | SPECENUM_VALUE1NAME "b" |
#define | SPECENUM_VALUE2 MAPIMG_LAYER_CITIES |
#define | SPECENUM_VALUE2NAME "c" |
#define | SPECENUM_VALUE3 MAPIMG_LAYER_FOGOFWAR |
#define | SPECENUM_VALUE3NAME "f" |
#define | SPECENUM_VALUE4 MAPIMG_LAYER_KNOWLEDGE |
#define | SPECENUM_VALUE4NAME "k" |
#define | SPECENUM_VALUE5 MAPIMG_LAYER_TERRAIN |
#define | SPECENUM_VALUE5NAME "t" |
#define | SPECENUM_VALUE6 MAPIMG_LAYER_UNITS |
#define | SPECENUM_VALUE6NAME "u" |
#define | SPECENUM_COUNT MAPIMG_LAYER_COUNT |
#define | SPECENUM_COUNTNAME "-" |
Typedefs | |
typedef enum known_type(* | mapimg_tile_known_func) (const struct tile *ptile, const struct player *pplayer, bool knowledge) |
typedef struct terrain *(* | mapimg_tile_terrain_func) (const struct tile *ptile, const struct player *pplayer, bool knowledge) |
typedef struct player *(* | mapimg_tile_player_func) (const struct tile *ptile, const struct player *pplayer, bool knowledge) |
typedef int(* | mapimg_plrcolor_count_func) (void) |
typedef struct rgbcolor *(* | mapimg_plrcolor_get_func) (int) |
#define SPECENUM_NAME mapimg_layer |
typedef struct rgbcolor *(* mapimg_plrcolor_get_func) (int) |
typedef enum known_type(* mapimg_tile_known_func) (const struct tile *ptile, const struct player *pplayer, bool knowledge) |
bool mapimg_colortest | ( | const char * | savename, |
const char * | path | ||
) |
Create images which shows all map colors (playercolor, terrain colors). One image is created for each supported toolkit and image format. The filename will be [basename as used for savegames]-colortest-[toolkit].[format].
Definition at line 1435 of file mapimg.c.
Referenced by mapimg_command().
int mapimg_count | ( | void | ) |
Return the number of map image definitions.
Definition at line 572 of file mapimg.c.
Referenced by mapimg_client_define(), mapimg_command(), mapimg_define(), mapimg_test(), sg_load_mapimg(), sg_load_mapimg(), sg_save_mapimg(), show_mapimg(), and srv_running().
bool mapimg_create | ( | struct mapdef * | pmapdef, |
bool | force, | ||
const char * | savename, | ||
const char * | path | ||
) |
Create the requested map image. The filename is created as [basename as used for savegames]-[mapstr].[mapext] where [mapstr] contains the map definition and [mapext] the selected image extension. If 'force' is FALSE, the image is only created if game.info.turn is a multiple of the map setting turns.
Definition at line 1331 of file mapimg.c.
Referenced by mapimg_client_createmap(), mapimg_command(), and srv_running().
Definition at line 768 of file mapimg.c.
Referenced by mapimg_client_define(), mapimg_command(), sg_load_mapimg(), and sg_load_mapimg().
bool mapimg_delete | ( | int | id | ) |
Delete a map image definition.
Definition at line 1203 of file mapimg.c.
Referenced by mapimg_client_define(), mapimg_command(), sg_load_mapimg(), and sg_load_mapimg().
const char * mapimg_error | ( | void | ) |
Returns the last error.
Definition at line 758 of file mapimg.c.
Referenced by mapimg_client_save(), mapimg_command(), and srv_running().
void mapimg_free | ( | void | ) |
Free all memory allocated by the map image subsystem.
Definition at line 557 of file mapimg.c.
Referenced by client_game_free(), and server_quit().
const char * mapimg_get_format_default | ( | void | ) |
const struct strvec * mapimg_get_format_list | ( | void | ) |
char * mapimg_help | ( | const char * | cmdname | ) |
bool mapimg_id2str | ( | int | id, |
char * | str, | ||
size_t | str_len | ||
) |
Return the map image definition 'id' as a mapdef string. This function is a wrapper for mapimg_def2str().
Definition at line 1310 of file mapimg.c.
Referenced by mapimg_command(), and sg_save_mapimg().
void mapimg_init | ( | mapimg_tile_known_func | mapimg_tile_known, |
mapimg_tile_terrain_func | mapimg_tile_terrain, | ||
mapimg_tile_player_func | mapimg_tile_owner, | ||
mapimg_tile_player_func | mapimg_tile_city, | ||
mapimg_tile_player_func | mapimg_tile_unit, | ||
mapimg_plrcolor_count_func | mapimg_plrcolor_count, | ||
mapimg_plrcolor_get_func | mapimg_plrcolor_get | ||
) |
Initialisation of the map image subsystem. The arguments are used to determine the map knowledge, the terrain type as well as the tile, city and unit owner.
Definition at line 505 of file mapimg.c.
Referenced by client_game_init(), and srv_prepare().
bool mapimg_initialised | ( | void | ) |
Check if the map image subsustem is initialised.
Definition at line 1552 of file mapimg.c.
Referenced by mapimg_count(), mapimg_define(), mapimg_free(), mapimg_init(), mapimg_reset(), and mapimg_test().
struct mapdef * mapimg_isvalid | ( | int | id | ) |
Check if a map image definition is valid. This function is a wrapper for mapimg_checkplayers().
Definition at line 1120 of file mapimg.c.
Referenced by mapimg_client_createmap(), mapimg_client_define(), mapimg_command(), and srv_running().
void mapimg_reset | ( | void | ) |
Reset the map image subsystem.
Definition at line 540 of file mapimg.c.
Referenced by client_game_reset(), mapimg_free(), and srv_main().
Show a map image definition.
Definition at line 1222 of file mapimg.c.
Referenced by mapimg_command(), and show_mapimg().