Crossfire Server, Branch 1.12  R12190
Data Structures | Defines | Typedefs | Enumerations | Functions | Variables
mapper.c File Reference

This program generates map browsing web pages. More...

#include <time.h>
#include <stdio.h>
#include <strings.h>
#include <global.h>
#include <sproto.h>
#include <image.h>
#include <gd.h>
#include <gdfonts.h>
#include <gdfontl.h>
#include <gdfontg.h>
Include dependency graph for mapper.c:

Go to the source code of this file.

Data Structures

struct  struct_equipment
 One special item (weapon, shield, ...). More...
struct  struct_map_in_quest
 Link between a quest and a map. More...
struct  struct_map_in_quest_list
 Utility structure to group map-quest link structure. More...
struct  struct_map_info
 Map information. More...
struct  struct_map_list
 List of maps. More...
struct  struct_npc_info
 Information about a NPC with a custom message. More...
struct  struct_npc_list
 List of NPCs with a custom message. More...
struct  struct_quest
 One quest. More...
struct  struct_race
 One monster race in the maps. More...
struct  struct_race_list
 Collection of races. More...
struct  struct_region_info
 Region information. More...
struct  struct_slaying_info
 slaying information. More...

Defines

#define S_CONNECT   4
#define S_CONTAINER   2
#define S_DETECTOR   3
#define S_DOOR   0
 Connection/slaying information.
#define S_KEY   1
#define S_MAX   5
#define SIZE   50
#define VARSADD   6

Typedefs

typedef struct struct_equipment struct_equipment
 One special item (weapon, shield, ...).
typedef struct struct_map_in_quest struct_map_in_quest
 Link between a quest and a map.
typedef struct struct_map_info struct_map_info
 Map information.
typedef struct struct_npc_info struct_npc_info
 Information about a NPC with a custom message.
typedef struct struct_npc_list struct_npc_list
 List of NPCs with a custom message.
typedef struct struct_quest struct_quest
 One quest.
typedef struct struct_race struct_race
 One monster race in the maps.
typedef struct struct_race_list struct_race_list
 Collection of races.
typedef struct struct_region_info struct_region_info
 Region information.

Enumerations

enum  output_format_type { OF_PNG = 0, OF_JPG = 1 }
 Map output formats. More...

Functions

static void add_map (struct_map_info *info, struct_map_list *list)
 Adds a map to specified array, if it isn't already.
static void add_map_to_quest (struct_map_info *map, const char *name, const char *description)
 Links a map to a quest.
static void add_map_to_region (struct_map_info *map, region *reg)
 Links a map to a region.
static void add_map_to_slaying (struct_slaying_info *info, int item, struct_map_info *map)
 Adds the specified map to the slaying information if not already present.
static void add_monster (object *monster, struct_map_info *map)
 Adds a monster to the monster list.
static void add_npc_to_map (struct_map_info *map, const object *npc)
 Link the specified NPC to the specified map.
static void add_one_item (object *item, struct_map_info *map)
 Adds an item to the list of special items.
static void add_race_to_list (struct_race *race, struct_race_list *list, int check)
 Appends a race to a race list.
static void add_region_link (mapstruct *source, mapstruct *dest, const char *linkname)
 Creates a link between two maps if they are on different regions.
static void add_slaying (struct_map_info *map, object *item)
 Adds the item's information to the map.
static void add_to_struct_map_in_quest_list (struct_map_in_quest_list *list, struct_map_in_quest *item)
int auto_apply (object *op)
 Map was just loaded, handle op's initialisation.
static char * cat_template (char *source, char *add)
 Concatenates a string, and free concatenated string.
static void check_equipment (object *item, struct_map_info *map)
 Checks if item and its inventory are worthy to be listed.
static void check_slaying_inventory (struct_map_info *map, object *item)
 Recursively checks if the object should be considered for slaying information.
void clean_tmp_files (void)
 Remove temporary map files.
static int compare_map_info (const struct_map_info *left, const struct_map_info *right)
 Compares struct_map_info according to the map name or the path if equal.
static void create_destination (void)
 Ensures destination directory exists.
static struct_map_infocreate_map_info (void)
 Returns an initialised struct_map_info.
static struct_npc_infocreate_npc_info (const object *npc)
 Create the struct_npc_info from the specified NPC.
static struct_map_infocreate_tiled_map (void)
 Create a new tiled map and link it to the tiled map list.
static void define_quest (const char *name, struct_map_info *mainmap, const char *description)
 Sets the main map for a quest.
void do_auto_apply (mapstruct *m)
static void do_exit_map (mapstruct *map)
 Proceses exit / road / blocking information for specified map into the global infomap map.
static void do_help (const char *program)
 Prints usage information, and exit.
static char * do_map_index (const char *dest, struct_map_list *maps_list, const char *template_page, const char *template_letter, const char *template_map, const char **vars, const char **values)
 Creates the page for a map index.
static void do_parameters (int argc, char **argv)
 Handles command-line parameters.
static char * do_template (const char *template, const char **vars, const char **values)
 Processes a template.
static void do_tiled_map_picture (struct_map_info *map)
 Generates the large and small pictures for a tiled map.
void dragon_ability_gain (object *ob, int x, int y)
 When a dragon-player gains a new stage of evolution, he gets some treasure.
void draw_ext_info (int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *txt, const char *txt2)
 Dummy functions to link the library.
void draw_ext_info_format (int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *new_format, const char *old_format,...)
 Sends message to player(s).
static void dump_unused_maps (void)
 Writes the list of unused maps, maps found in the directories but not linked from the other maps.
void emergency_save (int x)
 Save all players.
static struct_equipmentensure_unique (struct_equipment *item)
 Searches the item list for an identical item, except maps.
void esrv_del_item (player *pl, int tag)
 Tells the client to delete an item.
void esrv_send_item (object *ob, object *obx)
 Sends item's info to player.
void esrv_update_item (int flags, object *pl, object *op)
 Updates object *op for player *pl.
void esrv_update_spells (player *pl)
 This looks for any spells the player may have that have changed their stats.
int execute_event (object *op, int eventcode, object *activator, object *third, const char *message, int fix)
int execute_global_event (int eventcode,...)
void ext_info_map (int color, const mapstruct *map, uint8 type, uint8 subtype, const char *str1, const char *str2)
 Writes to everyone on the specified map.
static void find_maps (const char *from)
 Recursively find all all maps in a directory.
object * find_skill_by_number (object *who, int skillno)
 This returns the skill pointer of the given name (the one that accumlates exp, has the level, etc).
void fix_auto_apply (mapstruct *m)
 Go through the entire map (only the first time when an original map is loaded) and performs special actions for certain objects (most initialization of chests and creation of treasures and stuff).
static void fix_exits_for_map (struct_map_info *current, struct_map_list *from, int is_from)
 Changes for the list all maps to the tiled map they are part of, if applicable.
static void fix_exits_to_tiled_maps (void)
 Changes all exits to maps in a tiled map to point directly to the tiled map.
static void fix_map_names (void)
 Ensures all maps have a name (if there was a limit to map processing, some maps will have a NULL name which causes issues).
static void fix_tiled_map (void)
 Ensures all tiled maps have a name, a region, a filename and a path.
static void fix_tiled_map_monsters (void)
 Makes all monsters point to tiled maps instead of map when appliable, and merge map monster to tiled map.
static void free_equipment (struct_equipment *equip)
 Frees a struct_equipment.
static int get_elevation_color (int elevation, gdImagePtr elevationmap)
 Gets the color for an elevation.
static struct_equipmentget_equipment (void)
 Gets an empty struct_equipment.
static struct_map_infoget_map_info (const char *path)
 Gets or creates if required the info structure for a map.
static struct_questget_quest_info (const char *name)
 Gets the information for a quest, create the field if needed.
static struct_raceget_race (const char *name)
 Returns the race for specified name.
static struct_slaying_infoget_slaying_struct (const char *slaying)
 Returns a struct_slaying_info for specified slaying.
static void init_map_list (struct_map_list *list)
 Initialises a list structure.
static void init_npc_list (struct_npc_list *list)
 Initialise a list of NPCs.
static void init_race_list (struct_race_list *list)
 Blanks a struct_race_list.
static void init_struct_map_in_quest_list (struct_map_in_quest_list *list)
static int is_blocking (object *item)
 Checks if item blocks movement or not.
static int is_road (object *item)
 Checks if ::object is considered a road or not.
static int is_slaying (object *item)
 Is the slaying field relevant for this item?
static int is_special_equipment (object *item)
static void list_map (const char *path)
 Marks specified path as processed.
int main (int argc, char **argv)
 Main entry point.
static void merge_tiled_maps (struct_map_info *map, int tile, struct_map_info *tiled_map)
 Merge two tiled maps groups.
void monster_check_apply (object *ob, object *obt)
void move_firewall (object *ob)
 Move for FIREWALL.
static void process_map (struct_map_info *info)
 Processes a map.
static void process_map_lore (struct_map_info *map)
 Extracts from the map's lore quest information if found.
static void read_template (const char *name, char **buffer)
 Reads a file in memory.
static void relative_path (const char *from, const char *to, char *result)
 Computes the shortest path from one file to another.
static void replace_map (struct_map_info *find, struct_map_info *replace_by, struct_map_list *list)
 Replaces a map in a map list.
static void save_picture (FILE *file, gdImagePtr pic)
 Saves a map to a file, based on jpg/png settings.
void set_darkness_map (mapstruct *m)
 Set the darkness level for a map, based on the time of the day.
static int sort_equipment (const void *a, const void *b)
 Sort 2 struct_equipment, first on item power then name.
static int sort_map_info (const void *left, const void *right)
 Sorts the struct_map_info according to the map name or the path if equal.
static int sort_map_info_by_level (const void *left, const void *right)
 Sorts the struct_map_info according to the map's level, and if equal the name or the path.
static int sort_mapname (const void *left, const void *right)
 Sorts the strings according to the last part of the filename (after the last /).
static int sort_race (const void *a, const void *b)
 Sort 2 struct_race.
static int sort_region (const void *left, const void *right)
 Sorts an array of struct_region_info by region name.
static int sort_slaying (const void *left, const void *right)
 Helper function to sort an array of struct_slaying_info.
static int sort_struct_map_in_quest (const void *left, const void *right)
 Sorts 2 struct_map_in_quest, on the map's name or path.
static int sortbyname (const void *a, const void *b)
 Sort values alphabetically Used by qsort to sort values alphabetically.
static int tiled_map_need_pic (struct_map_info *map)
void trap_adjust (object *ob, int x)
 Adjust trap difficulty to the map.
static void write_all_maps (void)
 Ensures all maps have a name, and writes all map pages.
static void write_all_regions (void)
 Generates all map indexes for a region.
static void write_equipment_index (void)
 Writes the item page.
static void write_map_page (struct_map_info *map)
 Write a map page.
static void write_maps_by_level (void)
 Outputs the list of maps sorted by level.
