Freeciv-3.1
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
mapimg.c File Reference
#include <stdarg.h>
#include "astring.h"
#include "bitvector.h"
#include "fc_cmdline.h"
#include "fcintl.h"
#include "log.h"
#include "mem.h"
#include "string_vector.h"
#include "timing.h"
#include "calendar.h"
#include "connection.h"
#include "fc_types.h"
#include "game.h"
#include "map.h"
#include "rgbcolor.h"
#include "terrain.h"
#include "tile.h"
#include "version.h"
#include "player.h"
#include "mapimg.h"
#include "specenum_gen.h"
#include "speclist.h"

Go to the source code of this file.

Data Structures

struct  tile_shape
 
struct  mapdef
 
struct  img
 
struct  toolkit
 

Macros

#define MagickLibInterface   0
 
#define MagickLibVersion   0
 
#define magickwand_size_t   unsigned long
 
#define TILE_SIZE   6
 
#define NUM_PIXEL   TILE_SIZE * TILE_SIZE
 
#define ARG_PLRBV   "plrbv"
 
#define ARG_PLRID   "plrid"
 
#define ARG_PLRNAME   "plrname"
 
#define SPECENUM_NAME   mapdef_arg
 
#define SPECENUM_VALUE0   MAPDEF_FORMAT
 
#define SPECENUM_VALUE0NAME   "format"
 
#define SPECENUM_VALUE1   MAPDEF_MAP
 
#define SPECENUM_VALUE1NAME   "map"
 
#define SPECENUM_VALUE2   MAPDEF_PLRBV
 
#define SPECENUM_VALUE2NAME   ARG_PLRBV
 
#define SPECENUM_VALUE3   MAPDEF_PLRID
 
#define SPECENUM_VALUE3NAME   ARG_PLRID
 
#define SPECENUM_VALUE4   MAPDEF_PLRNAME
 
#define SPECENUM_VALUE4NAME   ARG_PLRNAME
 
#define SPECENUM_VALUE5   MAPDEF_SHOW
 
#define SPECENUM_VALUE5NAME   "show"
 
#define SPECENUM_VALUE6   MAPDEF_TURNS
 
#define SPECENUM_VALUE6NAME   "turns"
 
#define SPECENUM_VALUE7   MAPDEF_ZOOM
 
#define SPECENUM_VALUE7NAME   "zoom"
 
#define SPECENUM_COUNT   MAPDEF_COUNT
 
#define SPECENUM_NAME   imageformat
 
#define SPECENUM_BITWISE
 
#define SPECENUM_VALUE0   IMGFORMAT_GIF
 
#define SPECENUM_VALUE0NAME   "gif"
 
#define SPECENUM_VALUE1   IMGFORMAT_PNG
 
#define SPECENUM_VALUE1NAME   "png"
 
#define SPECENUM_VALUE2   IMGFORMAT_PPM
 
#define SPECENUM_VALUE2NAME   "ppm"
 
#define SPECENUM_VALUE3   IMGFORMAT_JPG
 
#define SPECENUM_VALUE3NAME   "jpg"
 
#define SPECENUM_NAME   imagetool
 
#define SPECENUM_VALUE0   IMGTOOL_PPM
 
#define SPECENUM_VALUE0NAME   "ppm"
 
#define SPECENUM_VALUE1   IMGTOOL_MAGICKWAND
 
#define SPECENUM_VALUE1NAME   "magick"
 
#define SPECENUM_NAME   show_player
 
#define SPECENUM_VALUE0   SHOW_NONE
 
#define SPECENUM_VALUE0NAME   "none"
 
#define SPECENUM_VALUE1   SHOW_EACH
 
#define SPECENUM_VALUE1NAME   "each"
 
#define SPECENUM_VALUE2   SHOW_HUMAN
 
#define SPECENUM_VALUE2NAME   "human"
 
#define SPECENUM_VALUE3   SHOW_ALL
 
#define SPECENUM_VALUE3NAME   "all"
 
#define SPECENUM_VALUE4   SHOW_PLRNAME
 
#define SPECENUM_VALUE4NAME   ARG_PLRNAME
 
#define SPECENUM_VALUE5   SHOW_PLRID
 
#define SPECENUM_VALUE5NAME   ARG_PLRID
 
#define SPECENUM_VALUE6   SHOW_PLRBV
 
#define SPECENUM_VALUE6NAME   ARG_PLRBV
 
#define SPECENUM_NAME   mapimg_status
 
#define SPECENUM_VALUE0   MAPIMG_STATUS_UNKNOWN
 
#define SPECENUM_VALUE0NAME   _("not checked")
 
#define SPECENUM_VALUE1   MAPIMG_STATUS_OK
 
#define SPECENUM_VALUE1NAME   _("OK")
 
#define SPECENUM_VALUE2   MAPIMG_STATUS_ERROR
 
#define SPECENUM_VALUE2NAME   _("error")
 
#define MAX_LEN_MAPARG   MAX_LEN_MAPDEF
 
#define MAX_NUM_MAPIMG   10
 
#define SPECLIST_TAG   mapdef
 
#define SPECLIST_TYPE   struct mapdef
 
#define mapdef_list_iterate(mapdef_list, pmapdef)    TYPED_LIST_ITERATE(struct mapdef, mapdef_list, pmapdef)
 
#define mapdef_list_iterate_end    LIST_ITERATE_END
 
#define IMG_BORDER_HEIGHT   5
 
#define IMG_BORDER_WIDTH   IMG_BORDER_HEIGHT
 
#define IMG_SPACER_HEIGHT   5
 
#define IMG_LINE_HEIGHT   5
 
#define IMG_TEXT_HEIGHT   12
 
#define GEN_TOOLKIT(_tool, _format_default, _formats, _save_func, _help)    {_tool, _format_default, _formats, _save_func, _help},
 
#define MAPIMG_DEFAULT_IMGFORMAT   IMGFORMAT_PPM
 
#define MAPIMG_DEFAULT_IMGTOOL   IMGTOOL_PPM
 
#define img_toolkit_iterate(_toolkit)
 
