Freeciv-3.3
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 charmapimg_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 wrap, 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 charimg_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 charbvplayers_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 charshowname_help (enum show_player showplr)
 
charmapimg_help (const char *cmdname)
 
const charmapimg_error (void)
 
bool mapimg_define (const char *maparg, bool check)
 
struct mapdefmapimg_isvalid (int id)
 
const struct strvecmapimg_get_format_list (void)
 
const charmapimg_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 427 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];
char * incite_cost
Definition comments.c:76
static const int img_toolkits_count
Definition mapimg.c:442
static struct toolkit img_toolkits[]
Definition mapimg.c:430

Definition at line 454 of file mapimg.c.

◆ img_toolkit_iterate_end

#define img_toolkit_iterate_end
Value:
} \
}

Definition at line 460 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 473 of file mapimg.c.

◆ MAPIMG_DEFAULT_IMGFORMAT

#define MAPIMG_DEFAULT_IMGFORMAT   IMGFORMAT_PPM

Definition at line 448 of file mapimg.c.

◆ MAPIMG_DEFAULT_IMGTOOL

#define MAPIMG_DEFAULT_IMGTOOL   IMGTOOL_PPM

Definition at line 449 of file mapimg.c.

◆ MAPIMG_LOG

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

Definition at line 471 of file mapimg.c.

◆ MAX_LEN_ERRORBUF

#define MAX_LEN_ERRORBUF   1024

Definition at line 465 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 894 of file mapimg.c.

◆ NUM_MAX_MAPARGS

#define NUM_MAX_MAPARGS   10

Define a map image.

Definition at line 767 of file mapimg.c.

◆ NUM_MAX_MAPOPTS

#define NUM_MAX_MAPOPTS   2

Definition at line 768 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]

Definition at line 231 of file mapimg.c.

◆ SPECENUM_NAME [2/5]

Definition at line 231 of file mapimg.c.

◆ SPECENUM_NAME [3/5]

Definition at line 231 of file mapimg.c.

◆ SPECENUM_NAME [4/5]

Definition at line 231 of file mapimg.c.

◆ SPECENUM_NAME [5/5]

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 416 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 2985 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 3221 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 2747 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 3264 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 3241 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 2419 of file mapimg.c.

Referenced by mapimg_create().

◆ img_destroy()

static void img_destroy ( struct img pimg)
static

Destroy a image.

Definition at line 1972 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 2388 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 1999 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  wrap,
int  xsize,
int  ysize 
)
static

Create a new image.

Definition at line 1876 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 2402 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 ploted.

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

Definition at line 2035 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 2048 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 2313 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 1984 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 1862 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 3326 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 3303 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 3343 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 1844 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 1810 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 1642 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 1441 of file mapimg.c.

Referenced by mapimg_command().

◆ mapimg_count()

int mapimg_count ( void  )

Return the number of map image definitions.

Definition at line 573 of file mapimg.c.

Referenced by mapimg_client_define(), mapimg_command(), mapimg_define(), mapimg_test(), save_all_map_images(), sg_load_mapimg(), sg_load_mapimg(), sg_save_mapimg(), and show_mapimg().

◆ 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 1335 of file mapimg.c.

Referenced by mapimg_client_createmap(), mapimg_command(), and save_all_map_images().

◆ 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 1582 of file mapimg.c.

Referenced by mapimg_id2str(), and mapimg_show().

◆ mapimg_define()

bool mapimg_define ( const char maparg,
bool  check 
)

Definition at line 769 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 895 of file mapimg.c.

Referenced by mapimg_define().

◆ mapimg_delete()

bool mapimg_delete ( int  id)

Delete a map image definition.

Definition at line 1207 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 759 of file mapimg.c.

Referenced by mapimg_client_save(), mapimg_command(), and save_all_map_images().

◆ mapimg_free()

void mapimg_free ( void  )

Free all memory allocated by the map image subsystem.

Definition at line 558 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 1737 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 1193 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 1156 of file mapimg.c.

◆ mapimg_help()

char * mapimg_help ( const char cmdname)

Return a help string for the 'mapimg' command.

Definition at line 603 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 1314 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 506 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 1558 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 1124 of file mapimg.c.

Referenced by mapimg_client_createmap(), mapimg_client_define(), mapimg_command(), and save_all_map_images().

◆ 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 1710 of file mapimg.c.

◆ mapimg_reset()

void mapimg_reset ( void  )

Reset the map image subsystem.

Definition at line 541 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 1226 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 1567 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 2890 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 3126 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 2666 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 2785 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 3022 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 2565 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 2851 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 3084 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 2624 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 2764 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 3003 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 2546 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 2826 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 3061 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 2601 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 585 of file mapimg.c.

Referenced by mapimg_help().

Variable Documentation

◆ error_buffer

char error_buffer[MAX_LEN_ERRORBUF] = "\0"
static

Definition at line 467 of file mapimg.c.

Referenced by mapimg_error(), and mapimg_log().

◆ img_toolkits

struct toolkit img_toolkits[]
static
Initial value:
= {
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:2313
#define GEN_TOOLKIT(_tool, _format_default, _formats, _save_func, _help)
Definition mapimg.c:427

Definition at line 430 of file mapimg.c.

◆ img_toolkits_count

const int img_toolkits_count = ARRAY_SIZE(img_toolkits)
static

Definition at line 442 of file mapimg.c.

◆ init

bool init

Definition at line 483 of file mapimg.c.

Referenced by audio_select_plugin().

◆ mapdef

Definition at line 484 of file mapimg.c.

◆ [struct]

struct { ... } mapimg

◆ mapimg_plrcolor_count

mapimg_plrcolor_count_func mapimg_plrcolor_count

Definition at line 491 of file mapimg.c.

Referenced by mapimg_init().

◆ mapimg_plrcolor_get

mapimg_plrcolor_get_func mapimg_plrcolor_get

Definition at line 492 of file mapimg.c.

Referenced by mapimg_init().

◆ mapimg_tile_city

mapimg_tile_player_func mapimg_tile_city

Definition at line 489 of file mapimg.c.

Referenced by mapimg_init().

◆ mapimg_tile_known

mapimg_tile_known_func mapimg_tile_known

Definition at line 486 of file mapimg.c.

Referenced by mapimg_init().

◆ mapimg_tile_owner

mapimg_tile_player_func mapimg_tile_owner

Definition at line 488 of file mapimg.c.

Referenced by mapimg_init().

◆ mapimg_tile_terrain

mapimg_tile_terrain_func mapimg_tile_terrain

Definition at line 487 of file mapimg.c.

Referenced by mapimg_init().

◆ mapimg_tile_unit

mapimg_tile_player_func mapimg_tile_unit

Definition at line 490 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().