static void write_maps_index (void)
 Generates global map index, file maps.html.
static void write_npc_list (void)
 Write the list of all found NPCs in maps.
static void write_one_slaying_info (FILE *file, struct_slaying_info *info, int item, const char *with, const char *without)
 Writes all maps of the specified slaying information.
static void write_quests_page (void)
 Writes the global quests page.
static void write_race_index (void)
 Writes the monster information page.
static void write_region_index (void)
 Generates region index.
static void write_region_page (struct_region_info *reg)
 Generates the web page for a region.
static void write_regions_link (void)
 Write the .dot file representing links between regions.
static void write_slaying_info (void)
 Writes all slaying info to file.
static void write_slaying_map_name (FILE *file, struct_map_info *map)
 Helper function to write a map to a file with its link and full path.
static void write_tiled_map_page (struct_map_info *map)
 Writes the page for a tiled map group.
static void write_tiled_maps (void)
 Outputs all tiled map pages.
static void write_world_info (void)
 Writes the exit information world map.
static void write_world_map (void)
 Generates a big world map.
static const char * yesno (int value)
 Helper to write yes/no.

Variables

static int cached_pics = 0
 Non recreated pics.
static int color_blocking
 Block all movement.
static int color_linked_exit
 Exit leading to another map.
static int color_road
 Road or equivalent.
static int color_slowing
 Slows movement.
static int color_unlinked_exit
 Color for exits without a path set.
static int created_pics = 0
 Picture statistics.
static int do_regions_link = 0
static int ** elevation_info
 All elevation spots in the "world_" maps.
static int elevation_max
 Lowest elevation found.
static int elevation_min
 Maximal elevation found.
static int equipment_allocated = 0
 Allocated items in special_equipment.
static int equipment_count = 0
 Number of items in special_equipment.
static int force_pics = 0
 To force picture regeneration even if map didn't change.
static char ** found_maps = NULL
 Maps found in directories.
static int found_maps_allocated = 0
 Allocated size of found_maps.
static int found_maps_count = 0
 Number of items in found_maps.
static gdImagePtr * gdfaces
static int generate_index = 1
 Whether to do the map index or not.
static int generate_pics = 1
 Whether to generate the picture or not.
static const char * ignore_name []
 File names to ignore for map search.
static const char * ignore_path []
 Directories to ignore for map search.
static char * index_letter
 Index page template: one letter, including the maps it contains.
static char * index_map
 Index page template: one map.
static char * index_quest_template
static char * index_region_region_template
 One region in the region index template.
static char * index_region_template
 Region index template.
static char * index_template
 Index page template.
static gdImagePtr infomap
 World map with exits / roads / blocking / ...
static int jpeg_quality = -1
 Quality for jpg pictures.
static char * level_map_template
static char * level_template
static char * level_value_template
static int list_unused_maps = 0
 If set, program will list maps found in directory but not linked from the first maps.
static char * map_exit_template
 Map template: one exit.
static char * map_exit_to_template
 Map template: one exit leading to this map.
static int map_limit = -1
 Maximum number of maps to browse, -1 for all.
static char * map_lore_template
 Map template: lore.
static char * map_monster_after_template
 Map template: after the monster list.
static char * map_monster_before_template
 Map template: before the monster list.
static char * map_monster_between_template
 Map template: between each monster.
static char * map_monster_one_template
 Map template: one monster.
static char * map_no_exit_template
 World map template: no exit.
static char * map_no_exit_to_template
 World map template: no exit leading to this map.
static char * map_no_lore_template
 Map template: no lore.
static char * map_no_monster_template
 Map template: no monster.
static char * map_no_quest_template
static char * map_one_quest_template
static char * map_template
 Map template.
static char * map_with_exit_template
 Map template: exit template.
static char * map_with_exit_to_template
 Map template: exits leading to this map.
static char * map_with_quests_template
static struct_map_list maps_list
 Maps to process or found.
int nrofpixmaps
 nrofpixmaps is the number of bitmaps loaded.
static const char * output_extensions []
 Extensions depending on output format.
static enum output_format_type output_format = OF_PNG
 Selected output format.
static int pics_allocated
 Number of created pictures for GD.
static char * quest_map_template
static char * quest_template
static struct_quest ** quests = NULL
 All quests in the game.
static int quests_allocated = 0
 Allocated items in quests.
static int quests_count = 0
 Count of quests.
static struct_race_list races
 Monsters found in maps.
static int rawmaps = 0
 Whether to generate raw pics or instancied ones.
static int region_allocated = 0
 Allocated size of regions.
static int region_count = 0
 Count of regions.
static char * region_letter_template
 One letter for the region.
static char * region_map_template
 Region page template: one map.
static char * region_template
 Region page template.
static struct struct_region_info ** regions = NULL
 Found regions.
static char ** regions_link
static int regions_link_allocated = 0
static int regions_link_count = 0
static char root [500]
 Path to store generated files.
static int show_maps = 0
 If set, will generate much information on map loaded.
static int size_small = 16
 Tile size for small map.
static int slaying_allocated = 0
 Allocated size of slaying_info.
static int slaying_count = 0
 Count of items in slaying_info.
static struct_slaying_info ** slaying_info = NULL
 Found slaying fields.
static struct_equipment ** special_equipment = NULL
 Special equipment list.
static struct_map_list tiled_map_list
 Pseudo-maps grouping other maps.
static int tileset = 0
 Tileset to use to generate pics.
static int warn_no_path = 0
 Whether to warn of exits without a path.
static int world_exit_info = 1
 If set, will generate a world map of exits.
static int world_map = 1
 If set, will generate a world map.
static char * world_map_template
 One map in a row.
static char * world_row_template
 One row in the world map.
static char * world_template
 World map template.

Detailed Description

This program generates map browsing web pages.

Quick run: without arguments, will make sensible choices.

For help, try the -help option.

The following information is generated:

Since this program browses maps from the first map, only maps linked from there will be processed.

Maps are generated as the server sees them, that is with weather effects, treasures instead of markers, and things like that.

For maps, 2 pictures are generated, one real size and one small-size.

Three maps are generated for the world: raw world map, world map with region information, region information only.

Maps are always sorted, by the map name (part after the last /).

Files are generated based on templates, where tags are replaced by their runtime value.

Templates are recursively included. Here is the list:

Tags must be in the form #TAG#. To have a # in the code, please put ##. Valid tags are:

To build this program, from the utils directory:

gcc mapper.c -I../include ../common/libcross.a -o mapper -lm -lgd
Todo:
  • split this file in multiple ones for easier maintenance
  • add missing documentation on variables / functions
  • add command line argument for large / small picture size
  • add maximum width/height for small picture
  • add slaying information to maps themselves
  • make the equipment page use templates
  • shop catalog
  • treasure list use

Definition in file mapper.c.


Define Documentation

#define S_CONNECT   4

Definition at line 487 of file mapper.c.

Referenced by add_slaying(), and write_slaying_info().

#define S_CONTAINER   2

Definition at line 485 of file mapper.c.

Referenced by add_slaying(), and write_slaying_info().

#define S_DETECTOR   3

Definition at line 486 of file mapper.c.

#define S_DOOR   0

Connection/slaying information.

Definition at line 483 of file mapper.c.

Referenced by add_slaying(), and write_slaying_info().

#define S_KEY   1

Definition at line 484 of file mapper.c.

Referenced by add_slaying(), and write_slaying_info().

#define S_MAX   5

Definition at line 488 of file mapper.c.

Referenced by get_slaying_struct().

#define SIZE   50

Referenced by write_world_map().

#define VARSADD   6

Referenced by do_map_index().


Typedef Documentation

One special item (weapon, shield, ...).

Link between a quest and a map.

Map information.

Information about a NPC with a custom message.

List of NPCs with a custom message.

typedef struct struct_quest struct_quest

One quest.

typedef struct struct_race struct_race

One monster race in the maps.

Collection of races.

Region information.


Enumeration Type Documentation

Map output formats.

Enumerator:
OF_PNG 

PNG, default value.

OF_JPG 

JPG.

Definition at line 424 of file mapper.c.


Function Documentation

static void add_map ( struct_map_info info,
struct_map_list list 
) [static]

Adds a map to specified array, if it isn't already.

Parameters:
infomap to add.
listlist to add to.
Note:
will allocate memory and update variables when required.

Definition at line 1498 of file mapper.c.

References struct_map_list::allocated, struct_map_list::count, and struct_map_list::maps.

Referenced by add_map_to_region(), add_map_to_slaying(), add_monster(), add_one_item(), create_tiled_map(), do_parameters(), fix_exits_for_map(), fix_exits_to_tiled_maps(), fix_tiled_map_monsters(), get_map_info(), merge_tiled_maps(), and process_map().

Here is the caller graph for this function:

static void add_map_to_quest ( struct_map_info map,
const char *  name,
const char *  description 
) [static]

Links a map to a quest.

Parameters:
mapmap to link.
namequest name.
descriptionassociated link description. Must not be NULL.

Definition at line 1226 of file mapper.c.

References add_to_struct_map_in_quest_list(), struct_map_in_quest::description, get_quest_info(), struct_map_in_quest::map, struct_quest::maps, struct_map_in_quest::quest, and struct_map_info::quests.

Referenced by process_map_lore().

Here is the call graph for this function:

Here is the caller graph for this function:

static void add_map_to_region ( struct_map_info map,
region reg 
) [static]

Links a map to a region.

Will not readd the map if already linked.

Parameters:
mapmap name.
regregion to link the map to.

Definition at line 1665 of file mapper.c.

References add_map(), struct_region_info::is_world, struct_map_info::path, struct_region_info::reg, region_allocated, region_count, struct_region_info::sum, struct_region_info::sum_x, and struct_region_info::sum_y.

Referenced by process_map().

Here is the call graph for this function:

Here is the caller graph for this function:

static void add_map_to_slaying ( struct_slaying_info info,
int  item,
struct_map_info map 
) [static]

Adds the specified map to the slaying information if not already present.

Parameters:
infostructure to add to.
itemone of the S_xxx values specifying what type of slaying this is.
mapmap to add.

Definition at line 1798 of file mapper.c.

References add_map(), and struct_slaying_info::maps.

Referenced by add_slaying().

Here is the call graph for this function:

Here is the caller graph for this function:

static void add_monster ( object *  monster,
struct_map_info map 
) [static]

Adds a monster to the monster list.

Parameters:
monstermonster to add. Can be any part.
mapmap to add the monster to.

Definition at line 708 of file mapper.c.

References add_map(), add_race_to_list(), get_race(), MAX, struct_map_info::max_monster, MIN, struct_map_info::min_monster, struct_map_info::monsters, and struct_race::origin.

Referenced by process_map().

Here is the call graph for this function:

Here is the caller graph for this function:

static void add_npc_to_map ( struct_map_info map,
const object *  npc 
) [static]

Link the specified NPC to the specified map.