#define img_toolkit_iterate_end
 
#define MAX_LEN_ERRORBUF   1024
 
#define MAPIMG_LOG(format, ...)    mapimg_log(__FILE__, __FUNCTION__, __FC_LINE__, format, ## __VA_ARGS__)
 
#define MAPIMG_ASSERT_RET_VAL(cond, expr)    fc_assert_action(cond, MAPIMG_LOG(_("internal error")); return (expr))
 
#define NUM_MAX_MAPARGS   10
 
#define NUM_MAX_MAPOPTS   2
 
#define NUM_MAX_FORMATARGS   2
 
#define SIZE_X   16
 
#define SIZE_Y   5
 

Typedefs

typedef bv_pixel(* plot_func) (const struct tile *ptile, const struct player *pplayer, bool knowledge)
 
typedef void(* base_coor_func) (struct img *pimg, int *base_x, int *base_y, int x, int y)
 
typedef bool(* img_save_func) (const struct img *pimg, const char *mapimgfile)
 

Enumerations

enum  img_special {
  IMGCOLOR_ERROR , IMGCOLOR_OCEAN , IMGCOLOR_GROUND , IMGCOLOR_BACKGROUND ,
  IMGCOLOR_TEXT
}
 

Functions

static const struct rgbcolorimgcolor_special (enum img_special imgcolor)
 
static const struct rgbcolorimgcolor_player (int plr_id)
 
static const struct rgbcolorimgcolor_terrain (const struct terrain *pterrain)
 
 BV_DEFINE (bv_pixel, NUM_PIXEL)
 
static bv_pixel pixel_tile_rect (const struct tile *ptile, const struct player *pplayer, bool knowledge)
 
static bv_pixel pixel_city_rect (const struct tile *ptile, const struct player *pplayer, bool knowledge)
 
static bv_pixel pixel_unit_rect (const struct tile *ptile, const struct player *pplayer, bool knowledge)
 
static bv_pixel pixel_fogofwar_rect (const struct tile *ptile, const struct player *pplayer, bool knowledge)
 
static bv_pixel pixel_border_rect (const struct tile *ptile, const struct player *pplayer, bool knowledge)
 
static void base_coor_rect (struct img *pimg, int *base_x, int *base_y, int x, int y)
 
static bv_pixel pixel_tile_hexa (const struct tile *ptile, const struct player *pplayer, bool knowledge)
 
static bv_pixel pixel_city_hexa (const struct tile *ptile, const struct player *pplayer, bool knowledge)
 
static bv_pixel pixel_unit_hexa (const struct tile *ptile, const struct player *pplayer, bool knowledge)
 
static bv_pixel pixel_fogofwar_hexa (const struct tile *ptile, const struct player *pplayer, bool knowledge)
 
static bv_pixel pixel_border_hexa (const struct tile *ptile, const struct player *pplayer, bool knowledge)
 
static void base_coor_hexa (struct img *pimg, int *base_x, int *base_y, int x, int y)
 
static bv_pixel pixel_tile_isohexa (const struct tile *ptile, const struct player *pplayer, bool knowledge)
 
static bv_pixel pixel_city_isohexa (const struct tile *ptile, const struct player *pplayer, bool knowledge)
 
static bv_pixel pixel_unit_isohexa (const struct tile *ptile, const struct player *pplayer, bool knowledge)
 
static bv_pixel pixel_fogofwar_isohexa (const struct tile *ptile, const struct player *pplayer, bool knowledge)
 
static bv_pixel pixel_border_isohexa (const struct tile *ptile, const struct player *pplayer, bool knowledge)
 
static void base_coor_isohexa (struct img *pimg, int *base_x, int *base_y, int x, int y)
 
 BV_DEFINE (bv_mapdef_arg, MAPDEF_COUNT)
 
static bool mapimg_test (int id)
 
static bool mapimg_define_arg (struct mapdef *pmapdef, enum mapdef_arg arg, const char *val, bool check)
 
static bool mapimg_def2str (struct mapdef *pmapdef, char *str, size_t str_len)
 
static bool mapimg_checkplayers (struct mapdef *pmapdef, bool recheck)
 
static char * mapimg_generate_name (struct mapdef *pmapdef)
 
static struct mapdefmapdef_new (bool colortest)
 
static void mapdef_destroy (struct mapdef *pmapdef)
 
static struct imgimg_new (struct mapdef *mapdef, int topo, int xsize, int ysize)
 
static void img_destroy (struct img *pimg)
 
static void img_set_pixel (struct img *pimg, const int mindex, const struct rgbcolor *pcolor)
 
static int img_index (const int x, const int y, const struct img *pimg)
 
static const char * img_playerstr (const struct player *pplayer)
 
static void img_plot (struct img *pimg, int x, int y, const struct rgbcolor *pcolor, const bv_pixel pixel)
 
static void img_plot_tile (struct img *pimg, const struct tile *ptile, const struct rgbcolor *pcolor, const bv_pixel pixel)
 
static bool img_save (const struct img *pimg, const char *mapimgfile, const char *path)
 
static bool img_save_ppm (const struct img *pimg, const char *mapimgfile)
 
static bool img_filename (const char *mapimgfile, enum imageformat format, char *filename, size_t filename_len)
 
static void img_createmap (struct img *pimg)
 
static const struct toolkitimg_toolkit_get (enum imagetool tool)
 