Parameters:
mapmap the NPC is in.
npcNPC to link. Must have a name and message.

Definition at line 1476 of file mapper.c.

References struct_npc_list::allocated, struct_npc_list::count, create_npc_info(), struct_npc_list::npc, and struct_map_info::npcs.

Referenced by process_map().

Here is the call graph for this function:

Here is the caller graph for this function:

static void add_one_item ( object *  item,
struct_map_info map 
) [static]

Adds an item to the list of special items.

Parameters:
itemitem to add.
mapmap it is on.
Todo:
merge items with the same properties.

Definition at line 598 of file mapper.c.

References add_map(), calc_item_power(), struct_equipment::calc_power, struct_equipment::diff, ensure_unique(), free_equipment(), get_equipment(), get_ob_diff(), struct_equipment::name, struct_equipment::origin, struct_equipment::power, stringbuffer_finish(), and stringbuffer_new().

Referenced by check_equipment().

Here is the call graph for this function:

Here is the caller graph for this function:

static void add_race_to_list ( struct_race race,
struct_race_list list,
int  check 
) [static]

Appends a race to a race list.

Parameters:
racerace to add.
listlist to add to.
checkif 0, don't check if race is already on the list ; else don't make duplicated entries.

Definition at line 342 of file mapper.c.

References struct_race_list::allocated, struct_race_list::count, and struct_race_list::races.

Referenced by add_monster(), fix_tiled_map_monsters(), and get_race().

Here is the caller graph for this function:

static void add_region_link ( mapstruct source,
mapstruct dest,
const char *  linkname 
) [static]

Creates a link between two maps if they are on different regions.

Parameters:
sourcemap from.
destmap to.
linknamename of the link as it should appear. Unused.

Definition at line 1715 of file mapper.c.

References get_region_by_map(), regiondef::name, regions_link, regions_link_allocated, regions_link_count, and snprintf().

Referenced by process_map().

Here is the call graph for this function:

Here is the caller graph for this function:

static void add_slaying ( struct_map_info map,
object *  item 
) [static]

Adds the item's information to the map.

Parameters:
mapmap containing the item.
itemitem which slaying field we're considering.

Definition at line 1810 of file mapper.c.

References add_map_to_slaying(), CONTAINER, get_slaying_struct(), LOCKED_DOOR, S_CONNECT, S_CONTAINER, S_DOOR, S_KEY, and SPECIAL_KEY.

Referenced by check_slaying_inventory(), and process_map().

Here is the call graph for this function:

Here is the caller graph for this function:

static void add_to_struct_map_in_quest_list ( struct_map_in_quest_list list,
struct_map_in_quest item 
) [static]

Definition at line 1178 of file mapper.c.

References struct_map_in_quest_list::allocated, struct_map_in_quest_list::count, and struct_map_in_quest_list::list.

Referenced by add_map_to_quest().

Here is the caller graph for this function:

int auto_apply ( object *  op)

Map was just loaded, handle op's initialisation.

Generates shop floor's item, and treasures.

Parameters:
opobject to initialize.
Returns:
1 if object was initialized, 0 else.

Definition at line 3954 of file mapper.c.

References CLEAR_FLAG, create_treasure(), FLAG_AUTO_APPLY, FLAG_CURSED, FLAG_DAMNED, FLAG_IS_A_TEMPLATE, FLAG_UNPAID, free_object(), generate_treasure(), GT_ENVIRONMENT, HAS_RANDOM_ITEMS, identify(), insert_ob_in_map(), insert_ob_in_ob(), MAX, QUERY_FLAG, remove_ob(), SET_FLAG, SHOP_FLOOR, and TREASURE.

Referenced by do_auto_apply(), and fix_auto_apply().

Here is the call graph for this function:

Here is the caller graph for this function:

static char* cat_template ( char *  source,
char *  add 
) [static]

Concatenates a string, and free concatenated string.

Parameters:
sourcestring to append to. Can be NULL.
addstring that is appened. Will be free()d after. Must not be NULL.
Returns:
new string that should be free()d by caller.

Definition at line 876 of file mapper.c.

Referenced by do_map_index(), write_map_page(), write_maps_by_level(), write_quests_page(), write_region_index(), and write_world_map().

Here is the caller graph for this function:

static void check_equipment ( object *  item,
struct_map_info map 
) [static]

Checks if item and its inventory are worthy to be listed.

Parameters:
itemitem to check.
mapmap the item is on.

Definition at line 642 of file mapper.c.

References add_one_item(), and is_special_equipment().

Referenced by process_map().

Here is the call graph for this function:

Here is the caller graph for this function:

static void check_slaying_inventory ( struct_map_info map,
object *  item 
) [static]

Recursively checks if the object should be considered for slaying information.

Parameters:
mapmap containing the items.
itemitem to consider. Must not be NULL.

Definition at line 1836 of file mapper.c.

References add_slaying(), and is_slaying().

Referenced by process_map().

Here is the call graph for this function:

Here is the caller graph for this function:

void clean_tmp_files ( void  )

Remove temporary map files.

Todo:
check logic, why is file only removed if map is in memory?

Definition at line 3915 of file mapper.c.

Referenced by cleanup(), fatal(), fatal_signal(), and LOG().

Here is the caller graph for this function:

static int compare_map_info ( const struct_map_info left,
const struct_map_info right 
) [static]

Compares struct_map_info according to the map name or the path if equal.

Parameters:
leftfirst item.
rightsecond item.
Returns:
comparison on name, and if equal then on whole path.

Definition at line 1082 of file mapper.c.

References struct_map_info::name, struct_map_info::path, strcasecmp(), and struct_map_info::tiled_group.

Referenced by sort_map_info(), and sort_map_info_by_level().

Here is the call graph for this function:

Here is the caller graph for this function:

static void create_destination ( void  ) [static]

Ensures destination directory exists.

Definition at line 3587 of file mapper.c.

References make_path_to_file(), and root.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static struct_map_info* create_map_info ( void  ) [static]
static struct_npc_info* create_npc_info ( const object *  npc) [static]

Create the struct_npc_info from the specified NPC.

It must have a name and message.

Parameters:
npcNPC to gather info for.
Returns:
structure with info.

Definition at line 1458 of file mapper.c.

References struct_npc_info::message, struct_npc_info::name, struct_npc_info::x, and struct_npc_info::y.

Referenced by add_npc_to_map().

Here is the caller graph for this function:

static struct_map_info* create_tiled_map ( void  ) [static]

Create a new tiled map and link it to the tiled map list.

Returns:
new tiled map.

Definition at line 1562 of file mapper.c.

References add_map(), and create_map_info().

Referenced by process_map().

Here is the call graph for this function:

Here is the caller graph for this function:

static void define_quest ( const char *  name,
struct_map_info mainmap,
const char *  description 
) [static]

Sets the main map for a quest.

Parameters:
namequest name.
mainmapmain map to associate.
descriptionquest description. Must not be NULL.

Definition at line 1278 of file mapper.c.

References struct_quest::description, get_quest_info(), struct_quest::mainmap, struct_quest::name, and struct_map_info::path.

Referenced by process_map_lore().

Here is the call graph for this function:

Here is the caller graph for this function:

void do_auto_apply ( mapstruct m)
static void do_exit_map ( mapstruct map) [static]

Proceses exit / road / blocking information for specified map into the global infomap map.

If map isn't a world map, won't do anything.

Parameters:
mapmap to write info for.

Definition at line 808 of file mapper.c.

References color_blocking, color_linked_exit, color_road, color_slowing, color_unlinked_exit, elevation_info, elevation_max, elevation_min, EXIT, GET_MAP_OB, infomap, is_blocking(), is_road(), MAP_HEIGHT, MAP_WIDTH, MAX, MIN, mapdef::path, and TELEPORTER.

Referenced by process_map().

Here is the call graph for this function:

Here is the caller graph for this function:

static void do_help ( const char *  program) [static]

Prints usage information, and exit.

Parameters:
programprogram path.

Definition at line 3486 of file mapper.c.

Referenced by do_parameters().

Here is the caller graph for this function:

static char* do_map_index ( const char *  dest,
struct_map_list maps_list,
const char *  template_page,
const char *  template_letter,
const char *  template_map,
const char **  vars,
const char **  values 
) [static]

Creates the page for a map index.

Parameters:
destpath relative to root where the index will be located, without leading /. Used to compute the map's path relative to the index.
maps_listmaps in the index.
template_pageglobal page template.
template_lettertemplate for one letter of the index.
template_maptemplate for one map.
varstemplate variables to give access to.
valuesassociated values.
Returns:
processed template. Should be free() by the caller.

Definition at line 2122 of file mapper.c.

References cat_template(), struct_map_list::count, do_template(), generate_index, struct_map_list::maps, struct_map_info::name, struct_map_info::path, relative_path(), snprintf(), sort_map_info(), struct_map_info::tiled_group, tolower, and VARSADD.

Referenced by write_maps_index(), and write_region_page().

Here is the call graph for this function:

Here is the caller graph for this function:

static void do_parameters ( int  argc,
char **  argv 
) [static]

Handles command-line parameters.

Parameters:
argcnumber of parameters, including program name.
argvarguments, including program name.

Definition at line 3519 of file mapper.c.

References add_map(), do_help(), do_regions_link, force_pics, generate_index, generate_pics, get_map_info(), jpeg_quality, list_unused_maps, map_limit, OF_JPG, output_format, rawmaps, root, show_maps, snprintf(), tileset, warn_no_path, world_exit_info, and world_map.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static char* do_template ( const char *  template,
const char **  vars,
const char **  values 
) [static]

Processes a template.

Variables in the form #VARIABLE# will be substituted for specified values.

Parameters:
templatetemplate to process.
varsvariables to replace. Array must be NULL-terminated.
valuesvariables to replace by. Must be the same size as vars, no NULL element allowed.
Returns:
filled-in template, that must be free()d be caller. NULL if memory allocation error.
Note:
returned string will be a memory block larger than required, for performance reasons.

Definition at line 947 of file mapper.c.

Referenced by do_map_index(), write_map_page(), write_maps_by_level(), write_quests_page(), write_region_index(), and write_world_map().

Here is the caller graph for this function:

static void do_tiled_map_picture ( struct_map_info map) [static]

Generates the large and small pictures for a tiled map.

This uses the large/small pictures made during process_map(), so having a map limit could lead to maps not found and invalid results.

Parameters:
maptiled map to make the picture of.
Todo:
add a field to struct_map_info to remember if pic was updated or not, and update the tiled map only if one map has changed / the pic doesn't exist.

Definition at line 2891 of file mapper.c.

References struct_map_list::count, generate_pics, struct_map_info::height, large, struct_map_list::maps, struct_map_info::name, OF_PNG, output_extensions, output_format, struct_map_info::path, struct_map_info::processed, root, save_picture(), size_small, small, snprintf(), tiled_map_need_pic(), struct_map_info::tiled_maps, struct_map_info::tiled_x_from, struct_map_info::tiled_y_from, struct_map_info::tiles, and struct_map_info::width.

Referenced by write_tiled_map_page().

Here is the call graph for this function:

Here is the caller graph for this function:

void dragon_ability_gain ( object *  ob,
int  x,
int  y 
)

When a dragon-player gains a new stage of evolution, he gets some treasure.

Parameters:
whothe dragon player.
atnrthe attack-number of the ability focus.
levelability level.

Definition at line 3921 of file mapper.c.

Referenced by dragon_level_gain().

Here is the caller graph for this function:

void draw_ext_info ( int  flags,
int  pri,
const object *  pl,
uint8  type,
uint8  subtype,
const char *  txt,
const char *  txt2 
)

Dummy functions to link the library.

Those are dummy functions defined to resolve all symboles.

Definition at line 3893 of file mapper.c.

References logfile.

Referenced by adj_stealchance(), adjust_sign_msg(), alchemy_failure_effect(), animate_weapon(), apply_builder_floor(), apply_builder_item(), apply_builder_remove(), apply_builder_wall(), apply_builder_window(), apply_map_builder(), apply_sign(), apply_special(), armour_improver_type_apply(), attack_hth(), attack_melee_weapon(), attack_message(), attack_ob_simple(), attempt_do_alchemy(), attempt_jump(), attempt_recipe(), attempt_steal(), basic_emote(), blocked_link(), book_type_apply(), can_pay(), can_see_enemy(), cast_bless(), cast_cause_disease(), cast_change_ability(), cast_change_map_lightlevel(), cast_cone(), cast_consecrate(), cast_create_food(), cast_create_obj(), cast_create_town_portal(), cast_curse(), cast_heal(), cast_identify(), cast_invisible(), cast_item_curse_or_curse(), cast_light(), cast_raise_dead_spell(), cast_smite_spell(), cast_spell(), cast_transfer(), cast_word_of_recall(), cf_handle_type_apply(), cfapi_player_message(), change_abil(), change_spell(), charge_mana_effect(), check_login(), check_name(), check_pick(), check_score(), command_abil(), command_addexp(), command_afk(), command_arrest(), command_banish(), command_body(), command_bowmode(), command_brace(), command_cast_spell(), command_cointoss(), command_create(), command_debug(), command_diff(), command_drop(), command_dropall(), command_dump(), command_dumpbelow(), command_empty(), command_explore(), command_fire(), command_follow(), command_forget_spell(), command_free(), command_freeze(), command_goto(), command_gsay(), command_help(), command_insert_into(), command_inventory(), command_invisible(), command_kill_pets(), command_learn_spell_or_prayer(), command_loadplugin(), command_loadtest(), command_lock_item(), command_mark(), command_mon_aggr(), command_nowiz(), command_output_count(), command_output_sync(), command_overlay_reset(), command_overlay_save(), command_party(), command_patch(), command_peaceful(), command_pickup(), command_possess(), command_remove(), command_rename_item(), command_reply(), command_reset(), command_resistances(), command_rskill(), command_run(), command_save(), command_search_items(), command_setgod(), command_showpets(), command_sound(), command_stack_clear(), command_stack_list(), command_statistics(), command_stats(), command_strings(), command_style_map_info(), command_summon(), command_take(), command_teleport(), command_tell_all(), command_throw(), command_title(), command_toggle_shout(), command_unloadplugin(), command_use(), command_uskill(), command_whereabouts(), command_wizcast(), command_wizpass(), confuse_living(), create_aura(), create_bomb(), cure_disease(), current_map_info(), describe_shop(), dimension_door(), dispel_rune(), display_high_score(), display_motd(), display_new_pickup(), display_who_entry(), dm_stack_peek(), dm_stack_pop(), dm_stack_push(), do_hidden_move(), do_skill(), do_skill_attack(), do_talk_npc(), do_tell(), do_throw(), do_turn(), do_wizard_dm(), do_wizard_hide(), dragon_ability_gain(), dragon_eat_flesh(), drain_specific_stat(), draw_ext_info(), draw_ext_info_format(), drop(), drop_object(), eat_special_food(), emergency_save(), enter_map(), examine(), examine_monster(), execute_word_of_recall(), exit_type_apply(), exit_type_move_on(), ext_info_map(), ext_info_map_except(), ext_info_map_except2(), find_or_create_connection_for_map(), find_traps(), fire(), fire_arch_from_position(), fire_bow(), fire_misc_object(), follow_owner(), food_type_apply(), get_other_player_from_name(), god_enchants_weapon(), god_intervention(), god_removes_curse(), handle_newcs_player(), help_topics(), hide(), hole_type_move_on(), identify_altar_type_move_on(), improve_armour(), improve_weapon(), improve_weapon_magic(), improve_weapon_stat(), infect_object(), inscribe_scroll_cmd(), inventory(), jump(), key_change_class(), key_confirm_quit(), key_roll_stat(), kill_object(), kill_player(), lighter_type_apply(), list_players(), lock_item_cmd(), look_at(), magic_wall(), manual_apply(), map_info(), mark_item_cmd(), meditate(), move_golem(), move_marker(), move_player_attack(), move_symptom(), party_help(), perceive_self(), pet_move(), pick_lock(), pick_up(), pick_up_object(), player_apply(), player_attack_door(), player_lvl_adj(), plugins_display_list(), poison_living(), poison_type_apply(), poisoning_type_process(), potion_type_apply(), pray(), pray_at_altar(), prayer_failure(), prepare_weapon(), print_los(), probe(), put_object_in_sack(), receive_party_password(), receive_play_again(), receive_player_name(), receive_player_password(), recharge(), remove_curse(), remove_force(), save_player(), scroll_failure(), scroll_type_apply(), send_party_message(), send_rules(), set_pickup_mode(), shop_inventory_type_apply(), shop_mat_type_move_on(), show_commands(), show_matching_spells(), show_skills(), skill_attack(), skill_ident(), slow_living(), spell_failure(), spellbook_type_apply(), spring_trap(), start_info(), summon_golem(), summon_object(), tailor_god_spell(), time_info(), trap_disarm(), trapdoor_type_move_on(), treasure_type_apply(), trigger_type_apply(), unapply_for_ob(), use_oratory(), version(), weapon_improver_type_apply(), write_mark(), write_note(), write_on_item(), write_rune(), write_scroll(), and wrong_password().

void draw_ext_info_format ( int  flags,
int  pri,
const object *  pl,
uint8  type,
uint8  subtype,
const char *  new_format,
const char *  old_format,
  ... 
)

Sends message to player(s).

This function is the same as draw_ext_info, but takes varargs format. Otherwise, the meaning of all the fields is the same. This is perhaps not the most efficient as we do vsnprintf on both the old and newbuf, but it simplifies the code greatly since we can just call draw_ext_info. Also, hopefully at some point, need for old_format will go away.

Parameters:
flagsVarious flags - mostly color, plus a few specials.
priPriority. It is a little odd - the lower the value, the more important it is. Thus, 0 gets sent no matter what. Otherwise, the value must be less than the listening level that the player has set. Unfortunately, there is no clear guideline on what each level does what.
plCan be passed as NULL - in fact, this will be done if NDI_ALL is set in the flags.

If message is black, and not NDI_UNIQUE, gets sent through output buffers. If the client supports the new readables, this is sent to the client without processing in the output buffers.

Parameters:
typeThe type MSG_TYPE for the type of message.
subtypeThe type MSG_TYPE for the type of message.
new_format
old_format

Definition at line 3897 of file mapper.c.

References logfile.

Referenced by action_makes_visible(), alchemy_failure_effect(), altar_type_move_on(), animate_weapon(), apply_builder_item(), apply_builder_remove(), apply_container(), apply_savebed(), apply_special(), arch_info(), attack_hth(), attack_message(), attack_ob_simple(), attempt_do_alchemy(), attempt_jump(), attempt_recipe(), attempt_steal(), basic_emote(), become_follower(), blind_living(), book_type_apply(), cast_bless(), cast_cause_disease(), cast_change_ability(), cast_consecrate(), cast_create_missile(), cast_curse(), cast_dust(), cast_identify(), cast_item_curse_or_curse(), cast_raise_dead_spell(), cast_smite_spell(), cast_spell(), change_abil(), change_spell(), check_login(), check_name(), check_pick(), check_race_restrictions(), check_sacrifice(), check_score(), check_special_prayers(), check_spell_expiry(), choose_cult_monster(), clock_type_apply(), command_abil(), command_addexp(), command_apply(), command_applymode(), command_arrest(), command_banish(), command_body(), command_bowmode(), command_cast_spell(), command_create(), command_debug(), command_drop(), command_examine(), command_follow(), command_forget_spell(), command_freeze(), command_goto(), command_help(), command_insert_into(), command_kick(), command_kill_pets(), command_language(), command_learn_spell_or_prayer(), command_listen(), command_loadplugin(), command_loadtest(), command_lock_item(), command_mark(), command_nowiz(), command_output_count(), command_output_sync(), command_party(), command_party_rejoin(), command_patch(), command_petmode(), command_pickup(), command_players(), command_remove(), command_rename_item(), command_reply(), command_reset(), command_resistances(), command_rskill(), command_search_items(), command_setgod(), command_showpets(), command_speed(), command_stack_list(), command_statistics(), command_stats(), command_strings(), command_style_map_info(), command_summon(), command_take(), command_teleport(), command_tell_all(), command_toggle_shout(), command_unloadplugin(), command_use(), command_usekeys(), command_whereabouts(), command_wimpy(), converter_type_move_on(), cure_disease(), current_map_info(), current_region_info(), deep_swamp_type_move_on(), deep_swamp_type_process(), describe_shop(), display_new_pickup(), dm_stack_pop(), dm_stack_push(), do_forget_spell(), do_harvest(), do_learn_spell(), do_skill_attack(), do_skill_ident2(), do_talk_npc(), do_tell(), do_throw(), do_turn(), do_wizard_hide(), dragon_ability_gain(), dragon_eat_flesh(), dragon_level_gain(), drop_object(), empty_container(), enter_exit(), enter_fixed_template_map(), enter_unique_map(), examine(), execute_newserver_command(), exit_type_apply(), find_key(), find_throw_ob(), fire_bow(), fire_misc_object(), follower_remove_given_items(), food_type_apply(), form_party(), gate_type_process(), get_dm_object(), get_payment(), get_spell_by_name(), god_enchants_weapon(), god_examines_item(), god_examines_priest(), god_gives_present(), god_intervention(), hit_with_one_attacktype(), identify_altar_type_move_on(), improve_weapon(), improve_weapon_stat(), inventory(), key_confirm_quit(), key_roll_stat(), kill_object(), kill_player(), lamp_type_apply(), leave(), lighter_type_apply(), list_players(), look_at(), magic_wall(), malloc_info(), map_info(), mark_item_cmd(), move_golem(), new_player_cmd(), peacemaker_type_process(), perceive_self(), pick_up(), player_apply(), player_attack_door(), player_lvl_adj(), plugins_display_list(), poison_living(), polymorph_melt(), pray_at_altar(), prayer_failure(), print_tod(), process_players1(), push_ob(), put_object_in_sack(), receive_party_password(), recharge(), recursive_roll(), remove_force(), resurrect_player(), sack_can_hold(), save_life(), save_player(), scroll_type_apply(), sell_item(), send_news(), shop_inventory_type_apply(), show_matching_spells(), show_skills(), singing(), skillscroll_type_apply(), spellbook_type_apply(), start_info(), summon_golem(), summon_object(), swap_map(), swap_random_stats(), swap_stat(), time_info(), transmute_item_to_flower(), transport_type_apply(), trap_disarm(), trap_see(), treasure_type_apply(), unapply_for_ob(), unapply_special(), use_alchemy(), use_oratory(), use_skill(), version(), worship_forbids_use(), write_note(), write_on_item(), write_rune(), and write_scroll().