static void mapimg_log (const char *file, const char *function, int line, const char *format,...) fc__attribute((__format__(__printf__
 
static int bvplayers_count (const struct mapdef *pmapdef)
 
static const char * bvplayers_str (const bv_player plrbv)
 
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)
 
void mapimg_reset (void)
 
void mapimg_free (void)
 
int mapimg_count (void)
 
static const char * showname_help (enum show_player showplr)
 
char * mapimg_help (const char *cmdname)
 
const char * mapimg_error (void)
 
bool mapimg_define (const char *maparg, bool check)
 
struct mapdefmapimg_isvalid (int id)
 
const struct strvecmapimg_get_format_list (void)
 
const char * mapimg_get_format_default (void)
 
bool mapimg_delete (int id)
 
bool mapimg_show (int id, char *str, size_t str_len, bool detail)
 
bool mapimg_id2str (int id, char *str, size_t str_len)
 
bool mapimg_create (struct mapdef *pmapdef, bool force, const char *savename, const char *path)
 
bool mapimg_colortest (const char *savename, const char *path)
 
bool mapimg_initialised (void)
 

Variables

static struct tile_shape tile_rect
 
static struct tile_shape tile_hexa
 
static struct tile_shape tile_isohexa
 
static struct toolkit img_toolkits []
 
static const int img_toolkits_count = ARRAY_SIZE(img_toolkits)
 
static char error_buffer [MAX_LEN_ERRORBUF] = "\0"
 
struct { 
 
   bool   init 
 
   struct mapdef_list *   mapdef 
 
   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 
 
mapimg = { .init = FALSE
 

Macro Definition Documentation

◆ ARG_PLRBV

#define ARG_PLRBV   "plrbv"

Definition at line 226 of file mapimg.c.

◆ ARG_PLRID

#define ARG_PLRID   "plrid"

Definition at line 227 of file mapimg.c.

◆ ARG_PLRNAME

#define ARG_PLRNAME   "plrname"

Definition at line 228 of file mapimg.c.

◆ GEN_TOOLKIT

#define GEN_TOOLKIT (   _tool,
  _format_default,
  _formats,
  _save_func,
  _help 
)     {_tool, _format_default, _formats, _save_func, _help},

Definition at line 426 of file mapimg.c.

◆ IMG_BORDER_HEIGHT

#define IMG_BORDER_HEIGHT   5

Definition at line 361 of file mapimg.c.

◆ IMG_BORDER_WIDTH

#define IMG_BORDER_WIDTH   IMG_BORDER_HEIGHT

Definition at line 362 of file mapimg.c.

◆ IMG_LINE_HEIGHT

#define IMG_LINE_HEIGHT   5

Definition at line 364 of file mapimg.c.

◆ IMG_SPACER_HEIGHT

#define IMG_SPACER_HEIGHT   5

Definition at line 363 of file mapimg.c.

◆ IMG_TEXT_HEIGHT

#define IMG_TEXT_HEIGHT   12

Definition at line 365 of file mapimg.c.

◆ img_toolkit_iterate

#define img_toolkit_iterate (   _toolkit)
Value:
{ \
int _i; \
for (_i = 0; _i < img_toolkits_count; _i++) { \
const struct toolkit *_toolkit = &img_toolkits[_i];
static const int img_toolkits_count
Definition mapimg.c:441
static struct toolkit img_toolkits[]
Definition mapimg.c:429

Definition at line 453 of file mapimg.c.

◆ img_toolkit_iterate_end

#define img_toolkit_iterate_end
Value:
} \
}

Definition at line 459 of file mapimg.c.

◆ MagickLibInterface

#define MagickLibInterface   0

Definition at line 59 of file mapimg.c.

◆ MagickLibVersion

#define MagickLibVersion   0

Definition at line 62 of file mapimg.c.

◆ magickwand_size_t

#define magickwand_size_t   unsigned long

Definition at line 70 of file mapimg.c.

◆ mapdef_list_iterate

#define mapdef_list_iterate (   mapdef_list,
  pmapdef 
)     TYPED_LIST_ITERATE(struct mapdef, mapdef_list, pmapdef)

Definition at line 352 of file mapimg.c.

◆ mapdef_list_iterate_end

#define mapdef_list_iterate_end    LIST_ITERATE_END

Definition at line 354 of file mapimg.c.

◆ MAPIMG_ASSERT_RET_VAL

#define MAPIMG_ASSERT_RET_VAL (   cond,
  expr 
)     fc_assert_action(cond, MAPIMG_LOG(_("internal error")); return (expr))

Definition at line 472 of file mapimg.c.

◆ MAPIMG_DEFAULT_IMGFORMAT

#define MAPIMG_DEFAULT_IMGFORMAT   IMGFORMAT_PPM

Definition at line 447 of file mapimg.c.

◆ MAPIMG_DEFAULT_IMGTOOL

#define MAPIMG_DEFAULT_IMGTOOL   IMGTOOL_PPM

Definition at line 448 of file mapimg.c.

◆ MAPIMG_LOG

#define MAPIMG_LOG (   format,
  ... 
)     mapimg_log(__FILE__, __FUNCTION__, __FC_LINE__, format, ## __VA_ARGS__)

Definition at line 470 of file mapimg.c.

◆ MAX_LEN_ERRORBUF

#define MAX_LEN_ERRORBUF   1024

Definition at line 464 of file mapimg.c.

◆ MAX_LEN_MAPARG

#define MAX_LEN_MAPARG   MAX_LEN_MAPDEF

Definition at line 309 of file mapimg.c.

◆ MAX_NUM_MAPIMG

#define MAX_NUM_MAPIMG   10

Definition at line 310 of file mapimg.c.

◆ NUM_MAX_FORMATARGS

#define NUM_MAX_FORMATARGS   2

Helper function for mapimg_define().

Definition at line 890 of file mapimg.c.

◆ NUM_MAX_MAPARGS

#define NUM_MAX_MAPARGS   10

Define a map image.

Definition at line 766 of file mapimg.c.

◆ NUM_MAX_MAPOPTS

#define NUM_MAX_MAPOPTS   2

Definition at line 767 of file mapimg.c.

◆ NUM_PIXEL

#define NUM_PIXEL   TILE_SIZE * TILE_SIZE

Definition at line 89 of file mapimg.c.

◆ SIZE_X

#define SIZE_X   16

◆ SIZE_Y

#define SIZE_Y   5

◆ SPECENUM_BITWISE

#define SPECENUM_BITWISE

Definition at line 255 of file mapimg.c.

◆ SPECENUM_COUNT

#define SPECENUM_COUNT   MAPDEF_COUNT

Definition at line 248 of file mapimg.c.

◆ SPECENUM_NAME [1/5]

#define SPECENUM_NAME   mapdef_arg

Definition at line 231 of file mapimg.c.

◆ SPECENUM_NAME [2/5]

#define SPECENUM_NAME   imageformat

Definition at line 231 of file mapimg.c.

◆ SPECENUM_NAME [3/5]

#define SPECENUM_NAME   imagetool

Definition at line 231 of file mapimg.c.

◆ SPECENUM_NAME [4/5]

#define SPECENUM_NAME   show_player

Definition at line 231 of file mapimg.c.

◆ SPECENUM_NAME [5/5]

#define SPECENUM_NAME   mapimg_status

Definition at line 231 of file mapimg.c.

◆ SPECENUM_VALUE0 [1/5]

#define SPECENUM_VALUE0   MAPDEF_FORMAT

Definition at line 232 of file mapimg.c.

◆ SPECENUM_VALUE0 [2/5]

#define SPECENUM_VALUE0   IMGFORMAT_GIF

Definition at line 232 of file mapimg.c.

◆ SPECENUM_VALUE0 [3/5]

#define SPECENUM_VALUE0   IMGTOOL_PPM

Definition at line 232 of file mapimg.c.

◆ SPECENUM_VALUE0 [4/5]

#define SPECENUM_VALUE0   SHOW_NONE

Definition at line 232 of file mapimg.c.

◆ SPECENUM_VALUE0 [5/5]

#define SPECENUM_VALUE0   MAPIMG_STATUS_UNKNOWN

Definition at line 232 of file mapimg.c.

◆ SPECENUM_VALUE0NAME [1/5]

#define SPECENUM_VALUE0NAME   "format"

Definition at line 233 of file mapimg.c.

◆ SPECENUM_VALUE0NAME [2/5]

#define SPECENUM_VALUE0NAME   "gif"

Definition at line 233 of file mapimg.c.

◆ SPECENUM_VALUE0NAME [3/5]

#define SPECENUM_VALUE0NAME   "ppm"

Definition at line 233 of file mapimg.c.

◆ SPECENUM_VALUE0NAME [4/5]

#define SPECENUM_VALUE0NAME   "none"

Definition at line 233 of file mapimg.c.

◆ SPECENUM_VALUE0NAME [5/5]

#define SPECENUM_VALUE0NAME   _("not checked")

Definition at line 233 of file mapimg.c.

◆ SPECENUM_VALUE1 [1/5]

#define SPECENUM_VALUE1   MAPDEF_MAP

Definition at line 234 of file mapimg.c.

◆ SPECENUM_VALUE1 [2/5]

#define SPECENUM_VALUE1   IMGFORMAT_PNG

Definition at line 234 of file mapimg.c.

◆ SPECENUM_VALUE1 [3/5]

#define SPECENUM_VALUE1   IMGTOOL_MAGICKWAND

Definition at line 234 of file mapimg.c.

◆ SPECENUM_VALUE1 [4/5]

#define SPECENUM_VALUE1   SHOW_EACH

Definition at line 234 of file mapimg.c.

◆ SPECENUM_VALUE1 [5/5]

#define SPECENUM_VALUE1   MAPIMG_STATUS_OK

Definition at line 234 of file mapimg.c.

◆ SPECENUM_VALUE1NAME [1/5]

#define SPECENUM_VALUE1NAME   "map"

Definition at line 235 of file mapimg.c.

◆ SPECENUM_VALUE1NAME [2/5]

#define SPECENUM_VALUE1NAME   "png"

Definition at line 235 of file mapimg.c.

◆ SPECENUM_VALUE1NAME [3/5]

#define SPECENUM_VALUE1NAME   "magick"

Definition at line 235 of file mapimg.c.

◆ SPECENUM_VALUE1NAME [4/5]

#define SPECENUM_VALUE1NAME   "each"

Definition at line 235 of file mapimg.c.

◆ SPECENUM_VALUE1NAME [5/5]

#define SPECENUM_VALUE1NAME   _("OK")

Definition at line 235 of file mapimg.c.

◆ SPECENUM_VALUE2 [1/4]

#define SPECENUM_VALUE2   MAPDEF_PLRBV

Definition at line 236 of file mapimg.c.

◆ SPECENUM_VALUE2 [2/4]

#define SPECENUM_VALUE2   IMGFORMAT_PPM

Definition at line 236 of file mapimg.c.

◆ SPECENUM_VALUE2 [3/4]

#define SPECENUM_VALUE2   SHOW_HUMAN

Definition at line 236 of file mapimg.c.

◆ SPECENUM_VALUE2 [4/4]

#define SPECENUM_VALUE2   MAPIMG_STATUS_ERROR

Definition at line 236 of file mapimg.c.

◆ SPECENUM_VALUE2NAME [1/4]

#define SPECENUM_VALUE2NAME   ARG_PLRBV

Definition at line 237 of file mapimg.c.

◆ SPECENUM_VALUE2NAME [2/4]

#define SPECENUM_VALUE2NAME   "ppm"

Definition at line 237 of file mapimg.c.

◆ SPECENUM_VALUE2NAME [3/4]

#define SPECENUM_VALUE2NAME   "human"

Definition at line 237 of file mapimg.c.

◆ SPECENUM_VALUE2NAME [4/4]

#define SPECENUM_VALUE2NAME   _("error")

Definition at line 237 of file mapimg.c.

◆ SPECENUM_VALUE3 [1/3]

#define SPECENUM_VALUE3   MAPDEF_PLRID

Definition at line 238 of file mapimg.c.

◆ SPECENUM_VALUE3 [2/3]

#define SPECENUM_VALUE3   IMGFORMAT_JPG

Definition at line 238 of file mapimg.c.

◆ SPECENUM_VALUE3 [3/3]

#define SPECENUM_VALUE3   SHOW_ALL

Definition at line 238 of file mapimg.c.

◆ SPECENUM_VALUE3NAME [1/3]

#define SPECENUM_VALUE3NAME   ARG_PLRID

Definition at line 239 of file mapimg.c.

◆ SPECENUM_VALUE3NAME [2/3]

#define SPECENUM_VALUE3NAME   "jpg"

Definition at line 239 of file mapimg.c.

◆ SPECENUM_VALUE3NAME [3/3]

#define SPECENUM_VALUE3NAME   "all"

Definition at line 239 of file mapimg.c.

◆ SPECENUM_VALUE4 [1/2]

#define SPECENUM_VALUE4   MAPDEF_PLRNAME

Definition at line 240 of file mapimg.c.

◆ SPECENUM_VALUE4 [2/2]

#define SPECENUM_VALUE4   SHOW_PLRNAME

Definition at line 240 of file mapimg.c.

◆ SPECENUM_VALUE4NAME [1/2]

#define SPECENUM_VALUE4NAME   ARG_PLRNAME

Definition at line 241 of file mapimg.c.

◆ SPECENUM_VALUE4NAME [2/2]

#define SPECENUM_VALUE4NAME   ARG_PLRNAME

Definition at line 241 of file mapimg.c.

◆ SPECENUM_VALUE5 [1/2]

#define SPECENUM_VALUE5   MAPDEF_SHOW

Definition at line 242 of file mapimg.c.

◆ SPECENUM_VALUE5 [2/2]

#define SPECENUM_VALUE5   SHOW_PLRID

Definition at line 242 of file mapimg.c.

◆ SPECENUM_VALUE5NAME [1/2]

#define SPECENUM_VALUE5NAME   "show"

Definition at line 243 of file mapimg.c.

◆ SPECENUM_VALUE5NAME [2/2]

#define SPECENUM_VALUE5NAME   ARG_PLRID

Definition at line 243 of file mapimg.c.

◆ SPECENUM_VALUE6 [1/2]

#define SPECENUM_VALUE6   MAPDEF_TURNS

Definition at line 244 of file mapimg.c.

◆ SPECENUM_VALUE6 [2/2]

#define SPECENUM_VALUE6   SHOW_PLRBV

Definition at line 244 of file mapimg.c.

◆ SPECENUM_VALUE6NAME [1/2]

#define SPECENUM_VALUE6NAME   "turns"

Definition at line 245 of file mapimg.c.

◆ SPECENUM_VALUE6NAME [2/2]

#define SPECENUM_VALUE6NAME   ARG_PLRBV

Definition at line 245 of file mapimg.c.

◆ SPECENUM_VALUE7

#define SPECENUM_VALUE7   MAPDEF_ZOOM

Definition at line 246 of file mapimg.c.

◆ SPECENUM_VALUE7NAME

#define SPECENUM_VALUE7NAME   "zoom"

Definition at line 247 of file mapimg.c.

◆ SPECLIST_TAG

#define SPECLIST_TAG   mapdef

Definition at line 348 of file mapimg.c.

◆ SPECLIST_TYPE

#define SPECLIST_TYPE   struct mapdef

Definition at line 349 of file mapimg.c.

◆ TILE_SIZE

#define TILE_SIZE   6

Definition at line 88 of file mapimg.c.

Typedef Documentation

◆ base_coor_func

typedef void(* base_coor_func) (struct img *pimg, int *base_x, int *base_y, int x, int y)

Definition at line 103 of file mapimg.c.

◆ img_save_func

typedef bool(* img_save_func) (const struct img *pimg, const char *mapimgfile)

Definition at line 415 of file mapimg.c.

◆ plot_func

typedef bv_pixel(* plot_func) (const struct tile *ptile, const struct player *pplayer, bool knowledge)

Definition at line 100 of file mapimg.c.

Enumeration Type Documentation

◆ img_special

Enumerator
IMGCOLOR_ERROR 
IMGCOLOR_OCEAN 
IMGCOLOR_GROUND 
IMGCOLOR_BACKGROUND 
IMGCOLOR_TEXT 

Definition at line 74 of file mapimg.c.

Function Documentation

◆ base_coor_hexa()

static void base_coor_hexa ( struct img pimg,
int *  base_x,
int *  base_y,
int  x,
int  y 
)
static

Base coordinates for the tiles on a hexa topology,

Definition at line 2978 of file mapimg.c.

Referenced by img_new().

◆ base_coor_isohexa()

static void base_coor_isohexa ( struct img pimg,
int *  base_x,
int *  base_y,
int  x,
int  y 
)
static

Base coordinates for the tiles on a isometric hexa topology,

Definition at line 3214 of file mapimg.c.

Referenced by img_new().

◆ base_coor_rect()

static void base_coor_rect ( struct img pimg,
int *  base_x,
int *  base_y,
int  x,
int  y 
)
static

Base coordinates for the tiles on a (isometric) rectange topology,

Definition at line 2740 of file mapimg.c.

Referenced by img_new().

◆ BV_DEFINE() [1/2]

BV_DEFINE ( bv_mapdef_arg  ,
MAPDEF_COUNT   
)

◆ BV_DEFINE() [2/2]

BV_DEFINE ( bv_pixel  ,
NUM_PIXEL   
)

◆ bvplayers_count()

static int bvplayers_count ( const struct mapdef pmapdef)
static

Return the number of players defined in a map image definition.

Definition at line 3257 of file mapimg.c.

Referenced by img_createmap().

◆ bvplayers_str()

static const char * bvplayers_str ( const bv_player  plrbv)
static

Convert the player bitvector to a string.

Definition at line 3234 of file mapimg.c.

Referenced by mapimg_def2str(), and mapimg_show().

◆ img_createmap()

static void img_createmap ( struct img pimg)
static

Create the map considering the options (terrain, player(s), cities, units, borders, known, fogofwar, ...).

Definition at line 2412 of file mapimg.c.

Referenced by mapimg_create().

◆ img_destroy()

static void img_destroy ( struct img pimg)
static

Destroy a image.

Definition at line 1965 of file mapimg.c.

Referenced by mapimg_colortest(), and mapimg_create().

◆ img_filename()

static bool img_filename ( const char *  mapimgfile,
enum imageformat  format,
char *  filename,
size_t  filename_len 
)
static

Generate the final filename.

Definition at line 2381 of file mapimg.c.

Referenced by img_save_ppm().

◆ img_index()

static int img_index ( const int  x,
const int  y,
const struct img pimg 
)
inlinestatic

Get the index for an (x,y) image coordinate.

Definition at line 1992 of file mapimg.c.

Referenced by get_city_sprite(), img_plot(), and img_save_ppm().

◆ img_new()

static struct img * img_new ( struct mapdef mapdef,
int  topo,
int  xsize,
int  ysize 
)
static

Create a new image.

Definition at line 1870 of file mapimg.c.

Referenced by mapimg_colortest(), and mapimg_create().

◆ img_playerstr()

static const char * img_playerstr ( const struct player pplayer)
static

Return a definition string for the player.

Definition at line 2395 of file mapimg.c.

Referenced by img_save_ppm().

◆ img_plot()

static void img_plot ( struct img pimg,
int  x,
int  y,
const struct rgbcolor pcolor,
const bv_pixel  pixel 
)
static

Plot one tile at (x,y). Only the pixel of the tile set within 'pixel' are plotted.

Definition at line 2005 of file mapimg.c.

Referenced by img_plot_tile(), and mapimg_colortest().

◆ img_plot_tile()

static void img_plot_tile ( struct img pimg,
const struct tile ptile,
const struct rgbcolor pcolor,
const bv_pixel  pixel 
)
static

Plot one tile. Only the pixel of the tile set within 'pixel' are plotted.

Definition at line 2028 of file mapimg.c.

Referenced by img_createmap().

◆ img_save()

static bool img_save ( const struct img pimg,
const char *  mapimgfile,
const char *  path 
)
static

Save an image as ppm file.

Definition at line 2041 of file mapimg.c.

Referenced by mapimg_colortest(), and mapimg_create().

◆ img_save_ppm()

static bool img_save_ppm ( const struct img pimg,
const char *  mapimgfile 
)
static

Save an image using magickwand as toolkit. This allows different file formats.

Image structure:

[ 0] border [+IMG_BORDER_HEIGHT] title [+ IMG_TEXT_HEIGHT] space (only if count(displayed players) > 0) [+IMG_SPACER_HEIGHT] player line (only if count(displayed players) > 0) [+ IMG_LINE_HEIGHT] space [+IMG_SPACER_HEIGHT] map [+ map_height] border [+IMG_BORDER_HEIGHT] Save an image as ppm file (toolkit: ppm).

Definition at line 2306 of file mapimg.c.

◆ img_set_pixel()

static void img_set_pixel ( struct img pimg,
const int  mindex,
const struct rgbcolor pcolor 
)
inlinestatic

Set the color of one pixel.

Definition at line 1977 of file mapimg.c.

Referenced by img_plot().

◆ img_toolkit_get()

static const struct toolkit * img_toolkit_get ( enum imagetool  tool)
static

Return the definition of the requested toolkit (or NULL).

Definition at line 1856 of file mapimg.c.

Referenced by img_save(), mapimg_colortest(), mapimg_define_arg(), mapimg_get_format_list(), and mapimg_help().

◆ imgcolor_player()

static const struct rgbcolor * imgcolor_player ( int  plr_id)
static

Return rgbcolor for player.

FIXME: nearly identical with get_player_color() in colors_common.c.

Definition at line 3319 of file mapimg.c.

Referenced by img_createmap(), and img_playerstr().

◆ imgcolor_special()

static const struct rgbcolor * imgcolor_special ( enum img_special  imgcolor)
static

Return rgbcolor for img_special

Definition at line 3296 of file mapimg.c.

Referenced by img_createmap(), img_save_ppm(), imgcolor_player(), imgcolor_terrain(), and mapimg_colortest().

◆ imgcolor_terrain()

static const struct rgbcolor * imgcolor_terrain ( const struct terrain pterrain)
static

Return rgbcolor for terrain.

FIXME: nearly identical with get_terrain_color() in colors_common.c.

Definition at line 3336 of file mapimg.c.

Referenced by img_createmap(), and mapimg_colortest().

◆ mapdef_destroy()

static void mapdef_destroy ( struct mapdef pmapdef)
static

Destroy a map image definition.

Definition at line 1838 of file mapimg.c.

Referenced by mapimg_colortest(), mapimg_define(), mapimg_help(), and mapimg_reset().

◆ mapdef_new()

static struct mapdef * mapdef_new ( bool  colortest)
static

Create a new map image definition with default values.

Definition at line 1804 of file mapimg.c.

Referenced by mapimg_colortest(), mapimg_define(), and mapimg_help().

◆ mapimg_checkplayers()

static bool mapimg_checkplayers ( struct mapdef pmapdef,
bool  recheck 
)
static

Check the player selection. This needs to be done before each image creation call (see mapimg_create()) to test that the selection is still valid as players can be added or removed during the game.

Definition at line 1636 of file mapimg.c.

Referenced by mapimg_create(), and mapimg_isvalid().

◆ mapimg_colortest()

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().

◆ mapimg_count()

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().

◆ mapimg_create()

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().

◆ mapimg_def2str()

static bool mapimg_def2str ( struct mapdef pmapdef,
char *  str,
size_t  str_len 
)
static

Return a mapdef string for the map image definition given by 'pmapdef'.

Definition at line 1576 of file mapimg.c.

Referenced by mapimg_id2str(), and mapimg_show().

◆ mapimg_define()

bool mapimg_define ( const char *  maparg,
bool  check 
)

Definition at line 768 of file mapimg.c.

Referenced by mapimg_client_define(), mapimg_command(), sg_load_mapimg(), and sg_load_mapimg().

◆ mapimg_define_arg()

static bool mapimg_define_arg ( struct mapdef pmapdef,
enum mapdef_arg  arg,
const char *  val,
bool  check 
)
static

Definition at line 891 of file mapimg.c.

Referenced by mapimg_define().

◆ mapimg_delete()

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().

◆ mapimg_error()

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().

◆ mapimg_free()

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().

◆ mapimg_generate_name()

static char * mapimg_generate_name ( struct mapdef pmapdef)
static

Generate an identifier for a map image.

M[map options]Z[zoom factor]P[players]

[map options] map options [zoom factor] zoom factor [players] player ID or vector of size MAX_NUM_PLAYER_SLOTS [0/1]

For the player bitvector all MAX_NUM_PLAYER_SLOTS values are used due to the possibility of additional players during the game (civil war, barbarians).

Definition at line 1731 of file mapimg.c.

Referenced by mapimg_create(), and mapimg_show().

◆ mapimg_get_format_default()

const char * mapimg_get_format_default ( void  )

Return the default value of the toolkit and the image format for the client.

Definition at line 1189 of file mapimg.c.

◆ mapimg_get_format_list()

const struct strvec * mapimg_get_format_list ( void  )

Return a list of all available toolkits and formats for the client.

Definition at line 1152 of file mapimg.c.

◆ mapimg_help()

char * mapimg_help ( const char *  cmdname)

Return a help string for the 'mapimg' command.

Definition at line 602 of file mapimg.c.

◆ mapimg_id2str()

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().

◆ mapimg_init()

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().

◆ mapimg_initialised()

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().

◆ mapimg_isvalid()

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().

◆ mapimg_log()

static void mapimg_log ( const char *  file,
const char *  function,
int  line,
const char *  format,
  ... 
)
static

Edit the error_buffer. Strings should not have a terminating period.

Definition at line 1704 of file mapimg.c.

◆ mapimg_reset()

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().

◆ mapimg_show()

bool mapimg_show ( int  id,
char *  str,
size_t  str_len,
bool  detail 
)

Show a map image definition.

Definition at line 1222 of file mapimg.c.

Referenced by mapimg_command(), and show_mapimg().

◆ mapimg_test()

static bool mapimg_test ( int  id)
static

Check if the map image subsystem is initialised and the given ID is valid. In case of an error, the error message is saved via MAPIMG_LOG().

Definition at line 1561 of file mapimg.c.

Referenced by mapimg_delete(), mapimg_id2str(), mapimg_isvalid(), and mapimg_show().

◆ pixel_border_hexa()

static bv_pixel pixel_border_hexa ( const struct tile ptile,
const struct player pplayer,
bool  knowledge 
)
static

[W] 0 1 [N] 2 – – 5 6 – – – – 11 [SW] 12 – – – – 17 [NE] 18 – – – – 23 24 – – – – 29 30 – – 33 [S] 34 35 [E]

Definition at line 2883 of file mapimg.c.

Referenced by img_new().

◆ pixel_border_isohexa()

static bv_pixel pixel_border_isohexa ( const struct tile ptile,
const struct player pplayer,
bool  knowledge 
)
static
        [N]

[NW] 0 1 2 3 [E] 4 – – – – 9 10 – – – – – – 17 18 – – – – – – 25 26 – – – – 31 [W] 32 33 34 35 [SE]

         [S]

Definition at line 3119 of file mapimg.c.

Referenced by img_new().

◆ pixel_border_rect()

static bv_pixel pixel_border_rect ( const struct tile ptile,
const struct player pplayer,
bool  knowledge 
)
static
       [N]

 0  1  2  3  3  5
 6 -- -- -- -- 11

[W] 12 – – – – 17 [E] 18 – – – – 23 24 – – – – 29 30 31 32 33 34 35

   [S]

Definition at line 2659 of file mapimg.c.

Referenced by img_new().

◆ pixel_city_hexa()

static bv_pixel pixel_city_hexa ( const struct tile ptile,
const struct player pplayer,
bool  knowledge 
)
static
  -- --

– 3 4 – – 7 8 9 10 – – 13 14 15 16 – – 19 20 21 22 – – 25 26 27 28 – – 31 32 –


Definition at line 2778 of file mapimg.c.

Referenced by img_new().

◆ pixel_city_isohexa()

static bv_pixel pixel_city_isohexa ( const struct tile ptile,
const struct player pplayer,
bool  knowledge 
)
static
  -- -- -- --

– 5 6 7 8 – – 11 12 13 14 15 16 – – 19 20 21 22 23 24 – – 27 28 29 30 –


Definition at line 3015 of file mapimg.c.

Referenced by img_new().

◆ pixel_city_rect()

static bv_pixel pixel_city_rect ( const struct tile ptile,
const struct player pplayer,
bool  knowledge 
)
static

– 7 8 9 10 – – 13 14 15 16 – – 19 20 21 22 – – 25 26 27 28 –


Definition at line 2558 of file mapimg.c.

Referenced by img_new().

◆ pixel_fogofwar_hexa()

static bv_pixel pixel_fogofwar_hexa ( const struct tile ptile,
const struct player pplayer,
bool  knowledge 
)
static
   0 --

– 3 – 5 – 7 – 9 – 11 – 13 – 15 – 17 18 – 20 – 22 – 24 – 26 – 28 – 30 – 32 – – 35

Definition at line 2844 of file mapimg.c.

Referenced by img_new().

◆ pixel_fogofwar_isohexa()

static bv_pixel pixel_fogofwar_isohexa ( const struct tile ptile,
const struct player pplayer,
bool  knowledge 
)
static
   0  1 -- --
4 -- --  7  8 --

– – 12 13 – – 16 17 18 19 – – 22 23 – – – 27 28 – – 31 – – 34 35

Definition at line 3077 of file mapimg.c.

Referenced by img_new().

◆ pixel_fogofwar_rect()

static bv_pixel pixel_fogofwar_rect ( const struct tile ptile,
const struct player pplayer,
bool  knowledge 
)
static

0 – 2 – 4 – – 7 – 9 – 11 12 – 14 – 16 – – 19 – 21 – 23 24 – 26 – 28 – – 31 – 33 – 35

Definition at line 2617 of file mapimg.c.

Referenced by img_new().

◆ pixel_tile_hexa()

static bv_pixel pixel_tile_hexa ( const struct tile ptile,
const struct player pplayer,
bool  knowledge 
)
static
   0  1
2  3  4  5

6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35

Definition at line 2757 of file mapimg.c.

Referenced by img_new().

◆ pixel_tile_isohexa()

static bv_pixel pixel_tile_isohexa ( const struct tile ptile,
const struct player pplayer,
bool  knowledge 
)
static
   0  1  2  3
4  5  6  7  8  9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35

Definition at line 2996 of file mapimg.c.

Referenced by img_new().

◆ pixel_tile_rect()

static bv_pixel pixel_tile_rect ( const struct tile ptile,
const struct player pplayer,
bool  knowledge 
)
static

0 1 2 3 3 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35

Definition at line 2539 of file mapimg.c.

Referenced by img_new().

◆ pixel_unit_hexa()

static bv_pixel pixel_unit_hexa ( const struct tile ptile,
const struct player pplayer,
bool  knowledge 
)
static
  -- --


– – 14 15 – – – – 20 21 – –




Definition at line 2819 of file mapimg.c.

Referenced by img_new().

◆ pixel_unit_isohexa()

static bv_pixel pixel_unit_isohexa ( const struct tile ptile,
const struct player pplayer,
bool  knowledge 
)
static
  -- -- -- --

– – – 13 14 – – – – – – 21 22 – – –



Definition at line 3054 of file mapimg.c.

Referenced by img_new().

◆ pixel_unit_rect()

static bv_pixel pixel_unit_rect ( const struct tile ptile,
const struct player pplayer,
bool  knowledge 
)
static


– – 14 15 – – – – 20 21 – –



Definition at line 2594 of file mapimg.c.

Referenced by img_new().

◆ showname_help()

static const char * showname_help ( enum show_player  showplr)
static

Describe the 'show' settings.

Definition at line 584 of file mapimg.c.

Referenced by mapimg_help().

Variable Documentation

◆ error_buffer

char error_buffer[MAX_LEN_ERRORBUF] = "\0"
static

Definition at line 466 of file mapimg.c.

Referenced by mapimg_error(), and mapimg_log().

◆ img_toolkits

struct toolkit img_toolkits[]
static
Initial value:
= {
GEN_TOOLKIT(IMGTOOL_PPM, IMGFORMAT_PPM, IMGFORMAT_PPM,
N_("Standard ppm files"))
}
#define N_(String)
Definition fcintl.h:69
static bool img_save_ppm(const struct img *pimg, const char *mapimgfile)
Definition mapimg.c:2306
#define GEN_TOOLKIT(_tool, _format_default, _formats, _save_func, _help)
Definition mapimg.c:426

Definition at line 429 of file mapimg.c.

◆ img_toolkits_count

const int img_toolkits_count = ARRAY_SIZE(img_toolkits)
static

Definition at line 441 of file mapimg.c.

◆ init

bool init

Definition at line 482 of file mapimg.c.

Referenced by audio_select_plugin().

◆ mapdef

struct mapdef_list* mapdef

Definition at line 483 of file mapimg.c.

◆ [struct]

struct { ... } mapimg

◆ mapimg_plrcolor_count

mapimg_plrcolor_count_func mapimg_plrcolor_count

Definition at line 490 of file mapimg.c.

Referenced by mapimg_init().

◆ mapimg_plrcolor_get

mapimg_plrcolor_get_func mapimg_plrcolor_get

Definition at line 491 of file mapimg.c.

Referenced by mapimg_init().

◆ mapimg_tile_city

mapimg_tile_player_func mapimg_tile_city

Definition at line 488 of file mapimg.c.

Referenced by mapimg_init().

◆ mapimg_tile_known

mapimg_tile_known_func mapimg_tile_known

Definition at line 485 of file mapimg.c.

Referenced by mapimg_init().

◆ mapimg_tile_owner

mapimg_tile_player_func mapimg_tile_owner

Definition at line 487 of file mapimg.c.

Referenced by mapimg_init().

◆ mapimg_tile_terrain

mapimg_tile_terrain_func mapimg_tile_terrain

Definition at line 486 of file mapimg.c.

Referenced by mapimg_init().

◆ mapimg_tile_unit

mapimg_tile_player_func mapimg_tile_unit

Definition at line 489 of file mapimg.c.

Referenced by mapimg_init().

◆ tile_hexa

struct tile_shape tile_hexa
static
Initial value:
= {
.x = {
2, 3,
1, 2, 3, 4,
0, 1, 2, 3, 4, 5,
0, 1, 2, 3, 4, 5,
0, 1, 2, 3, 4, 5,
0, 1, 2, 3, 4, 5,
1, 2, 3, 4,
2, 3,
},
.y = {
0, 0,
1, 1, 1, 1,
2, 2, 2, 2, 2, 2,
3, 3, 3, 3, 3, 3,
4, 4, 4, 4, 4, 4,
5, 5, 5, 5, 5, 5,
6, 6, 6, 6,
7, 7,
}
}

Definition at line 145 of file mapimg.c.

Referenced by img_new().

◆ tile_isohexa

struct tile_shape tile_isohexa
static
Initial value:
= {
.x = {
2, 3, 4, 5,
1, 2, 3, 4, 5, 6,
0, 1, 2, 3, 4, 5, 6, 7,
0, 1, 2, 3, 4, 5, 6, 7,
1, 2, 3, 4, 5, 6,
2, 3, 4, 5
},
.y = {
0, 0, 0, 0,
1, 1, 1, 1, 1, 1,
2, 2, 2, 2, 2, 2, 2, 2,
3, 3, 3, 3, 3, 3, 3, 3,
4, 4, 4, 4, 4, 4,
5, 5, 5, 5
}
}

Definition at line 187 of file mapimg.c.

Referenced by img_new().

◆ tile_rect

struct tile_shape tile_rect
static
Initial value:
= {
.x = {
0, 1, 2, 3, 4, 5,
0, 1, 2, 3, 4, 5,
0, 1, 2, 3, 4, 5,
0, 1, 2, 3, 4, 5,
0, 1, 2, 3, 4, 5,
0, 1, 2, 3, 4, 5
},
.y = {
0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1,
2, 2, 2, 2, 2, 2,
3, 3, 3, 3, 3, 3,
4, 4, 4, 4, 4, 4,
5, 5, 5, 5, 5, 5
}
}

Definition at line 107 of file mapimg.c.

Referenced by img_new().