static void dump_unused_maps ( void  ) [static]

Writes the list of unused maps, maps found in the directories but not linked from the other maps.

Definition at line 3257 of file mapper.c.

References found_maps, found_maps_count, root, and snprintf().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void emergency_save ( int  x)

Save all players.

Parameters:
flagif non zero, it means that we want to try and save everyone, but keep the game running. Thus, we don't want to free any information.

Definition at line 3912 of file mapper.c.

Referenced by fatal(), fatal_signal(), LOG(), and server_main().

Here is the caller graph for this function:

static struct_equipment* ensure_unique ( struct_equipment item) [static]

Searches the item list for an identical item, except maps.

Parameters:
itemitem to search. The variable may be freed, so must not be used after calling this function.
Returns:
item guaranteed to be unique in the item list.

Definition at line 559 of file mapper.c.

References struct_equipment::calc_power, struct_equipment::diff, equipment_allocated, equipment_count, free_equipment(), struct_equipment::name, and struct_equipment::power.

Referenced by add_one_item().

Here is the call graph for this function:

Here is the caller graph for this function:

void esrv_del_item ( player pl,
int  tag 
)

Tells the client to delete an item.

Uses the item command with a -1 location.

Definition at line 3931 of file mapper.c.

Referenced by remove_ob(), and transmute_item_to_flower().

Here is the caller graph for this function:

void esrv_send_item ( object *  ob,
object *  obx 
)

Sends item's info to player.

Definition at line 3918 of file mapper.c.

Referenced by apply_container(), cast_detection(), dragon_ability_gain(), insert_ob_in_ob(), and transmute_item_to_flower().

Here is the caller graph for this function:

void esrv_update_item ( int  flags,
object *  pl,
object *  op 
)
void esrv_update_spells ( player pl)

This looks for any spells the player may have that have changed their stats.

It then sends an updspell packet for each spell that has changed in this way.

Definition at line 3937 of file mapper.c.

Referenced by fix_object(), and player_lvl_adj().

Here is the caller graph for this function:

int execute_event ( object *  op,
int  eventcode,
object *  activator,
object *  third,
const char *  message,
int  fix 
)
int execute_global_event ( int  eventcode,
  ... 
)
void ext_info_map ( int  color,
const mapstruct map,
uint8  type,
uint8  subtype,
const char *  str1,
const char *  str2 
)

Writes to everyone on the specified map.

Definition at line 3905 of file mapper.c.

References logfile.

Referenced by cfapi_map_message(), change_map_light(), command_me(), communicate(), do_talk_npc(), npc_say(), operate_altar(), and trigger_connected().

Here is the caller graph for this function:

static void find_maps ( const char *  from) [static]

Recursively find all all maps in a directory.

Parameters:
frompath to search from, without trailing /.

Definition at line 3212 of file mapper.c.

References closedir(), dirent::d_name, Settings::datadir, found_maps, found_maps_allocated, found_maps_count, ignore_name, ignore_path, Settings::mapdir, opendir(), readdir(), S_ISDIR, settings, and snprintf().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

object* find_skill_by_number ( object *  who,
int  skillno 
)

This returns the skill pointer of the given name (the one that accumlates exp, has the level, etc).

It is presumed that the player will be needing to actually use the skill, so a skill tool will be equipped if one if found to benefit from its bonuses.

This code is basically the same as find_skill_by_name() above, but instead of a skill name, we search by matching number.

Parameters:
whoplayer applying a skill.
skillnoskill subtype.
Returns:
skill object if player can use it, NULL else.

Definition at line 3927 of file mapper.c.

Referenced by can_detect_enemy(), check_move_on(), find_best_player_hth_skill(), god_enchants_weapon(), query_cost(), and query_cost_string().

Here is the caller graph for this function:

void fix_auto_apply ( mapstruct m)

Go through the entire map (only the first time when an original map is loaded) and performs special actions for certain objects (most initialization of chests and creation of treasures and stuff).

Calls auto_apply() if appropriate.

Parameters:
mmap to fix.

Go through the entire map (only the first time when an original map is loaded) and performs special actions for certain objects (most initialization of chests and creation of treasures and stuff).

Added as part of glue cleaning. Ryo 2005-07-15

Definition at line 4008 of file mapper.c.

Referenced by enter_fixed_template_map(), enter_unique_map(), generate_random_map(), load_temporary_map(), ready_map_name(), and START_TEST().

Here is the caller graph for this function:

static void fix_exits_for_map ( struct_map_info current,
struct_map_list from,
int  is_from 
) [static]

Changes for the list all maps to the tiled map they are part of, if applicable.

Parameters:
currentmap currently being processed.
fromlist that contains the exits to/from map to be fixed.
is_fromif non zero, from is exit_from field, else it is an exit_to.

Definition at line 2772 of file mapper.c.

References add_map(), struct_map_list::count, struct_map_info::exits_from, struct_map_info::exits_to, struct_map_list::maps, and struct_map_info::tiled_group.

Referenced by fix_exits_to_tiled_maps().

Here is the call graph for this function:

Here is the caller graph for this function:

static void fix_exits_to_tiled_maps ( void  ) [static]

Changes all exits to maps in a tiled map to point directly to the tiled map.

Same for region lists.

Definition at line 2791 of file mapper.c.

References add_map(), struct_map_list::count, struct_map_info::exits_from, struct_map_info::exits_to, fix_exits_for_map(), struct_map_list::maps, struct_region_info::maps_list, region_count, and struct_map_info::tiled_group.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void fix_map_names ( void  ) [static]

Ensures all maps have a name (if there was a limit to map processing, some maps will have a NULL name which causes issues).

Definition at line 2683 of file mapper.c.

References struct_map_list::count, struct_map_info::filename, struct_map_list::maps, and struct_map_info::name.

Referenced by main().

Here is the caller graph for this function:

static void fix_tiled_map ( void  ) [static]

Ensures all tiled maps have a name, a region, a filename and a path.

Will try to find a suitable name and region from the maps in the group.

Todo:
use a better filename, try to get the start of the map filenames.

Definition at line 2703 of file mapper.c.

References struct_map_info::cfregion, struct_map_list::count, struct_map_info::filename, struct_map_list::maps, struct_map_info::name, regiondef::name, struct_map_info::path, snprintf(), and struct_map_info::tiled_maps.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void fix_tiled_map_monsters ( void  ) [static]

Makes all monsters point to tiled maps instead of map when appliable, and merge map monster to tiled map.

Definition at line 2819 of file mapper.c.

References add_map(), add_race_to_list(), struct_race_list::count, struct_map_list::count, struct_map_list::maps, struct_map_info::monsters, struct_race::origin, struct_race_list::races, and struct_map_info::tiled_group.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void free_equipment ( struct_equipment equip) [static]

Frees a struct_equipment.

Parameters:
equipitem to free.

Definition at line 545 of file mapper.c.

References struct_equipment::diff, and struct_equipment::name.

Referenced by add_one_item(), and ensure_unique().

Here is the caller graph for this function:

static int get_elevation_color ( int  elevation,
gdImagePtr  elevationmap 
) [static]

Gets the color for an elevation.

Parameters:
elevationelevation to get color for.
elevationmappicture that will get the color.
Returns:
color.

Definition at line 793 of file mapper.c.

References elevation_max, and elevation_min.

Referenced by write_world_info().

Here is the caller graph for this function:

static struct_equipment* get_equipment ( void  ) [static]

Gets an empty struct_equipment.

Returns:
new item.

Definition at line 532 of file mapper.c.

References init_map_list(), and struct_equipment::origin.

Referenced by add_one_item().

Here is the call graph for this function:

Here is the caller graph for this function:

static struct_map_info* get_map_info ( const char *  path) [static]

Gets or creates if required the info structure for a map.

Parameters:
pathmap to consider.
Returns:
associated structure.

Definition at line 1614 of file mapper.c.

References add_map(), struct_map_list::count, create_map_info(), struct_map_info::filename, struct_map_list::maps, and struct_map_info::path.

Referenced by do_parameters(), main(), and process_map().

Here is the call graph for this function:

Here is the caller graph for this function:

static struct_quest* get_quest_info ( const char *  name) [static]

Gets the information for a quest, create the field if needed.

Parameters:
namequest's name.
Returns:
information, never NULL.

Definition at line 1194 of file mapper.c.

References init_struct_map_in_quest_list(), struct_quest::maps, struct_quest::name, struct_quest::number, quests_allocated, and quests_count.

Referenced by add_map_to_quest(), and define_quest().

Here is the call graph for this function:

Here is the caller graph for this function:

static struct_race* get_race ( const char *  name) [static]

Returns the race for specified name.

Parameters:
namemonster's name.
Returns:
race structure.

Definition at line 679 of file mapper.c.

References add_race_to_list(), struct_race_list::count, struct_race::count, init_map_list(), struct_race::name, struct_race::origin, and struct_race_list::races.

Referenced by add_monster().

Here is the call graph for this function:

Here is the caller graph for this function:

static struct_slaying_info* get_slaying_struct ( const char *  slaying) [static]

Returns a struct_slaying_info for specified slaying.

Creates a new one if required.

Parameters:
slayingvalue to get the structure of.
Returns:
structure for slaying. Never NULL.

Definition at line 1764 of file mapper.c.

References init_map_list(), struct_slaying_info::maps, S_MAX, struct_slaying_info::slaying, slaying_allocated, and slaying_count.

Referenced by add_slaying().

Here is the call graph for this function:

Here is the caller graph for this function:

static void init_map_list ( struct_map_list list) [static]

Initialises a list structure.

Parameters:
listlist to blank.

Definition at line 505 of file mapper.c.

References struct_map_list::allocated, struct_map_list::count, and struct_map_list::maps.

Referenced by create_map_info(), get_equipment(), get_race(), get_slaying_struct(), and main().

Here is the caller graph for this function:

static void init_npc_list ( struct_npc_list list) [static]

Initialise a list of NPCs.

Parameters:
listlist to initialise.

Definition at line 1445 of file mapper.c.

References struct_npc_list::allocated, struct_npc_list::count, and struct_npc_list::npc.

Referenced by create_map_info().

Here is the caller graph for this function:

static void init_race_list ( struct_race_list list) [static]

Blanks a struct_race_list.

Parameters:
listlist to blank.

Definition at line 326 of file mapper.c.

References struct_race_list::allocated, struct_race_list::count, and struct_race_list::races.

Referenced by create_map_info(), and main().

Here is the caller graph for this function:

static void init_struct_map_in_quest_list ( struct_map_in_quest_list list) [static]

Definition at line 1172 of file mapper.c.

References struct_map_in_quest_list::allocated, struct_map_in_quest_list::count, and struct_map_in_quest_list::list.

Referenced by create_map_info(), and get_quest_info().

Here is the caller graph for this function:

static int is_blocking ( object *  item) [static]

Checks if item blocks movement or not.

Parameters:
item::object to test.
Returns:
1 if item blocks all movement, 0 else.

Definition at line 779 of file mapper.c.

References MOVE_ALL.

Referenced by do_exit_map().

Here is the caller graph for this function:

static int is_road ( object *  item) [static]

Checks if ::object is considered a road or not.

Parameters:
item::object to check.
Returns:
1 if object is a road, 0 else.

Definition at line 743 of file mapper.c.

References FLAG_IS_FLOOR, and QUERY_FLAG.

Referenced by do_exit_map().

Here is the caller graph for this function:

static int is_slaying ( object *  item) [static]

Is the slaying field relevant for this item?

Parameters:
itemitem to check.
Returns:
1 if relevant, 0 else.

Definition at line 1751 of file mapper.c.

References CHECK_INV, CONTAINER, LOCKED_DOOR, and SPECIAL_KEY.

Referenced by check_slaying_inventory(), and process_map().

Here is the caller graph for this function:

static int is_special_equipment ( object *  item) [static]

Definition at line 513 of file mapper.c.

References FLAG_NO_PICK, IS_ARMOR, IS_ARROW, IS_SHIELD, IS_WEAPON, MOVE_ALL, QUERY_FLAG, ROD, and WAND.

Referenced by check_equipment().

Here is the caller graph for this function:

static void list_map ( const char *  path) [static]

Marks specified path as processed.

Parameters:
pathmap to remove.

Definition at line 1642 of file mapper.c.

References found_maps, and found_maps_count.

Referenced by process_map().

Here is the caller graph for this function:

int main ( int  argc,
char **  argv 
)

Main entry point.

Parameters:
argclength of argv.
argvcommand-line options.
Returns:
0.

Definition at line 3607 of file mapper.c.

References add_string(), cached_pics, cf_parameter_list_size, color_blocking, color_linked_exit, color_road, color_slowing, color_unlinked_exit, struct_map_list::count, create_destination(), created_pics, Settings::debug, do_parameters(), do_regions_link, dump_unused_maps(), elevation_info, elevation_max, elevation_min, facesets, regiondef::fallback, find_maps(), first_map_path, first_region, fix_exits_to_tiled_maps(), fix_map_names(), fix_tiled_map(), fix_tiled_map_monsters(), force_pics, found_maps, found_maps_count, gdfaces, generate_index, generate_pics, get_map_info(), get_region_struct(), index_letter, index_map, index_quest_template, index_region_region_template, index_region_template, index_template, infomap, init_archetypes(), init_artifacts(), init_formulae(), init_globals(), init_gods(), init_library(), init_map_list(), init_race_list(), init_readable(), init_regions(), is_valid_faceset(), jpeg_quality, level_map_template, level_template, level_value_template, LIBDIR, list_unused_maps, regiondef::longname, map_exit_template, map_exit_to_template, map_limit, map_lore_template, map_monster_after_template, map_monster_before_template, map_monster_between_template, map_monster_one_template, map_no_exit_template, map_no_exit_to_template, map_no_lore_template, map_no_monster_template, map_no_quest_template, map_one_quest_template, map_template, map_with_exit_template, map_with_exit_to_template, map_with_quests_template, struct_map_list::maps, regiondef::name, regiondef::next, nrofpixmaps, OF_JPG, output_extensions, output_format, pics_allocated, process_map(), quest_map_template, quest_template, rawmaps, read_client_images(), read_template(), region_letter_template, region_map_template, region_template, root, settings, show_maps, snprintf(), sortbyname(), tileset, warn_no_path, world_exit_info, world_map, world_map_template, world_row_template, world_template, write_all_maps(), write_all_regions(), write_equipment_index(), write_maps_by_level(), write_maps_index(), write_npc_list(), write_quests_page(), write_race_index(), write_region_index(), write_regions_link(), write_slaying_info(), write_tiled_maps(), write_world_info(), write_world_map(), and yesno().

Here is the call graph for this function:

static void merge_tiled_maps ( struct_map_info map,
int  tile,
struct_map_info tiled_map 
) [static]

Merge two tiled maps groups.

This can happen if based on processing we do one map with tiled maps, another with tiled maps, and later figure out the tiles are actually linked.

Parameters:
mapthe map that being processed has a tiling to a map in another group. Its group will be the final merging group.
tilethe tile index causing the merge
tiled_mapthe map tiled to another group. Its group will disappear.

Definition at line 1580 of file mapper.c.

References add_map(), struct_map_list::count, struct_map_list::maps, struct_map_info::tiled_group, and struct_map_info::tiled_maps.

Referenced by process_map().

Here is the call graph for this function:

Here is the caller graph for this function:

void monster_check_apply ( object *  ob,
object *  obt 
)

Definition at line 3940 of file mapper.c.

Referenced by monster_check_pickup(), polymorph_living(), and put_treasure().

Here is the caller graph for this function:

void move_firewall ( object *  ob)

Move for FIREWALL.

firewalls fire other spells. The direction of the wall is stored in op->stats.sp. walls can have hp, so they can be torn down.

Parameters:
opfirewall.

Definition at line 3909 of file mapper.c.

Referenced by legacy_ob_process(), and trigger_connected().

Here is the caller graph for this function:

static void process_map ( struct_map_info info) [static]

Processes a map.

Generates the map pictures (big and small), and exit information.

Parameters:
infomap to process.

Definition at line 1854 of file mapper.c.

References add_map(), add_map_to_region(), add_monster(), add_npc_to_map(), add_region_link(), add_slaying(), cached_pics, struct_map_info::cfregion, check_equipment(), check_slaying_inventory(), create_pathname(), create_tiled_map(), created_pics, face_info::data, delete_map(), mapdef::difficulty, do_auto_apply(), do_exit_map(), do_regions_link, EXIT, EXIT_PATH, struct_map_info::exits_from, struct_map_info::exits_to, face_sets::faces, facesets, struct_map_info::filename, find_archetype(), FLAG_FRIENDLY, FLAG_MONSTER, FLAG_UNAGGRESSIVE, force_pics, gdfaces, generate_pics, get_face_fallback(), get_map_info(), GET_MAP_OB, get_multi_size(), get_region_by_map(), struct_map_info::height, mapdef::in_memory, is_slaying(), struct_map_info::level, list_map(), list_unused_maps, struct_map_info::lore, make_path_to_file(), MAP_HEIGHT, MAP_IN_MEMORY, MAP_WIDTH, mapdef::maplore, MAX_BUF, merge_tiled_maps(), struct_map_info::name, mapdef::name, output_extensions, output_format, struct_map_info::path, mapdef::path, path_combine_and_normalize(), struct_map_info::pic_was_done, pics_allocated, PLAYER_CHANGER, process_map_lore(), QUERY_FLAG, rawmaps, ready_map_name(), mapdef::reset_time, root, save_picture(), show_maps, size_small, small, snprintf(), TELEPORTER, mapdef::tile_path, struct_map_info::tiled_group, struct_map_info::tiled_maps, struct_map_info::tiles, tileset, warn_no_path, and struct_map_info::width.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void process_map_lore ( struct_map_info map) [static]

Extracts from the map's lore quest information if found.

May modify map->lore.

Parameters:
mapmap to process.

Definition at line 1297 of file mapper.c.

References add_map_to_quest(), define_quest(), and struct_map_info::lore.

Referenced by process_map().

Here is the call graph for this function:

Here is the caller graph for this function:

static void read_template ( const char *  name,
char **  buffer 
) [static]

Reads a file in memory.

Parameters:
namefile path to read.
bufferwhere to store. Can be left uninitialized in case of errors.
Note:
will exit() with code 1 if any error occurs or if the file doesn't exist.

Definition at line 895 of file mapper.c.

Referenced by main().

Here is the caller graph for this function:

static void relative_path ( const char *  from,
const char *  to,
char *  result 
) [static]

Computes the shortest path from one file to another.

Parameters:
fromorigin.
todestination.
resultstring that will contain the calculated path. Must be large enough, no test done.
Warning:
from and to must be absolute paths (starting with /).

Definition at line 1015 of file mapper.c.

Referenced by do_map_index(), and write_map_page().

Here is the caller graph for this function:

static void replace_map ( struct_map_info find,
struct_map_info replace_by,
struct_map_list list 
) [static]

Replaces a map in a map list.

Will emit a warning if map can't be found.

Parameters:
findmap to replace.
replace_byreplacement map.
listwhere to search.

Definition at line 1523 of file mapper.c.

References struct_map_list::count, struct_map_list::maps, and struct_map_info::path.

static void save_picture ( FILE *  file,
gdImagePtr  pic 
) [static]

Saves a map to a file, based on jpg/png settings.

Parameters:
fileopened file to which to save.
picpicture to save.

Definition at line 1699 of file mapper.c.

References jpeg_quality, OF_PNG, and output_format.

Referenced by do_tiled_map_picture(), process_map(), write_world_info(), and write_world_map().

Here is the caller graph for this function:

void set_darkness_map ( mapstruct m)

Set the darkness level for a map, based on the time of the day.

Parameters:
mmap to alter.

Definition at line 3924 of file mapper.c.

Referenced by ready_map_name().

Here is the caller graph for this function:

static int sort_equipment ( const void *  a,
const void *  b 
) [static]

Sort 2 struct_equipment, first on item power then name.

Parameters:
a
bitems to compare.
Returns:
-1, 0 or 1.

Definition at line 661 of file mapper.c.

References struct_equipment::name, struct_equipment::power, and strcasecmp().

Referenced by write_equipment_index().

Here is the call graph for this function:

Here is the caller graph for this function:

static int sort_map_info ( const void *  left,
const void *  right 
) [static]

Sorts the struct_map_info according to the map name or the path if equal.

Parameters:
leftfirst item.
rightsecond item.
Returns:
comparison on name, and if equal then on whole path.

Definition at line 1107 of file mapper.c.

References compare_map_info().

Referenced by do_map_index(), write_map_page(), and write_race_index().

Here is the call graph for this function:

Here is the caller graph for this function:

static int sort_map_info_by_level ( const void *  left,
const void *  right 
) [static]

Sorts the struct_map_info according to the map's level, and if equal the name or the path.

Parameters:
leftfirst item.
rightsecond item.
Returns:
comparison on name, and if equal then on whole path.

Definition at line 1123 of file mapper.c.

References compare_map_info(), and struct_map_info::level.

Referenced by write_maps_by_level().

Here is the call graph for this function:

Here is the caller graph for this function:

static int sort_mapname ( const void *  left,
const void *  right 
) [static]

Sorts the strings according to the last part of the filename (after the last /).

Parameters:
leftfirst string.
rightsecond string.
Returns:
comparison on last element, and if equal then on whole string.

Definition at line 1054 of file mapper.c.

References strcasecmp().

Referenced by write_one_slaying_info().

Here is the call graph for this function:

Here is the caller graph for this function:

static int sort_race ( const void *  a,
const void *  b 
) [static]

Sort 2 struct_race.

Parameters:
a
bitems to compare.
Returns:
-1, 0 or 1.

Definition at line 730 of file mapper.c.

References struct_race::name, and strcasecmp().

Referenced by write_map_page(), and write_race_index().

Here is the call graph for this function:

Here is the caller graph for this function:

static int sort_region ( const void *  left,
const void *  right 
) [static]

Sorts an array of struct_region_info by region name.

Parameters:
leftfirst region.
rightsecond region.
Returns:
result of strcmp() for names.

Definition at line 1142 of file mapper.c.

Referenced by write_all_regions().

Here is the caller graph for this function:

static int sort_slaying ( const void *  left,
const void *  right 
) [static]

Helper function to sort an array of struct_slaying_info.

Parameters:
leftfirst item.
rightsecond item.
Returns:
sort order.

Definition at line 3398 of file mapper.c.

References struct_slaying_info::slaying, and strcasecmp().

Referenced by write_npc_list(), and write_slaying_info().

Here is the call graph for this function:

Here is the caller graph for this function:

static int sort_struct_map_in_quest ( const void *  left,
const void *  right 
) [static]

Sorts 2 struct_map_in_quest, on the map's name or path.

Parameters:
left
rightitems to compare.
Returns:
-1, 0 or 1.

Definition at line 1248 of file mapper.c.

References struct_map_in_quest::map, struct_map_info::name, struct_map_info::path, strcasecmp(), and struct_map_info::tiled_group.

Referenced by write_quests_page().

Here is the call graph for this function:

Here is the caller graph for this function:

static int sortbyname ( const void *  a,
const void *  b 
) [static]

Sort values alphabetically Used by qsort to sort values alphabetically.

Parameters:
aFirst value
bSecond value
Returns:
-1 if a is less than b, 0 if a equals b, 1 else.

Definition at line 862 of file mapper.c.

Referenced by main().

Here is the caller graph for this function:

static int tiled_map_need_pic ( struct_map_info map) [static]

Definition at line 2859 of file mapper.c.

References struct_map_list::count, struct_map_list::maps, output_extensions, output_format, struct_map_info::path, struct_map_info::pic_was_done, root, snprintf(), and struct_map_info::tiled_maps.

Referenced by do_tiled_map_picture().

Here is the call graph for this function:

Here is the caller graph for this function:

void trap_adjust ( object *  ob,
int  x 
)

Adjust trap difficulty to the map.

The default traps are too strong for wimpy level 1 players, and unthreatening to anyone of high level

Parameters:
traptrap to adjust.
difficultymap difficulty.

Definition at line 3943 of file mapper.c.

Referenced by fix_generated_item().

Here is the caller graph for this function:

static void write_all_maps ( void  ) [static]

Ensures all maps have a name, and writes all map pages.

Definition at line 2847 of file mapper.c.

References struct_map_list::count, struct_map_list::maps, struct_map_info::tiled_group, and write_map_page().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void write_all_regions ( void  ) [static]

Generates all map indexes for a region.

Definition at line 2290 of file mapper.c.

References region_count, sort_region(), and write_region_page().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void write_equipment_index ( void  ) [static]

Writes the item page.

Definition at line 3122 of file mapper.c.

References struct_map_list::count, equipment_count, struct_equipment::origin, root, snprintf(), and sort_equipment().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void write_map_page ( struct_map_info map) [static]
static void write_maps_by_level ( void  ) [static]

Outputs the list of maps sorted by level.

Definition at line 3044 of file mapper.c.

References cat_template(), struct_map_list::count, do_template(), struct_map_info::level, level_map_template, level_template, level_value_template, struct_map_list::maps, struct_map_info::name, struct_map_info::path, root, snprintf(), sort_map_info_by_level(), and struct_map_info::tiled_group.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void write_maps_index ( void  ) [static]

Generates global map index, file maps.html.

Definition at line 2302 of file mapper.c.

References do_map_index(), index_letter, index_map, index_template, and root.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void write_npc_list ( void  ) [static]

Write the list of all found NPCs in maps.

Definition at line 3447 of file mapper.c.

References struct_npc_list::count, struct_map_list::count, struct_map_list::maps, MAX_BUF, struct_npc_info::message, struct_npc_info::name, struct_npc_list::npc, struct_map_info::npcs, struct_map_info::path, root, slaying_count, snprintf(), sort_slaying(), struct_npc_info::x, and struct_npc_info::y.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void write_one_slaying_info ( FILE *  file,
struct_slaying_info info,
int  item,
const char *  with,
const char *  without 
) [static]

Writes all maps of the specified slaying information.

Parameters:
filefile to write to.
infoslaying information to write.
itemwhich of the S_xxx to write.
withtext to write when there are maps to write. Mustn't be NULL.
withouttext to write when there are no maps. Can be NULL.

Definition at line 3367 of file mapper.c.

References struct_map_list::count, struct_map_list::maps, struct_slaying_info::maps, sort_mapname(), and write_slaying_map_name().

Referenced by write_slaying_info().

Here is the call graph for this function:

Here is the caller graph for this function:

static void write_quests_page ( void  ) [static]
static void write_race_index ( void  ) [static]

Writes the monster information page.

Definition at line 3155 of file mapper.c.

References struct_race_list::count, struct_map_list::count, struct_race::count, struct_map_list::maps, struct_race::name, struct_race::origin, struct_map_info::path, struct_race_list::races, root, snprintf(), sort_map_info(), and sort_race().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void write_region_index ( void  ) [static]

Generates region index.

Definition at line 2324 of file mapper.c.

References cat_template(), do_template(), get_region_longname(), index_region_region_template, index_region_template, regiondef::name, struct_region_info::reg, region_count, root, and snprintf().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void write_region_page ( struct_region_info reg) [static]

Generates the web page for a region.

Parameters:
regregion/maps for which to generate.
Note:
will sort the maps.

Definition at line 2257 of file mapper.c.

References do_map_index(), get_region_longname(), get_region_msg(), struct_region_info::maps_list, regiondef::name, struct_region_info::reg, region_letter_template, region_map_template, region_template, and root.

Referenced by write_all_regions().

Here is the call graph for this function:

Here is the caller graph for this function:

static void write_regions_link ( void  ) [static]

Write the .dot file representing links between regions.

Definition at line 3322 of file mapper.c.

References do_regions_link, MAX_BUF, regions_link, regions_link_count, root, and snprintf().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void write_slaying_info ( void  ) [static]

Writes all slaying info to file.

Definition at line 3408 of file mapper.c.

References struct_map_list::count, struct_slaying_info::maps, MAX_BUF, root, S_CONNECT, S_CONTAINER, S_DOOR, S_KEY, struct_slaying_info::slaying, slaying_count, snprintf(), sort_slaying(), and write_one_slaying_info().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void write_slaying_map_name ( FILE *  file,
struct_map_info map 
) [static]

Helper function to write a map to a file with its link and full path.

Parameters:
filewhere to write.
mapmap info to write.

Definition at line 3349 of file mapper.c.

References struct_map_info::name, struct_map_info::path, and struct_map_info::tiled_group.

Referenced by write_one_slaying_info().

Here is the caller graph for this function:

static void write_tiled_map_page ( struct_map_info map) [static]

Writes the page for a tiled map group.

Todo:
: do a real page, with the various levels, maps and such.

Definition at line 3022 of file mapper.c.

References do_tiled_map_picture(), and write_map_page().

Referenced by write_tiled_maps().

Here is the call graph for this function:

Here is the caller graph for this function:

static void write_tiled_maps ( void  ) [static]

Outputs all tiled map pages.

Definition at line 3032 of file mapper.c.

References struct_map_list::count, struct_map_list::maps, and write_tiled_map_page().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void write_world_info ( void  ) [static]

Writes the exit information world map.

Definition at line 3280 of file mapper.c.

References elevation_info, elevation_max, elevation_min, get_elevation_color(), infomap, MAX_BUF, output_extensions, output_format, root, save_picture(), snprintf(), and world_exit_info.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void write_world_map ( void  ) [static]

Generates a big world map.

Definition at line 2365 of file mapper.c.

References cat_template(), do_template(), infomap, OF_PNG, output_extensions, output_format, region_allocated, root, save_picture(), SIZE, small, snprintf(), struct_region_info::sum, struct_region_info::sum_x, struct_region_info::sum_y, world_map, world_map_template, world_row_template, and world_template.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static const char* yesno ( int  value) [static]

Helper to write yes/no.

Parameters:
valuevalue to print.
Returns:
"no" if value == 0, "yes" else.

Definition at line 3603 of file mapper.c.

Referenced by main().

Here is the caller graph for this function:


Variable Documentation

int cached_pics = 0 [static]

Non recreated pics.

Definition at line 421 of file mapper.c.

Referenced by main(), and process_map().

int color_blocking [static]

Block all movement.

Definition at line 469 of file mapper.c.

Referenced by do_exit_map(), and main().

int color_linked_exit [static]

Exit leading to another map.

Definition at line 467 of file mapper.c.

Referenced by do_exit_map(), and main().

int color_road [static]

Road or equivalent.

Definition at line 468 of file mapper.c.

Referenced by do_exit_map(), and main().

int color_slowing [static]

Slows movement.

Definition at line 470 of file mapper.c.

Referenced by do_exit_map(), and main().

int color_unlinked_exit [static]

Color for exits without a path set.

Definition at line 466 of file mapper.c.

Referenced by do_exit_map(), and main().

int created_pics = 0 [static]

Picture statistics.

Total created pics.

Definition at line 420 of file mapper.c.

Referenced by main(), and process_map().

int do_regions_link = 0 [static]

Definition at line 477 of file mapper.c.

Referenced by do_parameters(), main(), process_map(), and write_regions_link().

int** elevation_info [static]

All elevation spots in the "world_" maps.

Definition at line 472 of file mapper.c.

Referenced by do_exit_map(), main(), and write_world_info().

int elevation_max [static]

Lowest elevation found.

Definition at line 474 of file mapper.c.

Referenced by do_exit_map(), get_elevation_color(), main(), and write_world_info().

int elevation_min [static]

Maximal elevation found.

Definition at line 473 of file mapper.c.

Referenced by do_exit_map(), get_elevation_color(), main(), and write_world_info().

int equipment_allocated = 0 [static]

Allocated items in special_equipment.

Definition at line 309 of file mapper.c.

Referenced by ensure_unique().

int equipment_count = 0 [static]

Number of items in special_equipment.

Definition at line 307 of file mapper.c.

Referenced by ensure_unique(), and write_equipment_index().

int force_pics = 0 [static]

To force picture regeneration even if map didn't change.

Definition at line 368 of file mapper.c.

Referenced by do_parameters(), main(), and process_map().

char** found_maps = NULL [static]

Maps found in directories.

Definition at line 460 of file mapper.c.

Referenced by dump_unused_maps(), find_maps(), list_map(), and main().

int found_maps_allocated = 0 [static]

Allocated size of found_maps.

Definition at line 462 of file mapper.c.

Referenced by find_maps().

int found_maps_count = 0 [static]

Number of items in found_maps.

Definition at line 461 of file mapper.c.

Referenced by dump_unused_maps(), find_maps(), list_map(), and main().

gdImagePtr* gdfaces [static]

Definition at line 227 of file mapper.c.

Referenced by main(), and process_map().

int generate_index = 1 [static]

Whether to do the map index or not.

Definition at line 369 of file mapper.c.

Referenced by do_map_index(), do_parameters(), and main().

int generate_pics = 1 [static]

Whether to generate the picture or not.

Definition at line 367 of file mapper.c.

Referenced by do_parameters(), do_tiled_map_picture(), main(), and process_map().

const char* ignore_name[] [static]
Initial value:
 {
    ".",
    "..",
    ".svn",
    "README",
    NULL }

File names to ignore for map search.

Definition at line 3199 of file mapper.c.

Referenced by find_maps().

const char* ignore_path[] [static]
Initial value:
 {
    "/Info",
    "/editor",
    "/python",
    "/styles",
    "/templates",
    "/test",
    "/unlinked",
    NULL }

Directories to ignore for map search.

Definition at line 3188 of file mapper.c.

Referenced by find_maps().

char* index_letter [static]

Index page template: one letter, including the maps it contains.

Definition at line 397 of file mapper.c.

Referenced by main(), and write_maps_index().

char* index_map [static]

Index page template: one map.

Definition at line 398 of file mapper.c.

Referenced by main(), and write_maps_index().

char* index_quest_template [static]

Definition at line 411 of file mapper.c.

Referenced by main(), and write_quests_page().

One region in the region index template.

Definition at line 405 of file mapper.c.

Referenced by main(), and write_region_index().

char* index_region_template [static]

Region index template.

Definition at line 404 of file mapper.c.

Referenced by main(), and write_region_index().

char* index_template [static]

Index page template.

Definition at line 396 of file mapper.c.

Referenced by main(), and write_maps_index().

gdImagePtr infomap [static]

World map with exits / roads / blocking / ...

Definition at line 465 of file mapper.c.

Referenced by do_exit_map(), main(), write_world_info(), and write_world_map().

int jpeg_quality = -1 [static]

Quality for jpg pictures.

Definition at line 439 of file mapper.c.

Referenced by do_parameters(), main(), and save_picture().

char* level_map_template [static]

Definition at line 409 of file mapper.c.

Referenced by main(), and write_maps_by_level().

char* level_template [static]

Definition at line 407 of file mapper.c.

Referenced by main(), and write_maps_by_level().

char* level_value_template [static]

Definition at line 408 of file mapper.c.

Referenced by main(), and write_maps_by_level().

int list_unused_maps = 0 [static]

If set, program will list maps found in directory but not linked from the first maps.

Definition at line 459 of file mapper.c.

Referenced by do_parameters(), main(), and process_map().

char* map_exit_template [static]

Map template: one exit.

Definition at line 384 of file mapper.c.

Referenced by main(), and write_map_page().

char* map_exit_to_template [static]

Map template: one exit leading to this map.

Definition at line 387 of file mapper.c.

Referenced by main(), and write_map_page().

int map_limit = -1 [static]

Maximum number of maps to browse, -1 for all.

Definition at line 371 of file mapper.c.

Referenced by do_parameters(), and main().

char* map_lore_template [static]

Map template: lore.

Definition at line 388 of file mapper.c.

Referenced by main(), and write_map_page().

Map template: after the monster list.

Definition at line 394 of file mapper.c.

Referenced by main(), and write_map_page().

Map template: before the monster list.

Definition at line 391 of file mapper.c.

Referenced by main(), and write_map_page().

Map template: between each monster.

Definition at line 392 of file mapper.c.

Referenced by main(), and write_map_page().

char* map_monster_one_template [static]

Map template: one monster.

Definition at line 393 of file mapper.c.

Referenced by main(), and write_map_page().

char* map_no_exit_template [static]

World map template: no exit.

Definition at line 382 of file mapper.c.

Referenced by main(), and write_map_page().

char* map_no_exit_to_template [static]

World map template: no exit leading to this map.

Definition at line 385 of file mapper.c.

Referenced by main(), and write_map_page().

char* map_no_lore_template [static]

Map template: no lore.

Definition at line 389 of file mapper.c.

Referenced by main(), and write_map_page().

char* map_no_monster_template [static]

Map template: no monster.

Definition at line 390 of file mapper.c.

Referenced by main(), and write_map_page().

char* map_no_quest_template [static]

Definition at line 415 of file mapper.c.

Referenced by main(), and write_map_page().

char* map_one_quest_template [static]

Definition at line 417 of file mapper.c.

Referenced by main(), and write_map_page().

char* map_template [static]

Map template.

Definition at line 381 of file mapper.c.

Referenced by main(), and write_map_page().

char* map_with_exit_template [static]

Map template: exit template.

Definition at line 383 of file mapper.c.

Referenced by main(), and write_map_page().

char* map_with_exit_to_template [static]

Map template: exits leading to this map.

Definition at line 386 of file mapper.c.

Referenced by main(), and write_map_page().

char* map_with_quests_template [static]

Definition at line 416 of file mapper.c.

Referenced by main(), and write_map_page().

Maps to process or found.

Definition at line 291 of file mapper.c.

nrofpixmaps is the number of bitmaps loaded.

With the automatic generation of the bmaps file, this is now equal to nroffiles.

Definition at line 76 of file image.c.

Referenced by do_server(), esrv_send_face(), CREResourcesWindow::fillFaces(), find_smooth(), free_socket_images(), init_connection(), main(), read_bmap_names(), read_client_images(), send_image_info(), and send_image_sums().

const char* output_extensions[] [static]
Initial value:
 {
    ".png",
    ".jpg"
}

Extensions depending on output format.

Definition at line 430 of file mapper.c.

Referenced by do_tiled_map_picture(), main(), process_map(), tiled_map_need_pic(), write_map_page(), write_world_info(), and write_world_map().

int pics_allocated [static]

Number of created pictures for GD.

Definition at line 364 of file mapper.c.

Referenced by main(), and process_map().

char* quest_map_template [static]

Definition at line 413 of file mapper.c.

Referenced by main(), and write_quests_page().

char* quest_template [static]

Definition at line 412 of file mapper.c.

Referenced by main(), and write_quests_page().

struct_quest** quests = NULL [static]

All quests in the game.

Definition at line 1166 of file mapper.c.

Referenced by write_map_page().

int quests_allocated = 0 [static]

Allocated items in quests.

Definition at line 1170 of file mapper.c.

Referenced by get_quest_info().

int quests_count = 0 [static]

Count of quests.

Definition at line 1168 of file mapper.c.

Referenced by get_quest_info(), and write_quests_page().

Monsters found in maps.

Definition at line 319 of file mapper.c.

int rawmaps = 0 [static]

Whether to generate raw pics or instancied ones.

Definition at line 442 of file mapper.c.

Referenced by do_parameters(), main(), and process_map().

int region_allocated = 0 [static]

Allocated size of regions.

Definition at line 457 of file mapper.c.

Referenced by add_map_to_region(), and write_world_map().

int region_count = 0 [static]
char* region_letter_template [static]

One letter for the region.

Definition at line 401 of file mapper.c.

Referenced by main(), and write_region_page().

char* region_map_template [static]

Region page template: one map.

Definition at line 402 of file mapper.c.

Referenced by main(), and write_region_page().

char* region_template [static]

Region page template.

Definition at line 400 of file mapper.c.

Referenced by main(), and write_region_page().

struct struct_region_info** regions = NULL [static]

Found regions.

Definition at line 455 of file mapper.c.

char** regions_link [static]

Definition at line 478 of file mapper.c.

Referenced by add_region_link(), and write_regions_link().

int regions_link_allocated = 0 [static]

Definition at line 480 of file mapper.c.

Referenced by add_region_link().

int regions_link_count = 0 [static]

Definition at line 479 of file mapper.c.

Referenced by add_region_link(), and write_regions_link().

char root[500] [static]
int show_maps = 0 [static]

If set, will generate much information on map loaded.

Definition at line 372 of file mapper.c.

Referenced by do_parameters(), main(), and process_map().

int size_small = 16 [static]

Tile size for small map.

Definition at line 370 of file mapper.c.

Referenced by do_tiled_map_picture(), and process_map().

int slaying_allocated = 0 [static]

Allocated size of slaying_info.

Definition at line 498 of file mapper.c.

Referenced by get_slaying_struct().

int slaying_count = 0 [static]

Count of items in slaying_info.

Definition at line 497 of file mapper.c.

Referenced by get_slaying_struct(), write_npc_list(), and write_slaying_info().

struct_slaying_info** slaying_info = NULL [static]

Found slaying fields.

Definition at line 496 of file mapper.c.

Special equipment list.

Definition at line 305 of file mapper.c.

Pseudo-maps grouping other maps.

Definition at line 294 of file mapper.c.

int tileset = 0 [static]

Tileset to use to generate pics.

Definition at line 375 of file mapper.c.

Referenced by do_parameters(), main(), and process_map().

int warn_no_path = 0 [static]

Whether to warn of exits without a path.

Definition at line 445 of file mapper.c.

Referenced by do_parameters(), main(), and process_map().

int world_exit_info = 1 [static]

If set, will generate a world map of exits.

Definition at line 374 of file mapper.c.

Referenced by do_parameters(), main(), and write_world_info().

int world_map = 1 [static]

If set, will generate a world map.

Definition at line 373 of file mapper.c.

Referenced by do_parameters(), main(), and write_world_map().

char* world_map_template [static]

One map in a row.

Definition at line 379 of file mapper.c.

Referenced by main(), and write_world_map().

char* world_row_template [static]

One row in the world map.

Definition at line 378 of file mapper.c.

Referenced by main(), and write_world_map().

char* world_template [static]

World map template.

Definition at line 377 of file mapper.c.

Referenced by main(), and write_world_map().