Definition in file lev_data.h.
#include "globals.h"
Go to the source code of this file.
Data Structures | |
| struct | DK_GRAFFITI |
| Graffiti structure. More... | |
| struct | DK_SCRIPT_PLAYER |
| Script player structure. More... | |
| struct | DK_SCRIPT_PARTYMEMBER |
| Script party member structure. More... | |
| struct | DK_SCRIPT_PARTY |
| Script party structure. More... | |
| struct | DK_SCRIPT_ADDEVENT |
| Script add event structure. More... | |
| struct | DK_SCRIPT_PARAMETERS |
| Script parameters structure. More... | |
| struct | DK_SCRIPT |
| Complete level script structure. More... | |
| struct | LEVSTATS |
| Level statistics structure. More... | |
| struct | LEVINFO |
| Level information structure. More... | |
| struct | LEVEL |
| The main Level data structure. More... | |
Defines | |
| #define | MAP_SIZE_DKSTD_X 85 |
| #define | MAP_SIZE_DKSTD_Y 85 |
| #define | MAP_SIZE_H 1 |
| #define | MAP_SUBNUM_H 8 |
| #define | MAP_SUBNUM_X 3 |
| #define | MAP_SUBNUM_Y 3 |
| #define | COLUMN_ENTRIES 2048 |
| #define | SIZEOF_DK_TNG_REC 21 |
| #define | SIZEOF_DK_CLM_REC 24 |
| #define | SIZEOF_DK_APT_REC 8 |
| #define | SIZEOF_DK_LGT_REC 20 |
| #define | SIZEOF_DK_CLM_HEADER 8 |
| #define | SIZEOF_DK_APT_HEADER 4 |
| #define | SIZEOF_DK_LGT_HEADER 4 |
| #define | SIZEOF_DK_TNG_HEADER 2 |
Enumerations | |
| enum | MAP_FORMAT_VERSION { MFV_DKSTD = 0, MFV_DKGOLD = 1, MFV_DKXPAND = 2, MFV_DK2STD = 10, MFV_DK2OFC = 11 } |
| Map format type selection. More... | |
| enum | OBJECT_TYPE_INDEX { OBJECT_TYPE_NONE = 0, OBJECT_TYPE_ACTNPT = 1, OBJECT_TYPE_THING = 2, OBJECT_TYPE_STLIGHT = 3, OBJECT_TYPE_COLUMN = 16, OBJECT_TYPE_SLAB = 17, OBJECT_TYPE_DATLST = 18 } |
| enum | VERIFY_WARN_FLAGS { VWFLAG_NONE = 0, VWFLAG_NOWARN_MANYHEART = 1 } |
| enum | DIRECTION_INDEX { IDIR_CENTR = 4, IDIR_NW = 0, IDIR_NORTH = 1, IDIR_NE = 2, IDIR_EAST = 5, IDIR_SE = 8, IDIR_SOUTH = 7, IDIR_SW = 6, IDIR_WEST = 3 } |
| Direction indices. More... | |
| enum | GRAFFITI_ORIENT { ORIENT_NS = 0x00, ORIENT_WE = 0x01, ORIENT_SN = 0x02, ORIENT_EW = 0x03, ORIENT_TNS = 0x04, ORIENT_TWE = 0x05, ORIENT_TSN = 0x06, ORIENT_TEW = 0x07 } |
| Orientation - for graffiti. More... | |
| enum | GRAFFITI_FONT { GRAFF_FONT_NONE = 0x00, GRAFF_FONT_ADICLSSC = 0x01, GRAFF_FONT_ADISIZE8 = 0x02 } |
| Font - for graffiti. More... | |
| enum | STATS_LINE_TYPE { STLT_NONE = 0, STLT_HEADER = 1, STLT_MAINITEM = 2, STLT_SUBITEM = 3, STLT_EMPTY = 4 } |
| Statistics line types. More... | |
Functions | |
| DLLIMPORT short | level_init (struct LEVEL **lvl_ptr, short map_version, struct UPOINT_3D *lvl_size) |
| Creates object for storing one level. | |
| DLLIMPORT short | level_deinit (struct LEVEL **lvl_ptr) |
| Frees structures for storing level. | |
| DLLIMPORT short | level_set_options (struct LEVEL *lvl, struct LEVOPTIONS *optns) |
| Sets all options for the LEVEL structure from another LEVOPTIONS. | |
| DLLIMPORT struct LEVOPTIONS * | level_get_options (struct LEVEL *lvl) |
| Gets all options for the LEVEL structure. | |
| DLLIMPORT short | level_set_mapdraw_options (struct LEVEL *lvl, struct MAPDRAW_OPTIONS *mdrwopts) |
| Sets the map drawing options for the LEVEL structure from another MAPDRAW_OPTIONS. | |
| DLLIMPORT struct MAPDRAW_OPTIONS * | level_get_mapdraw_options (struct LEVEL *lvl) |
| Gets the map drawing options for the LEVEL structure. | |
| DLLIMPORT short | level_clear (struct LEVEL *lvl) |
| Clears the whole object for storing level. | |
| short | level_clear_tng (struct LEVEL *lvl) |
| Clears the "things" structure for storing level. | |
| short | level_clear_apt (struct LEVEL *lvl) |
| clears the "actions" structure for storing level. | |
| short | level_clear_lgt (struct LEVEL *lvl) |
| clears the "lights" structure for storing level. | |
| short | level_clear_datclm (struct LEVEL *lvl) |
| Clears the "column" structure for storing level. | |
| short | level_clear_other (struct LEVEL *lvl) |
| Clears minor LEVEL substructures. | |
| short | level_clear_stats (struct LEVEL *lvl) |
| Clears (via zeroing) stats for given level. | |
| short | level_clear_info (struct LEVEL *lvl) |
| Clears (sets for new map) info for given level. | |
| short | level_clear_script (struct LEVEL *lvl) |
| Clears (via zeroing) TXT script info for given level. | |
| DLLIMPORT short | level_clear_script_param (struct DK_SCRIPT_PARAMETERS *par) |
| Clears (via zeroing) given script parameters struct. | |
| DLLIMPORT short | level_clear_options (struct LEVOPTIONS *optns) |
| Clears options for given level. | |
| DLLIMPORT short | level_free (struct LEVEL *lvl) |
| Frees structures for storing level. | |
| short | level_free_tng (struct LEVEL *lvl) |
| Frees "things" structure for storing level. | |
| DLLIMPORT short | level_free_script_param (struct DK_SCRIPT_PARAMETERS *par) |
| Frees all sub-structures of given DK_SCRIPT_PARAMETERS. | |
| DLLIMPORT short | free_text_file (char ***lines, int *lines_count) |
| Frees any text file loaded as lines. | |
| DLLIMPORT short | level_verify (struct LEVEL *lvl, char *actn_name, struct IPOINT_2D *errpt) |
| Verifies the whole level. | |
| DLLIMPORT short | level_verify_struct (struct LEVEL *lvl, char *err_msg, struct IPOINT_2D *errpt) |
| Verifies internal LEVEL structure integrity. | |
| short | actnpts_verify (struct LEVEL *lvl, char *err_msg, struct IPOINT_2D *errpt) |
| Verifies action points parameters. | |
| DLLIMPORT short | level_verify_logic (struct LEVEL *lvl, char *err_msg, struct IPOINT_2D *errpt) |
| Verifies various logic aspects of a map. | |
| DLLIMPORT void | start_new_map (struct LEVEL *lvl) |
| Creates new level. | |
| DLLIMPORT void | generate_random_map (struct LEVEL *lvl) |
| Creates random level. | |
| DLLIMPORT void | generate_slab_bkgnd_default (struct LEVEL *lvl, unsigned short def_slab) |
| Fills SLB/OWN structure with "default" background. | |
| DLLIMPORT void | generate_slab_bkgnd_random (struct LEVEL *lvl) |
| Fills SLB/OWN structure with "random" background. | |
| DLLIMPORT short | level_generate_random_extension (struct LEVEL *lvl, char *ret_msg) |
| Adds random extension to the level. | |
| DLLIMPORT struct DK_SCRIPT_PARAMETERS * | level_get_script_param (struct LEVEL *lvl) |
| Returns DK_SCRIPT_PARAMETERS struct for given level. | |
| DLLIMPORT void | free_map (struct LEVEL *lvl) |
| Frees the level data stored in LEVEL structure. | |
| DLLIMPORT char * | get_thing (const struct LEVEL *lvl, unsigned int sx, unsigned int sy, unsigned int num) |
| Returns thing data for thing at given position. | |
| DLLIMPORT int | thing_add (struct LEVEL *lvl, unsigned char *thing) |
| Adds a thing to the structure and returns its index. | |
| DLLIMPORT void | thing_del (struct LEVEL *lvl, unsigned int sx, unsigned int sy, unsigned int num) |
| Removes given thing from the LEVEL structure, updates counter variables. | |
| DLLIMPORT void | thing_drop (struct LEVEL *lvl, unsigned int sx, unsigned int sy, unsigned int num) |
| Removes given thing from the LEVEL structure, updates counter variables. | |
| DLLIMPORT unsigned int | get_thing_subnums (const struct LEVEL *lvl, unsigned int sx, unsigned int sy) |
| Gives amount of things existing at given subtile. | |
| DLLIMPORT char * | get_actnpt (const struct LEVEL *lvl, unsigned int sx, unsigned int sy, unsigned int num) |
| Returns action point data for action point at given position. | |
| DLLIMPORT int | actnpt_add (struct LEVEL *lvl, unsigned char *actnpt) |
| Adds a given action point to the LEVEL structure. | |
| DLLIMPORT void | actnpt_del (struct LEVEL *lvl, unsigned int sx, unsigned int sy, unsigned int num) |
| Removes given action point from the LEVEL structure. | |
| DLLIMPORT unsigned int | get_actnpt_subnums (const struct LEVEL *lvl, unsigned int sx, unsigned int sy) |
| Gives amount of action points existing at given subtile. | |
| DLLIMPORT char * | get_stlight (const struct LEVEL *lvl, unsigned int sx, unsigned int sy, unsigned int num) |
| Returns static light data for light at given position. | |
| DLLIMPORT int | stlight_add (struct LEVEL *lvl, unsigned char *stlight) |
| Adds a given static light to the LEVEL structure. | |
| DLLIMPORT void | stlight_del (struct LEVEL *lvl, unsigned int sx, unsigned int sy, unsigned int num) |
| Removes given static light from the LEVEL structure. | |
| DLLIMPORT unsigned int | get_stlight_subnums (const struct LEVEL *lvl, unsigned int sx, unsigned int sy) |
| Gives amount of static lights existing at given subtile. | |
| DLLIMPORT short | get_object_type (const struct LEVEL *lvl, unsigned int sx, unsigned int sy, unsigned int z) |
| Checks what type the object is. | |
| DLLIMPORT unsigned char * | get_object (const struct LEVEL *lvl, unsigned int sx, unsigned int sy, unsigned int z) |
| Returns data for specific object at given position. | |
| DLLIMPORT void | object_del (struct LEVEL *lvl, unsigned int sx, unsigned int sy, unsigned int z) |
| Deletes object with given coordinates and index. | |
| DLLIMPORT unsigned int | get_object_subnums (const struct LEVEL *lvl, unsigned int sx, unsigned int sy) |
| Gives amount of objects existing at given subtile. | |
| DLLIMPORT unsigned int | get_object_tilnums (const struct LEVEL *lvl, unsigned int tx, unsigned int ty) |
| Gives amount of objects existing at given tile. | |
| DLLIMPORT int | get_object_subtl_last (const struct LEVEL *lvl, unsigned int sx, unsigned int sy, short obj_type) |
| Gives index of the last object with given type. | |
| DLLIMPORT void | update_object_owners (struct LEVEL *lvl) |
| DLLIMPORT unsigned int | get_lgt_total_count (struct LEVEL *lvl) |
| Returns total number of static lights on the level. | |
| DLLIMPORT unsigned int | get_apt_total_count (struct LEVEL *lvl) |
| Returns total number of action points on the level. | |
| DLLIMPORT unsigned int | get_tng_total_count (struct LEVEL *lvl) |
| Returns total number of things on the level. | |
| DLLIMPORT short | get_datclm_auto_update (struct LEVEL *lvl) |
| Returns state of the datclm_auto_update option for the level. | |
| DLLIMPORT short | switch_datclm_auto_update (struct LEVEL *lvl) |
| Switches state of the datclm_auto_update option for the level. | |
| DLLIMPORT short | set_datclm_auto_update (struct LEVEL *lvl, short val) |
| Sets state of the datclm_auto_update option for the level. | |
| DLLIMPORT short | get_obj_auto_update (struct LEVEL *lvl) |
| Returns state of the obj_auto_update option for the level. | |
| DLLIMPORT short | switch_obj_auto_update (struct LEVEL *lvl) |
| Switches state of the obj_auto_update option for the level. | |
| DLLIMPORT short | set_obj_auto_update (struct LEVEL *lvl, short val) |
| Sets state of the obj_auto_update option for the level. | |
| DLLIMPORT short | get_subtl_wib (struct LEVEL *lvl, unsigned int sx, unsigned int sy) |
| Gives WIBble value for a subtile. | |
| DLLIMPORT void | set_subtl_wib (struct LEVEL *lvl, unsigned int sx, unsigned int sy, short nval) |
| Sets WIBble value for a subtile. | |
| DLLIMPORT short | get_tile_wlb (struct LEVEL *lvl, unsigned int tx, unsigned int ty) |
| Gives WLB (Water-Lava Block) value for a tile. | |
| DLLIMPORT void | set_tile_wlb (struct LEVEL *lvl, unsigned int tx, unsigned int ty, short nval) |
| Sets WLB (Water-Lava Block) value for a tile. | |
| DLLIMPORT unsigned char | get_tile_owner (const struct LEVEL *lvl, unsigned int tx, unsigned int ty) |
| Gives owner (OWN value) for a tile. | |
| DLLIMPORT void | set_tile_owner (struct LEVEL *lvl, unsigned int tx, unsigned int ty, unsigned char nval) |
| Sets owner (OWN value) for a tile. | |
| DLLIMPORT unsigned char | get_subtl_owner (const struct LEVEL *lvl, unsigned int sx, unsigned int sy) |
| Gives owner (OWN value) for a subtile. | |
| DLLIMPORT void | set_subtl_owner (struct LEVEL *lvl, unsigned int sx, unsigned int sy, unsigned char nval) |
| Sets owner (OWN value) for a subtile. | |
| DLLIMPORT short | user_set_tile_owner (struct LEVEL *lvl, unsigned int tx, unsigned int ty, unsigned short nown) |
| Changes owner of one slab on map. | |
| DLLIMPORT short | user_set_owner_rect (struct LEVEL *lvl, unsigned int startx, unsigned int endx, unsigned int starty, unsigned int endy, unsigned short nown) |
| Changes owner of a map rectangle. | |
| DLLIMPORT unsigned short | get_tile_slab (const struct LEVEL *lvl, unsigned int tx, unsigned int ty) |
| Gives slab (SLB value) for a tile. | |
| DLLIMPORT void | set_tile_slab (struct LEVEL *lvl, unsigned int tx, unsigned int ty, unsigned short nval) |
| Sets a new value to SLB item, without updating DAT or CLM or anything. | |
| DLLIMPORT short | user_set_slab (struct LEVEL *lvl, unsigned int tx, unsigned int ty, unsigned short nslab) |
| Puts a new slab on map. | |
| DLLIMPORT short | user_set_slab_rect (struct LEVEL *lvl, unsigned int startx, unsigned int endx, unsigned int starty, unsigned int endy, unsigned short nslab) |
| Puts a rectangle of new slabs on map. | |
| DLLIMPORT short | user_set_slabown_rect (struct LEVEL *lvl, unsigned int startx, unsigned int endx, unsigned int starty, unsigned int endy, unsigned short nslab, unsigned short nown) |
| Puts a rectangle of new slabs on map. | |
| DLLIMPORT unsigned int | get_dat_val (const struct LEVEL *lvl, const unsigned int sx, const unsigned int sy) |
| Returns raw DAT value for one subtile. | |
| DLLIMPORT void | set_dat_val (struct LEVEL *lvl, int sx, int sy, unsigned int d) |
| Sets a DAT value for one subtile. | |
| DLLIMPORT unsigned short | get_subtl_flg (struct LEVEL *lvl, unsigned int sx, unsigned int sy) |
| Returns FLG value for one subtile. | |
| DLLIMPORT void | set_subtl_flg (struct LEVEL *lvl, unsigned int sx, unsigned int sy, unsigned short nval) |
| Sets a FLG value for one subtile. | |
| DLLIMPORT short | set_lvl_fname (struct LEVEL *lvl, char *fname) |
| Sets map file name for the level. | |
| DLLIMPORT short | format_lvl_fname (struct LEVEL *lvl, char *namefmt) |
| Sets map file name for the level, using given format string. | |
| DLLIMPORT char * | get_lvl_fname (struct LEVEL *lvl) |
| Returns map file name for the level. | |
| DLLIMPORT short | set_lvl_savfname (struct LEVEL *lvl, char *fname) |
| Sets map file name for saving the level. | |
| DLLIMPORT short | format_lvl_savfname (struct LEVEL *lvl, char *namefmt) |
| Sets map save file name for the level, using given format string. | |
| DLLIMPORT char * | get_lvl_savfname (struct LEVEL *lvl) |
| Returns save file name for the level. | |
| DLLIMPORT short | set_levels_path (struct LEVEL *lvl, char *lvpath) |
| Sets path at which maps are. | |
| DLLIMPORT char * | get_levels_path (struct LEVEL *lvl) |
| Returns path to folder with levels. | |
| DLLIMPORT short | set_data_path (struct LEVEL *lvl, char *datpath) |
| Sets path at which data files are. | |
| DLLIMPORT char * | get_data_path (struct LEVEL *lvl) |
| Returns path to folder with data files. | |
| DLLIMPORT char * | get_lif_name_text (struct LEVEL *lvl) |
| Returns text name of the level, from LIF file. | |
| DLLIMPORT short | set_lif_name_text (struct LEVEL *lvl, char *name) |
| Sets text name of the level, from LIF file. | |
| DLLIMPORT struct DK_SCRIPT * | get_lvl_script (struct LEVEL *lvl) |
| Returns pointer to the level script structure. | |
| DLLIMPORT struct LEVSTATS * | get_lvl_stats (struct LEVEL *lvl) |
| Returns pointer to the level statistics structure. | |
| DLLIMPORT unsigned long | inc_info_usr_mdswtch_count (struct LEVEL *lvl) |
| Increases mode switches counter. | |
| DLLIMPORT unsigned long | inc_info_usr_cmds_count (struct LEVEL *lvl) |
| Increases total user commands counter. | |
| DLLIMPORT unsigned long | inc_info_usr_slbchng_count (struct LEVEL *lvl) |
| Increases SLB changes counter. | |
| DLLIMPORT unsigned long | inc_info_usr_creatobj_count (struct LEVEL *lvl) |
| Increases user objects created counter. | |
| DLLIMPORT unsigned int | inc_info_ver_major (struct LEVEL *lvl) |
| Increases major version number for the level. | |
| DLLIMPORT unsigned int | inc_info_ver_minor (struct LEVEL *lvl) |
| Increases minor version number for the level. | |
| DLLIMPORT unsigned int | inc_info_ver_rel (struct LEVEL *lvl) |
| Increases version release number for the level. | |
| DLLIMPORT void | update_level_stats (struct LEVEL *lvl) |
| Updates some statistics about the level. | |
| DLLIMPORT void | update_things_stats (struct LEVEL *lvl) |
| Updates statistics about the level. | |
| DLLIMPORT void | update_thing_stats (struct LEVEL *lvl, const unsigned char *thing, short change) |
| Updates statistics about the thing. | |
| DLLIMPORT short | get_level_objstats_textln (struct LEVEL *lvl, char *stat_buf, const int line_num) |
| Formats object statistics text line. | |
| DLLIMPORT unsigned char | get_lvl_inf (struct LEVEL *lvl) |
| Returns INF entry (texture index) for the level. | |
| DLLIMPORT short | set_lvl_inf (struct LEVEL *lvl, unsigned char ninf) |
| Sets INF entry (texture index) for the level. | |
| DLLIMPORT short | get_lvl_format_version (struct LEVEL *lvl) |
| Returns level format version. | |
Variables | |
| const int | idir_subtl_x [] |
| const int | idir_subtl_y [] |
| const char | default_map_name [] |
| #define COLUMN_ENTRIES 2048 |
Definition at line 31 of file lev_data.h.
Referenced by clm_utilize_dec(), clm_utilize_inc(), column_find_or_create(), column_get_free_index(), columns_verify(), dat_verify(), get_subtile_column(), level_clear_datclm(), level_deinit(), level_init(), level_verify_struct(), load_clm(), update_clm_utilize_counters(), write_clm(), and write_def_clm_source().
| #define MAP_SIZE_DKSTD_X 85 |
| #define MAP_SIZE_DKSTD_Y 85 |
| #define MAP_SIZE_H 1 |
Definition at line 27 of file lev_data.h.
| #define MAP_SUBNUM_H 8 |
| #define MAP_SUBNUM_X 3 |
Definition at line 29 of file lev_data.h.
Referenced by actnpt_add(), actnpt_del(), actnpts_verify(), columns_verify(), compute_door_orientation(), compute_effectgen_sensitile(), compute_item_sensitile(), compute_torch_sensitile(), create_actnpt(), create_actnpt_number_used_arr(), create_creature(), create_door(), create_doorkey(), create_effectgen(), create_herogate_number_used_arr(), create_item(), create_item_adv(), create_stlight(), create_stlight_copy(), create_thing(), create_thing_copy(), create_torch(), create_trap(), cust_cols_del_for_tile(), cust_cols_num_on_tile(), dat_verify(), delete_room_things(), draw_map_on_buffer(), effectgen_verify(), generate_random_map(), get_actnpt(), get_actnpt_subnums(), get_draw_tile_rect(), get_free_indexedthing_number(), get_object(), get_object_subnums(), get_object_subtl_last(), get_object_type(), get_slab_surround(), get_stlight(), get_stlight_subnums(), get_thing(), get_thing_subnums(), get_tile_owner(), item_verify(), level_clear_apt(), level_clear_datclm(), level_clear_lgt(), level_clear_other(), level_clear_tng(), level_deinit(), level_free_apt(), level_free_lgt(), level_free_tng(), level_init(), level_set_size(), level_verify_logic(), level_verify_struct(), mdrand_t8(), object_del(), owned_things_count(), place_graffiti_on_slab(), set_graffiti_orientation(), set_new_datclm_values(), set_tile_owner(), start_new_map(), stlight_add(), stlight_del(), subtl_in_effectgen_range(), subtl_is_near_tall_slab(), thing_add(), thing_del(), thing_drop(), thing_verify(), things_verify(), update_dat_last_column(), update_door_things_on_slab(), update_thing_slb_room_one_central_item(), update_thing_slb_room_one_item_subtl(), update_thing_subpos_and_height(), update_things_slb_barracks_corner(), update_things_slb_graveyard_corner(), update_things_slb_portal_inside(), update_things_stats(), update_tile_flg_entries(), update_tile_wib_entries(), write_apt(), write_def_clm_source(), write_def_tng_source(), write_lgt(), and write_tng().
| #define MAP_SUBNUM_Y 3 |
Definition at line 30 of file lev_data.h.
Referenced by actnpt_add(), actnpt_del(), actnpts_verify(), columns_verify(), compute_door_orientation(), compute_effectgen_sensitile(), compute_item_sensitile(), compute_torch_sensitile(), create_actnpt(), create_actnpt_number_used_arr(), create_creature(), create_door(), create_doorkey(), create_effectgen(), create_herogate_number_used_arr(), create_item(), create_item_adv(), create_stlight(), create_stlight_copy(), create_thing(), create_thing_copy(), create_torch(), create_trap(), cust_cols_del_for_tile(), cust_cols_num_on_tile(), dat_verify(), delete_room_things(), draw_map_on_buffer(), effectgen_verify(), generate_random_map(), get_actnpt(), get_actnpt_subnums(), get_draw_tile_rect(), get_free_indexedthing_number(), get_object(), get_object_subnums(), get_object_subtl_last(), get_object_type(), get_slab_surround(), get_stlight(), get_stlight_subnums(), get_thing(), get_thing_subnums(), get_tile_owner(), item_verify(), level_clear_apt(), level_clear_datclm(), level_clear_lgt(), level_clear_other(), level_clear_tng(), level_deinit(), level_free_apt(), level_free_lgt(), level_free_tng(), level_init(), level_set_size(), level_verify_logic(), level_verify_struct(), mdrand_t8(), object_del(), owned_things_count(), place_graffiti_on_slab(), set_graffiti_orientation(), set_new_datclm_values(), set_tile_owner(), start_new_map(), stlight_add(), stlight_del(), subtl_in_effectgen_range(), subtl_is_near_tall_slab(), thing_add(), thing_del(), thing_drop(), thing_verify(), things_verify(), update_dat_last_column(), update_door_things_on_slab(), update_thing_slb_room_one_central_item(), update_thing_slb_room_one_item_subtl(), update_thing_subpos_and_height(), update_things_slb_barracks_corner(), update_things_slb_graveyard_corner(), update_things_slb_portal_inside(), update_things_stats(), update_tile_flg_entries(), update_tile_wib_entries(), write_apt(), write_def_clm_source(), write_def_tng_source(), write_lgt(), and write_tng().
| #define SIZEOF_DK_APT_HEADER 4 |
| #define SIZEOF_DK_APT_REC 8 |
Definition at line 66 of file lev_data.h.
Referenced by create_actnpt(), create_actnpt_copy(), load_apt(), and write_apt().
| #define SIZEOF_DK_CLM_HEADER 8 |
Definition at line 69 of file lev_data.h.
Referenced by level_clear_datclm(), level_init(), load_clm(), and write_clm().
| #define SIZEOF_DK_CLM_REC 24 |
Definition at line 65 of file lev_data.h.
Referenced by clear_clm_entry(), level_init(), load_clm(), and write_clm().
| #define SIZEOF_DK_LGT_HEADER 4 |
| #define SIZEOF_DK_LGT_REC 20 |
Definition at line 67 of file lev_data.h.
Referenced by create_stlight(), create_stlight_copy(), load_lgt(), and write_lgt().
| #define SIZEOF_DK_TNG_HEADER 2 |
| #define SIZEOF_DK_TNG_REC 21 |
Definition at line 64 of file lev_data.h.
Referenced by create_thing(), create_thing_copy(), create_thing_empty(), load_tng(), write_def_tng_source(), and write_tng().
| enum DIRECTION_INDEX |
Direction indices.
Indices in the 9-element arrays, like slab columns or surround variable.
Definition at line 78 of file lev_data.h.
| enum GRAFFITI_FONT |
| enum GRAFFITI_ORIENT |
| enum MAP_FORMAT_VERSION |
Map format type selection.
Do not use values other than MFV_DKSTD and MFV_DKGOLD, unless you know what you're doing!
Definition at line 38 of file lev_data.h.
| enum OBJECT_TYPE_INDEX |
| OBJECT_TYPE_NONE | |
| OBJECT_TYPE_ACTNPT | |
| OBJECT_TYPE_THING | |
| OBJECT_TYPE_STLIGHT | |
| OBJECT_TYPE_COLUMN | |
| OBJECT_TYPE_SLAB | |
| OBJECT_TYPE_DATLST |
Definition at line 46 of file lev_data.h.
| enum STATS_LINE_TYPE |
Statistics line types.
For functions returning statistic texts.
Definition at line 123 of file lev_data.h.
| enum VERIFY_WARN_FLAGS |
| DLLIMPORT int actnpt_add | ( | struct LEVEL * | lvl, | |
| unsigned char * | actnpt | |||
| ) |
Adds a given action point to the LEVEL structure.
Updates counter variables.
| lvl | Pointer to the LEVEL structure. | |
| actnpt | Pointer to the action point data to add. |
Definition at line 1904 of file lev_data.c.
Referenced by load_apt().
| DLLIMPORT void actnpt_del | ( | struct LEVEL * | lvl, | |
| unsigned int | sx, | |||
| unsigned int | sy, | |||
| unsigned int | num | |||
| ) |
Removes given action point from the LEVEL structure.
Updates counter variables. Also frees memory allocated for the action point.
| lvl | Pointer to the LEVEL structure. | |
| sx,sy | Subtile at which the action point is. | |
| num | Index of action point on the subtile. |
Definition at line 1940 of file lev_data.c.
Referenced by level_free_apt(), and object_del().
Verifies action points parameters.
| lvl | Pointer to the LEVEL structure. | |
| err_msg | Error message output buffer. | |
| errpt | Coordinates of the map tile containing the error. |
Definition at line 1349 of file lev_data.c.
Referenced by level_verify().
| DLLIMPORT short format_lvl_fname | ( | struct LEVEL * | lvl, | |
| char * | namefmt | |||
| ) |
Sets map file name for the level, using given format string.
The string may be map file name, or map number.
| lvl | Pointer to the LEVEL structure. | |
| namefmt | The new file name, which is copied to the level. |
Definition at line 2651 of file lev_data.c.
| DLLIMPORT short format_lvl_savfname | ( | struct LEVEL * | lvl, | |
| char * | namefmt | |||
| ) |
Sets map save file name for the level, using given format string.
The string may be map file name, or map number.
| lvl | Pointer to the LEVEL structure. | |
| namefmt | The save file name, which is copied to the level. |
Definition at line 2707 of file lev_data.c.
| DLLIMPORT void free_map | ( | struct LEVEL * | lvl | ) |
Frees the level data stored in LEVEL structure.
Then clears LEVEL allowing to reuse it.
| lvl | Pointer to the LEVEL structure. |
Definition at line 1721 of file lev_data.c.
Referenced by user_load_map().
| DLLIMPORT short free_text_file | ( | char *** | lines, | |
| int * | lines_count | |||
| ) |
Frees any text file loaded as lines.
Pointer value and lines count is cleared.
| lines | Pointer to the lines array. | |
| lines_count | Amount of allocated lines. |
Definition at line 1088 of file lev_data.c.
Referenced by load_lif().
| DLLIMPORT void generate_random_map | ( | struct LEVEL * | lvl | ) |
Creates random level.
Requies the memory to be allocated by level_init(). Calls level_clear(), but not level_free() at start.
| lvl | Pointer to the LEVEL structure. |
Definition at line 1698 of file lev_data.c.
| DLLIMPORT void generate_slab_bkgnd_default | ( | struct LEVEL * | lvl, | |
| unsigned short | def_slab | |||
| ) |
Fills SLB/OWN structure with "default" background.
The default is unowned "def_slab" surrounded by rock. DAT/CLM values are not updated here.
| lvl | Pointer to the LEVEL structure. | |
| def_slab | Default slab. |
Definition at line 1489 of file lev_data.c.
Referenced by start_new_map().
| DLLIMPORT void generate_slab_bkgnd_random | ( | struct LEVEL * | lvl | ) |
Fills SLB/OWN structure with "random" background.
The resulting map is made of earth with random rock at borders. DAT/CLM values are not updated here.
| lvl | Pointer to the LEVEL structure. |
Definition at line 1531 of file lev_data.c.
Referenced by generate_random_map().
| DLLIMPORT char* get_actnpt | ( | const struct LEVEL * | lvl, | |
| unsigned int | sx, | |||
| unsigned int | sy, | |||
| unsigned int | num | |||
| ) |
Returns action point data for action point at given position.
| lvl | Pointer to the LEVEL structure. | |
| sx,sy | Subtile at which the action point is. | |
| num | Index of action point on the subtile. |
Definition at line 1883 of file lev_data.c.
Referenced by actnpts_verify(), create_actnpt_number_used_arr(), draw_things_on_buffer(), find_next_actnpt_on_map(), get_object(), and write_apt().
| DLLIMPORT unsigned int get_actnpt_subnums | ( | const struct LEVEL * | lvl, | |
| unsigned int | sx, | |||
| unsigned int | sy | |||
| ) |
Gives amount of action points existing at given subtile.
| lvl | Pointer to the LEVEL structure. | |
| sx,sy | Subtile at which we're counting action points. |
Definition at line 1970 of file lev_data.c.
Referenced by actnpt_add(), actnpt_del(), actnpts_verify(), create_actnpt_number_used_arr(), draw_things_on_buffer(), get_actnpt(), get_object(), get_object_subnums(), get_object_subtl_last(), get_object_type(), object_del(), and write_apt().
| DLLIMPORT unsigned int get_apt_total_count | ( | struct LEVEL * | lvl | ) |
Returns total number of action points on the level.
| lvl | Pointer to the LEVEL structure. |
Definition at line 2532 of file lev_data.c.
Referenced by get_level_objstats_textln().
| DLLIMPORT unsigned int get_dat_val | ( | const struct LEVEL * | lvl, | |
| const unsigned int | sx, | |||
| const unsigned int | sy | |||
| ) |
Returns raw DAT value for one subtile.
| lvl | Pointer to the LEVEL structure. | |
| sx,sy | Map subtile at which we want the DAT value. |
Definition at line 2384 of file lev_data.c.
Referenced by get_dat_subtile(), and write_dat().
| DLLIMPORT char* get_data_path | ( | struct LEVEL * | lvl | ) |
Returns path to folder with data files.
| lvl | Pointer to the LEVEL structure. |
Definition at line 2827 of file lev_data.c.
| DLLIMPORT short get_datclm_auto_update | ( | struct LEVEL * | lvl | ) |
Returns state of the datclm_auto_update option for the level.
| lvl | Pointer to the LEVEL structure. |
Definition at line 2554 of file lev_data.c.
Referenced by user_set_owner_rect(), user_set_slab(), user_set_slab_rect(), user_set_slabown_rect(), and user_set_tile_owner().
| DLLIMPORT short get_level_objstats_textln | ( | struct LEVEL * | lvl, | |
| char * | stat_buf, | |||
| const int | line_num | |||
| ) |
Formats object statistics text line.
| lvl | Pointer to the LEVEL structure. | |
| stat_buf | Destination text buffer. | |
| line_num | Line number to retrieve. |
Definition at line 2989 of file lev_data.c.
| DLLIMPORT char* get_levels_path | ( | struct LEVEL * | lvl | ) |
Returns path to folder with levels.
| lvl | Pointer to the LEVEL structure. |
Definition at line 2791 of file lev_data.c.
| DLLIMPORT unsigned int get_lgt_total_count | ( | struct LEVEL * | lvl | ) |
Returns total number of static lights on the level.
| lvl | Pointer to the LEVEL structure. |
Definition at line 2521 of file lev_data.c.
Referenced by get_level_objstats_textln().
| DLLIMPORT char* get_lif_name_text | ( | struct LEVEL * | lvl | ) |
Returns text name of the level, from LIF file.
| lvl | Pointer to the LEVEL structure. |
Definition at line 2740 of file lev_data.c.
Referenced by write_lif(), and write_nfo().
| DLLIMPORT char* get_lvl_fname | ( | struct LEVEL * | lvl | ) |
Returns map file name for the level.
| lvl | Pointer to the LEVEL structure. |
Definition at line 2671 of file lev_data.c.
| DLLIMPORT short get_lvl_format_version | ( | struct LEVEL * | lvl | ) |
Returns level format version.
The format version was used when creating the LEVEL structure with level_init().
| lvl | Pointer to the LEVEL structure. |
Definition at line 2963 of file lev_data.c.
| DLLIMPORT unsigned char get_lvl_inf | ( | struct LEVEL * | lvl | ) |
Returns INF entry (texture index) for the level.
| lvl | Pointer to the LEVEL structure. |
Definition at line 2951 of file lev_data.c.
| DLLIMPORT char* get_lvl_savfname | ( | struct LEVEL * | lvl | ) |
Returns save file name for the level.
| lvl | Pointer to the LEVEL structure. |
Definition at line 2727 of file lev_data.c.
Returns pointer to the level script structure.
| lvl | Pointer to the LEVEL structure. |
Definition at line 2838 of file lev_data.c.
Returns pointer to the level statistics structure.
| lvl | Pointer to the LEVEL structure. |
Definition at line 2849 of file lev_data.c.
Referenced by get_level_objstats_textln(), and user_save_map().
| DLLIMPORT short get_obj_auto_update | ( | struct LEVEL * | lvl | ) |
Returns state of the obj_auto_update option for the level.
| lvl | Pointer to the LEVEL structure. |
Definition at line 2591 of file lev_data.c.
Referenced by user_set_owner_rect(), user_set_slab(), user_set_slab_rect(), user_set_slabown_rect(), and user_set_tile_owner().
| DLLIMPORT unsigned char* get_object | ( | const struct LEVEL * | lvl, | |
| unsigned int | sx, | |||
| unsigned int | sy, | |||
| unsigned int | z | |||
| ) |
Returns data for specific object at given position.
This function merges things, action points and static lights, treating them all just as 'objects'.
| lvl | Pointer to the LEVEL structure. | |
| sx,sy | Subtile at which the object is. | |
| z | Index of the object. Things have lowest indices, then comes action points and static lights. |
Definition at line 2122 of file lev_data.c.
Referenced by get_nearest_object_idx().
| DLLIMPORT unsigned int get_object_subnums | ( | const struct LEVEL * | lvl, | |
| unsigned int | sx, | |||
| unsigned int | sy | |||
| ) |
Gives amount of objects existing at given subtile.
This function merges things, action points and static lights, treating them all just as 'objects'.
| lvl | Pointer to the LEVEL structure. | |
| sx,sy | Subtile at which we're counting objects. |
Definition at line 2187 of file lev_data.c.
Referenced by get_nearest_object_idx(), and get_object_subtl_last().
| DLLIMPORT int get_object_subtl_last | ( | const struct LEVEL * | lvl, | |
| unsigned int | sx, | |||
| unsigned int | sy, | |||
| short | obj_type | |||
| ) |
Gives index of the last object with given type.
| lvl | Pointer to the LEVEL structure. | |
| sx,sy | Subtile at which the object is. | |
| obj_type | Type of the object, one of OBJECT_TYPE_* values. |
Definition at line 2220 of file lev_data.c.
| DLLIMPORT unsigned int get_object_tilnums | ( | const struct LEVEL * | lvl, | |
| unsigned int | tx, | |||
| unsigned int | ty | |||
| ) |
Gives amount of objects existing at given tile.
This function merges things, action points and static lights, treating them all just as 'objects'.
| lvl | Pointer to the LEVEL structure. | |
| tx,ty | Tile at which we're counting objects. |
Definition at line 2206 of file lev_data.c.
| DLLIMPORT short get_object_type | ( | const struct LEVEL * | lvl, | |
| unsigned int | sx, | |||
| unsigned int | sy, | |||
| unsigned int | z | |||
| ) |
Checks what type the object is.
Objects are action points, things or lights. This function merges things, action points and static lights, treating them all just as 'objects'.
| lvl | Pointer to the LEVEL structure. | |
| sx,sy | Subtile at which the object is. | |
| z | Index of the object. Things have lowest indices, then comes action points and static lights. |
Definition at line 2095 of file lev_data.c.
Referenced by get_nearest_object_idx().
| DLLIMPORT char* get_stlight | ( | const struct LEVEL * | lvl, | |
| unsigned int | sx, | |||
| unsigned int | sy, | |||
| unsigned int | num | |||
| ) |
Returns static light data for light at given position.
| lvl | Pointer to the LEVEL structure. | |
| sx,sy | Subtile at which the static light is. | |
| num | Index of static light on the subtile. |
Definition at line 1988 of file lev_data.c.
Referenced by draw_things_on_buffer(), find_next_stlight_on_map(), get_object(), and write_lgt().
| DLLIMPORT unsigned int get_stlight_subnums | ( | const struct LEVEL * | lvl, | |
| unsigned int | sx, | |||
| unsigned int | sy | |||
| ) |
Gives amount of static lights existing at given subtile.
| lvl | Pointer to the LEVEL structure. | |
| sx,sy | Subtile at which we're counting static lights. |
Definition at line 2074 of file lev_data.c.
Referenced by draw_things_on_buffer(), remove_automade_obj_for_slab(), and write_lgt().
| DLLIMPORT unsigned short get_subtl_flg | ( | struct LEVEL * | lvl, | |
| unsigned int | sx, | |||
| unsigned int | sy | |||
| ) |
Returns FLG value for one subtile.
| lvl | Pointer to the LEVEL structure. | |
| sx,sy | Map subtile at which we want the FLG value. |
Definition at line 2411 of file lev_data.c.
Referenced by write_flg().
| DLLIMPORT unsigned char get_subtl_owner | ( | const struct LEVEL * | lvl, | |
| unsigned int | sx, | |||
| unsigned int | sy | |||
| ) |
Gives owner (OWN value) for a subtile.
| lvl | Pointer to the LEVEL structure. | |
| sx,sy | Map subtile at which we want the owner value. |
Definition at line 2302 of file lev_data.c.
Referenced by draw_map_on_buffer(), get_tile_owner(), and write_own().
| DLLIMPORT short get_subtl_wib | ( | struct LEVEL * | lvl, | |
| unsigned int | sx, | |||
| unsigned int | sy | |||
| ) |
Gives WIBble value for a subtile.
| lvl | Pointer to the LEVEL structure. | |
| sx,sy | Map subtile at which we want the WIB value. |
Definition at line 2247 of file lev_data.c.
Referenced by write_wib().
| DLLIMPORT char* get_thing | ( | const struct LEVEL * | lvl, | |
| unsigned int | sx, | |||
| unsigned int | sy, | |||
| unsigned int | num | |||
| ) |
Returns thing data for thing at given position.
| lvl | Pointer to the LEVEL structure. | |
| sx,sy | Subtile at which the thing is. | |
| num | Index of thing on the subtile. |
Definition at line 1761 of file lev_data.c.
Referenced by create_herogate_number_used_arr(), delete_room_things_subtl(), draw_things_on_buffer(), find_thing_on_tile(), get_free_indexedthing_number(), get_nearest_thing_idx(), get_object(), get_slab_surround(), level_verify_logic(), level_verify_struct(), owned_things_count(), remove_automade_obj_for_slab(), remove_misplaced_objs_on_slab(), remove_noncrucial_room_things(), set_door_lock(), subtl_in_effectgen_range(), things_verify(), update_door_things_on_slab(), update_thing_slb_room_one_central_item(), update_thing_slb_room_one_item_subtl(), update_things_slb_barracks_corner(), update_things_slb_graveyard_corner(), update_things_slb_portal_inside(), update_things_stats(), update_things_subpos_and_height_for_slab(), write_def_tng_source(), and write_tng().
| DLLIMPORT unsigned int get_thing_subnums | ( | const struct LEVEL * | lvl, | |
| unsigned int | sx, | |||
| unsigned int | sy | |||
| ) |
Gives amount of things existing at given subtile.
| lvl | Pointer to the LEVEL structure. | |
| sx,sy | Subtile at which we're counting thing. |
Definition at line 1866 of file lev_data.c.
Referenced by delete_room_things_subtl(), draw_things_on_buffer(), find_thing_on_tile(), get_nearest_thing_idx(), get_slab_surround(), level_verify_logic(), level_verify_struct(), owned_things_count(), remove_automade_obj_for_slab(), remove_misplaced_objs_on_slab(), remove_noncrucial_room_things(), set_door_lock(), subtl_in_effectgen_range(), things_verify(), update_door_things_on_slab(), update_thing_slb_room_one_central_item(), update_thing_slb_room_one_item_subtl(), update_things_slb_barracks_corner(), update_things_slb_graveyard_corner(), update_things_slb_portal_inside(), update_things_stats(), update_things_subpos_and_height_for_slab(), write_def_tng_source(), and write_tng().
| DLLIMPORT unsigned char get_tile_owner | ( | const struct LEVEL * | lvl, | |
| unsigned int | tx, | |||
| unsigned int | ty | |||
| ) |
Gives owner (OWN value) for a tile.
| lvl | Pointer to the LEVEL structure. | |
| tx,ty | Map tile at which we want the owner value. |
Definition at line 2329 of file lev_data.c.
Referenced by create_creature(), create_door(), create_doorkey(), create_effectgen(), create_item(), create_torch(), create_trap(), get_slab_surround(), slab_is_central(), update_thing_slb_room_one_central_item(), update_thing_slb_room_one_item_subtl(), update_things_slb_barracks_corner(), update_things_slb_graveyard_corner(), update_things_slb_portal_inside(), and update_tile_flg_entries().
| DLLIMPORT unsigned short get_tile_slab | ( | const struct LEVEL * | lvl, | |
| unsigned int | tx, | |||
| unsigned int | ty | |||
| ) |
Gives slab (SLB value) for a tile.
| lvl | Pointer to the LEVEL structure. | |
| tx,ty | Map tile at which we want the slab value. |
Definition at line 2355 of file lev_data.c.
Referenced by actnpts_verify(), compute_door_orientation(), compute_item_sensitile(), compute_torch_sensitile(), draw_map_on_buffer(), get_slab_surround(), level_verify_logic(), remove_automade_obj_for_slab(), remove_misplaced_objs_on_slab(), set_graffiti_orientation(), slab_is_central(), slab_siblings_oftype(), slabs_verify(), subtl_is_near_tall_slab(), things_verify(), update_clmaffective_obj_for_slab(), update_door_things_on_slab(), update_room_things_on_slab(), update_slab_owners(), update_tile_flg_entries(), update_tile_wlb_entry(), update_torch_things_near_slab(), and write_slb().
| DLLIMPORT short get_tile_wlb | ( | struct LEVEL * | lvl, | |
| unsigned int | tx, | |||
| unsigned int | ty | |||
| ) |
Gives WLB (Water-Lava Block) value for a tile.
| lvl | Pointer to the LEVEL structure. | |
| tx,ty | Map tile at which we want the WLB value. |
Definition at line 2275 of file lev_data.c.
Referenced by update_tile_wlb_entry().
| DLLIMPORT unsigned int get_tng_total_count | ( | struct LEVEL * | lvl | ) |
Returns total number of things on the level.
| lvl | Pointer to the LEVEL structure. |
Definition at line 2543 of file lev_data.c.
Referenced by get_level_objstats_textln().
| DLLIMPORT unsigned long inc_info_usr_cmds_count | ( | struct LEVEL * | lvl | ) |
Increases total user commands counter.
Used for user commands statistics for the level.
| lvl | Pointer to the LEVEL structure. |
Definition at line 2887 of file lev_data.c.
| DLLIMPORT unsigned long inc_info_usr_creatobj_count | ( | struct LEVEL * | lvl | ) |
Increases user objects created counter.
Used for user commands statistics for the level.
| lvl | Pointer to the LEVEL structure. |
Definition at line 2900 of file lev_data.c.
| DLLIMPORT unsigned long inc_info_usr_mdswtch_count | ( | struct LEVEL * | lvl | ) |
Increases mode switches counter.
Used for user commands statistics for the level.
| lvl | Pointer to the LEVEL structure. |
Definition at line 2861 of file lev_data.c.
| DLLIMPORT unsigned long inc_info_usr_slbchng_count | ( | struct LEVEL * | lvl | ) |
Increases SLB changes counter.
Used for user commands statistics for the level.
| lvl | Pointer to the LEVEL structure. |
Definition at line 2874 of file lev_data.c.
Referenced by user_set_owner_rect(), user_set_slab(), user_set_slab_rect(), user_set_slabown_rect(), and user_set_tile_owner().
| DLLIMPORT unsigned int inc_info_ver_major | ( | struct LEVEL * | lvl | ) |
Increases major version number for the level.
| lvl | Pointer to the LEVEL structure. |
Definition at line 2912 of file lev_data.c.
Referenced by user_save_map().
| DLLIMPORT unsigned int inc_info_ver_minor | ( | struct LEVEL * | lvl | ) |
Increases minor version number for the level.
| lvl | Pointer to the LEVEL structure. |
Definition at line 2926 of file lev_data.c.
Referenced by user_save_map().
| DLLIMPORT unsigned int inc_info_ver_rel | ( | struct LEVEL * | lvl | ) |
Increases version release number for the level.
| lvl | Pointer to the LEVEL structure. |
Definition at line 2939 of file lev_data.c.
Referenced by user_save_map().
| DLLIMPORT short level_clear | ( | struct LEVEL * | lvl | ) |
Clears the whole object for storing level.
Drops any old pointers without deallocating them. Requies level_init() to be run first. Leaves only optns struct unaffected.
| lvl | Pointer to the LEVEL structure. |
Definition at line 790 of file lev_data.c.
Referenced by free_map(), generate_random_map(), level_init(), load_dk1_map(), load_dke_map(), load_map_preview(), and start_new_map().
| short level_clear_apt | ( | struct LEVEL * | lvl | ) |
clears the "actions" structure for storing level.
Drops any old pointers without deallocating them. Requies level_init() to be run first.
| lvl | Pointer to the LEVEL structure. |
Definition at line 487 of file lev_data.c.
Referenced by level_clear().
| short level_clear_datclm | ( | struct LEVEL * | lvl | ) |
Clears the "column" structure for storing level.
Will not drop any pointers. Requies level_init() to be run first.
| lvl | Pointer to the LEVEL structure. |
Definition at line 535 of file lev_data.c.
Referenced by level_clear(), and update_datclm_for_whole_map().
| short level_clear_info | ( | struct LEVEL * | lvl | ) |
Clears (sets for new map) info for given level.
| lvl | Pointer to the LEVEL structure. |
Definition at line 617 of file lev_data.c.
Referenced by level_clear().
| short level_clear_lgt | ( | struct LEVEL * | lvl | ) |
clears the "lights" structure for storing level.
Drops any old pointers without deallocating them. Requies level_init() to be run first.
| lvl | Pointer to the LEVEL structure. |
Definition at line 511 of file lev_data.c.
Referenced by level_clear().
| DLLIMPORT short level_clear_options | ( | struct LEVOPTIONS * | optns | ) |
Clears options for given level.
This one is not executed when clearing the level, only when making new one.
| optns | The LEVOPTIONS structure to clear. |
Definition at line 380 of file lev_data.c.
Referenced by level_init().
| short level_clear_other | ( | struct LEVEL * | lvl | ) |
Clears minor LEVEL substructures.
Clears the structures for storing level which do not have separate clearing function. Drops any old pointers without deallocating them, only file name remains. Requies level_init() to be run first.
| lvl | Pointer to the LEVEL structure. |
Definition at line 723 of file lev_data.c.
Referenced by level_clear().
| short level_clear_script | ( | struct LEVEL * | lvl | ) |
Clears (via zeroing) TXT script info for given level.
| lvl | Pointer to the LEVEL structure. |
Definition at line 647 of file lev_data.c.
Referenced by level_clear().
| DLLIMPORT short level_clear_script_param | ( | struct DK_SCRIPT_PARAMETERS * | par | ) |
Clears (via zeroing) given script parameters struct.
| par | Pointer to the DK_SCRIPT_PARAMETERS structure. |
Definition at line 662 of file lev_data.c.
Referenced by level_clear_script(), and script_decomposed_to_params().
| short level_clear_stats | ( | struct LEVEL * | lvl | ) |
Clears (via zeroing) stats for given level.
| lvl | Pointer to the LEVEL structure. |
Definition at line 587 of file lev_data.c.
Referenced by level_clear(), and update_things_stats().
| short level_clear_tng | ( | struct LEVEL * | lvl | ) |
Clears the "things" structure for storing level.
Drops any old pointers without deallocating them. Requies level_init() to be run first.
| lvl | Pointer to the LEVEL structure. |
Definition at line 457 of file lev_data.c.
Referenced by level_clear().
| DLLIMPORT short level_deinit | ( | struct LEVEL ** | lvl_ptr | ) |
Frees structures for storing level.
Frees only the memory allocated by level_init(); to free the content of loaded level, you must call level_free() first.
| lvl_ptr | Double pointer to the LEVEL structure. |
Definition at line 842 of file lev_data.c.
| DLLIMPORT short level_free | ( | struct LEVEL * | lvl | ) |
Frees structures for storing level.
Frees only data pointers, the array structure remains intact (as after level_init(), but values are not cleared - use level_clear() to set NULLs to pointers).
| lvl | Pointer to the LEVEL structure. |
Definition at line 1139 of file lev_data.c.
Referenced by free_map(), load_dk1_map(), load_dke_map(), and load_map_preview().
| DLLIMPORT short level_free_script_param | ( | struct DK_SCRIPT_PARAMETERS * | par | ) |
Frees all sub-structures of given DK_SCRIPT_PARAMETERS.
| par | Pointer to the DK_SCRIPT_PARAMETERS structure. |
Definition at line 811 of file lev_data.c.
Referenced by level_deinit().
| short level_free_tng | ( | struct LEVEL * | lvl | ) |
Frees "things" structure for storing level.
Disposes only data pointers, the array structure remains intact (as after level_init(), but values are not cleared).
| lvl | Pointer to the LEVEL structure. |
Definition at line 1008 of file lev_data.c.
Referenced by level_free().
| DLLIMPORT short level_generate_random_extension | ( | struct LEVEL * | lvl, | |
| char * | ret_msg | |||
| ) |
Adds random extension to the level.
| lvl | Pointer to the LEVEL structure. | |
| ret_msg | Text message returned by function. |
Definition at line 1733 of file lev_data.c.
| DLLIMPORT struct MAPDRAW_OPTIONS* level_get_mapdraw_options | ( | struct LEVEL * | lvl | ) | [read] |
Gets the map drawing options for the LEVEL structure.
Returns direct pointer to the structure.
| lvl | Pointer to the LEVEL structure. |
Definition at line 446 of file lev_data.c.
| DLLIMPORT struct LEVOPTIONS* level_get_options | ( | struct LEVEL * | lvl | ) | [read] |
Gets all options for the LEVEL structure.
Returns direct pointer to the structure.
| lvl | Pointer to the LEVEL structure. |
Definition at line 420 of file lev_data.c.
| DLLIMPORT struct DK_SCRIPT_PARAMETERS* level_get_script_param | ( | struct LEVEL * | lvl | ) | [read] |
Returns DK_SCRIPT_PARAMETERS struct for given level.
| lvl | Pointer to the LEVEL structure. |
Definition at line 1157 of file lev_data.c.
| DLLIMPORT short level_init | ( | struct LEVEL ** | lvl_ptr, | |
| short | map_version, | |||
| struct UPOINT_3D * | lvl_size | |||
| ) |
Creates object for storing one level.
Allocates memory and inits the values to zero; drops any previous pointers without deallocating.
| lvl_ptr | Double pointer to the new level structure. | |
| map_version | Map version constant, from MAP_FORMAT_VERSION enumeration. | |
| lvl_size | Level size struct.This can be NULL if map_version does not support multiple sizes of maps. |
Definition at line 53 of file lev_data.c.
| DLLIMPORT short level_set_mapdraw_options | ( | struct LEVEL * | lvl, | |
| struct MAPDRAW_OPTIONS * | mdrwopts | |||
| ) |
Sets the map drawing options for the LEVEL structure from another MAPDRAW_OPTIONS.
Copies the whole MAPDRAW_OPTIONS structure into the one in LEVEL. Keeps only previous value of data_path.
| lvl | Pointer to the LEVEL structure. | |
| mdrwopts | The MAPDRAW_OPTIONS structure to copy from. |
Definition at line 433 of file lev_data.c.
| DLLIMPORT short level_set_options | ( | struct LEVEL * | lvl, | |
| struct LEVOPTIONS * | optns | |||
| ) |
Sets all options for the LEVEL structure from another LEVOPTIONS.
Copies the whole LEVOPTIONS structure into the one in LEVEL.
| lvl | Pointer to the LEVEL structure. | |
| optns | The LEVOPTIONS structure to copy from. |
Definition at line 407 of file lev_data.c.
Verifies the whole level.
On error adds description message to the error messages log.
| lvl | Pointer to the LEVEL structure. | |
| actn_name | Name of the action which invoked verification. | |
| errpt | Coordinates of the map tile containing the error. |
Definition at line 1173 of file lev_data.c.
Referenced by user_save_map().
Verifies various logic aspects of a map.
| lvl | Pointer to the LEVEL structure. | |
| err_msg | Error message output buffer. | |
| errpt | Coordinates of the map tile containing the error. |
Definition at line 1402 of file lev_data.c.
Referenced by level_verify().
| DLLIMPORT short level_verify_struct | ( | struct LEVEL * | lvl, | |
| char * | err_msg, | |||
| struct IPOINT_2D * | errpt | |||
| ) |
Verifies internal LEVEL structure integrity.
| lvl | Pointer to the LEVEL structure. | |
| err_msg | Error message output buffer. | |
| errpt | Coordinates of the map tile containing the error. |
Definition at line 1247 of file lev_data.c.
Referenced by level_verify().
| DLLIMPORT void object_del | ( | struct LEVEL * | lvl, | |
| unsigned int | sx, | |||
| unsigned int | sy, | |||
| unsigned int | z | |||
| ) |
Deletes object with given coordinates and index.
This function merges things, action points and static lights, treating them all just as 'objects'.
| lvl | Pointer to the LEVEL structure. | |
| sx,sy | Subtile at which the object is. | |
| z | Index of the object. Things have lowest indices, then comes action points and static lights. |
Definition at line 2151 of file lev_data.c.
| DLLIMPORT void set_dat_val | ( | struct LEVEL * | lvl, | |
| int | sx, | |||
| int | sy, | |||
| unsigned int | d | |||
| ) |
Sets a DAT value for one subtile.
Low level - sets the RAW value, not column index.
| lvl | Pointer to the LEVEL structure. | |
| sx,sy | Map subtile at which we want to set DAT value. | |
| d | Raw DAT value to set. |
Definition at line 2398 of file lev_data.c.
Referenced by load_dat(), and set_dat_subtile().
| DLLIMPORT short set_data_path | ( | struct LEVEL * | lvl, | |
| char * | datpath | |||
| ) |
Sets path at which data files are.
The path should be without ending slash, and will be used only for graphics related commands.
| lvl | Pointer to the LEVEL structure. | |
| datpath | The new path for data files folder. |
Definition at line 2804 of file lev_data.c.
| DLLIMPORT short set_datclm_auto_update | ( | struct LEVEL * | lvl, | |
| short | val | |||
| ) |
Sets state of the datclm_auto_update option for the level.
| lvl | Pointer to the LEVEL structure. | |
| val | New state of the option. |
Definition at line 2579 of file lev_data.c.
| DLLIMPORT short set_levels_path | ( | struct LEVEL * | lvl, | |
| char * | lvpath | |||
| ) |
Sets path at which maps are.
The path should be without ending slash, and will be used only if map name to load/save doesn't have its own path.
| lvl | Pointer to the LEVEL structure. | |
| lvpath | The new path for levels folder. |
Definition at line 2770 of file lev_data.c.
| DLLIMPORT short set_lif_name_text | ( | struct LEVEL * | lvl, | |
| char * | name | |||
| ) |
Sets text name of the level, from LIF file.
Directly sets the name pointer, without duplicating it.
| lvl | Pointer to the LEVEL structure. | |
| name | New text name of the level. |
Definition at line 2755 of file lev_data.c.
Referenced by execute_adikted_command(), load_lif(), and load_slb().
| DLLIMPORT short set_lvl_fname | ( | struct LEVEL * | lvl, | |
| char * | fname | |||
| ) |
Sets map file name for the level.
| lvl | Pointer to the LEVEL structure. | |
| fname | The new file name, which is copied to the level. |
Definition at line 2629 of file lev_data.c.
| DLLIMPORT short set_lvl_inf | ( | struct LEVEL * | lvl, | |
| unsigned char | ninf | |||
| ) |
Sets INF entry (texture index) for the level.
| lvl | Pointer to the LEVEL structure. | |
| ninf | New INF entry for the level. |
Definition at line 2975 of file lev_data.c.
| DLLIMPORT short set_lvl_savfname | ( | struct LEVEL * | lvl, | |
| char * | fname | |||
| ) |
Sets map file name for saving the level.
| lvl | Pointer to the LEVEL structure. | |
| fname | The new file name to save on. |
Definition at line 2685 of file lev_data.c.
| DLLIMPORT short set_obj_auto_update | ( | struct LEVEL * | lvl, | |
| short | val | |||
| ) |
Sets state of the obj_auto_update option for the level.
| lvl | Pointer to the LEVEL structure. | |
| val | New state of the option. |
Definition at line 2616 of file lev_data.c.
| DLLIMPORT void set_subtl_flg | ( | struct LEVEL * | lvl, | |
| unsigned int | sx, | |||
| unsigned int | sy, | |||
| unsigned short | nval | |||
| ) |
Sets a FLG value for one subtile.
| lvl | Pointer to the LEVEL structure. | |
| sx,sy | Map subtile at which we want to set FLG value. | |
| nval | FLG value to set. |
Definition at line 2424 of file lev_data.c.
Referenced by load_flg(), and update_tile_flg_entries().
| DLLIMPORT void set_subtl_owner | ( | struct LEVEL * | lvl, | |
| unsigned int | sx, | |||
| unsigned int | sy, | |||
| unsigned char | nval | |||
| ) |
Sets owner (OWN value) for a subtile.
| lvl | Pointer to the LEVEL structure. | |
| sx,sy | Map subtile at which we want to set owner value. | |
| nval | New value for the subtile owner. |
Definition at line 2316 of file lev_data.c.
Referenced by generate_slab_bkgnd_default(), generate_slab_bkgnd_random(), load_own(), set_tile_owner(), and update_slab_owners().
| DLLIMPORT void set_subtl_wib | ( | struct LEVEL * | lvl, | |
| unsigned int | sx, | |||
| unsigned int | sy, | |||
| short | nval | |||
| ) |
Sets WIBble value for a subtile.
| lvl | Pointer to the LEVEL structure. | |
| sx,sy | Map subtile at which we want to set WIB value. | |
| nval | New value for the subtile wibble. |
Definition at line 2261 of file lev_data.c.
Referenced by load_wib(), and update_tile_wib_entries().
| DLLIMPORT void set_tile_owner | ( | struct LEVEL * | lvl, | |
| unsigned int | tx, | |||
| unsigned int | ty, | |||
| unsigned char | nval | |||
| ) |
Sets owner (OWN value) for a tile.
Sets given owner value for all subtiles on given tile.
| lvl | Pointer to the LEVEL structure. | |
| tx,ty | Map tile at which we want to set owner value. | |
| nval | New value for the tile owner. |
Definition at line 2341 of file lev_data.c.
Referenced by generate_slab_bkgnd_default(), generate_slab_bkgnd_random(), update_slab_owners(), user_set_owner_rect(), user_set_slabown_rect(), and user_set_tile_owner().
| DLLIMPORT void set_tile_slab | ( | struct LEVEL * | lvl, | |
| unsigned int | tx, | |||
| unsigned int | ty, | |||
| unsigned short | nval | |||
| ) |
Sets a new value to SLB item, without updating DAT or CLM or anything.
To update level graphics after putting slab, use user_set_slab() instead.
| lvl | Pointer to the LEVEL structure. | |
| tx,ty | Map tile at which we want to set slab value. | |
| nval | New value for the tile slab. |
Definition at line 2371 of file lev_data.c.
Referenced by generate_slab_bkgnd_default(), generate_slab_bkgnd_random(), load_slb(), slab_draw_circle(), user_set_slab(), user_set_slab_rect(), and user_set_slabown_rect().
| DLLIMPORT void set_tile_wlb | ( | struct LEVEL * | lvl, | |
| unsigned int | tx, | |||
| unsigned int | ty, | |||
| short | nval | |||
| ) |
Sets WLB (Water-Lava Block) value for a tile.
| lvl | Pointer to the LEVEL structure. | |
| tx,ty | Map tile at which we want to set WLB value. | |
| nval | New value for the tile WLB. |
Definition at line 2289 of file lev_data.c.
Referenced by update_tile_wlb_entry().
| DLLIMPORT void start_new_map | ( | struct LEVEL * | lvl | ) |
Creates new level.
Requies the memory to be allocated by level_init(). Calls level_clear(), but not level_free() at start.
| lvl | Pointer to the LEVEL structure. |
Definition at line 1668 of file lev_data.c.
Referenced by user_load_map().
| DLLIMPORT int stlight_add | ( | struct LEVEL * | lvl, | |
| unsigned char * | stlight | |||
| ) |
Adds a given static light to the LEVEL structure.
Updates counter variables.
| lvl | Pointer to the LEVEL structure. | |
| stlight | Pointer to the static light data to add. |
Definition at line 2008 of file lev_data.c.
Referenced by load_lgt().
| DLLIMPORT void stlight_del | ( | struct LEVEL * | lvl, | |
| unsigned int | sx, | |||
| unsigned int | sy, | |||
| unsigned int | num | |||
| ) |
Removes given static light from the LEVEL structure.
Updates counter variables. Also frees memory allocated for the static light.
| lvl | Pointer to the LEVEL structure. | |
| sx,sy | Subtile at which the static light is. | |
| num | Index of static light on the subtile. |
Definition at line 2044 of file lev_data.c.
Referenced by level_free_lgt(), object_del(), and remove_automade_obj_for_slab().
| DLLIMPORT short switch_datclm_auto_update | ( | struct LEVEL * | lvl | ) |
Switches state of the datclm_auto_update option for the level.
| lvl | Pointer to the LEVEL structure. |
Definition at line 2565 of file lev_data.c.
| DLLIMPORT short switch_obj_auto_update | ( | struct LEVEL * | lvl | ) |
Switches state of the obj_auto_update option for the level.
| lvl | Pointer to the LEVEL structure. |
Definition at line 2602 of file lev_data.c.
| DLLIMPORT int thing_add | ( | struct LEVEL * | lvl, | |
| unsigned char * | thing | |||
| ) |
Adds a thing to the structure and returns its index.
Also updates statistics.
| lvl | Pointer to the LEVEL structure. | |
| thing | Pointer to the thing data to add. |
Definition at line 1782 of file lev_data.c.
Referenced by load_tng(), set_door_lock(), update_door_things_on_slab(), update_thing_slb_room_one_central_item(), update_thing_slb_room_one_item_subtl(), update_things_slb_barracks_corner(), update_things_slb_graveyard_corner(), and update_things_slb_portal_inside().
| DLLIMPORT void thing_del | ( | struct LEVEL * | lvl, | |
| unsigned int | sx, | |||
| unsigned int | sy, | |||
| unsigned int | num | |||
| ) |
Removes given thing from the LEVEL structure, updates counter variables.
Also frees memory allocated for the thing.
| lvl | Pointer to the LEVEL structure. | |
| sx,sy | Subtile at which the thing is. | |
| num | Index of thing on the subtile. |
Definition at line 1817 of file lev_data.c.
Referenced by delete_room_things_subtl(), level_free_tng(), object_del(), remove_automade_obj_for_slab(), remove_misplaced_objs_on_slab(), remove_noncrucial_room_things(), set_door_lock(), update_door_things_on_slab(), update_thing_slb_room_one_central_item(), update_thing_slb_room_one_item_subtl(), update_things_slb_barracks_corner(), update_things_slb_graveyard_corner(), and update_things_slb_portal_inside().
| DLLIMPORT void thing_drop | ( | struct LEVEL * | lvl, | |
| unsigned int | sx, | |||
| unsigned int | sy, | |||
| unsigned int | num | |||
| ) |
Removes given thing from the LEVEL structure, updates counter variables.
Does not frees memory allocated for the thing - just drops the pointers. Updates thing statistics.
| lvl | Pointer to the LEVEL structure. | |
| sx,sy | Subtile at which the thing is. | |
| num | Index of thing on the subtile. |
Definition at line 1838 of file lev_data.c.
Referenced by thing_del(), and update_door_things_on_slab().
| DLLIMPORT void update_level_stats | ( | struct LEVEL * | lvl | ) |
Updates some statistics about the level.
The update includes "utilize" values of columns.
| lvl | Pointer to the LEVEL structure. |
Definition at line 2436 of file lev_data.c.
Referenced by generate_random_map(), load_map_preview(), start_new_map(), and user_load_map().
| DLLIMPORT void update_object_owners | ( | struct LEVEL * | lvl | ) |
| DLLIMPORT void update_thing_stats | ( | struct LEVEL * | lvl, | |
| const unsigned char * | thing, | |||
| short | change | |||
| ) |
Updates statistics about the thing.
| lvl | Pointer to the LEVEL structure. | |
| thing | Pointer to the thing data. | |
| change | How the amount of such things have changes. Positive if the thing was added, negative if removed. |
Definition at line 2477 of file lev_data.c.
Referenced by thing_add(), thing_drop(), and update_things_stats().
| DLLIMPORT void update_things_stats | ( | struct LEVEL * | lvl | ) |
Updates statistics about the level.
Does not updates "utilize" values of columns.
| lvl | Pointer to the LEVEL structure. |
Definition at line 2447 of file lev_data.c.
Referenced by update_level_stats().
| DLLIMPORT short user_set_owner_rect | ( | struct LEVEL * | lvl, | |
| unsigned int | startx, | |||
| unsigned int | endx, | |||
| unsigned int | starty, | |||
| unsigned int | endy, | |||
| unsigned short | nown | |||
| ) |
Changes owner of a map rectangle.
Updates level graphics, things and statistics.
| lvl | Pointer to the LEVEL structure. | |
| startx,starty | Top left of the changed rectangle. | |
| endx,endy | Bottom right of the changed rectangle. | |
| nown | New value for the rectangle owner. |
Definition at line 3197 of file lev_data.c.
| DLLIMPORT short user_set_slab | ( | struct LEVEL * | lvl, | |
| unsigned int | tx, | |||
| unsigned int | ty, | |||
| unsigned short | nslab | |||
| ) |
Puts a new slab on map.
Updates level graphics, things and statistics.
| lvl | Pointer to the LEVEL structure. | |
| tx,ty | Map coordinates of the slab to change. | |
| nslab | New value for the tile slab. |
Definition at line 3113 of file lev_data.c.
| DLLIMPORT short user_set_slab_rect | ( | struct LEVEL * | lvl, | |
| unsigned int | startx, | |||
| unsigned int | endx, | |||
| unsigned int | starty, | |||
| unsigned int | endy, | |||
| unsigned short | nslab | |||
| ) |
Puts a rectangle of new slabs on map.
Updates level graphics, things and statistics.
| lvl | Pointer to the LEVEL structure. | |
| startx,starty | Top left of the changed rectangle. | |
| endx,endy | Bottom right of the changed rectangle. | |
| nslab | New value for the slab to fill rectangle. |
Definition at line 3161 of file lev_data.c.
| DLLIMPORT short user_set_slabown_rect | ( | struct LEVEL * | lvl, | |
| unsigned int | startx, | |||
| unsigned int | endx, | |||
| unsigned int | starty, | |||
| unsigned int | endy, | |||
| unsigned short | nslab, | |||
| unsigned short | nown | |||
| ) |
Puts a rectangle of new slabs on map.
Updates level graphics, things and statistics.
| lvl | Pointer to the LEVEL structure. | |
| startx,starty | Top left of the changed rectangle. | |
| endx,endy | Bottom right of the changed rectangle. | |
| nslab | New value for the slab to put in rectangle. | |
| nown | New value for the rectangle owner. |
Definition at line 3232 of file lev_data.c.
| DLLIMPORT short user_set_tile_owner | ( | struct LEVEL * | lvl, | |
| unsigned int | tx, | |||
| unsigned int | ty, | |||
| unsigned short | nown | |||
| ) |
Changes owner of one slab on map.
Updates level graphics, things and statistics.
| lvl | Pointer to the LEVEL structure. | |
| tx,ty | Map coordinates of the owner to change. | |
| nown | New value for the tile owner. |
Definition at line 3137 of file lev_data.c.
| const char default_map_name[] |
| const int idir_subtl_x[] |
Definition at line 32 of file lev_data.c.
Referenced by set_new_datclm_values(), update_things_slb_prison(), update_things_subpos_and_height_for_slab(), and update_torch_things_near_slab().
| const int idir_subtl_y[] |
Definition at line 37 of file lev_data.c.
Referenced by set_new_datclm_values(), update_things_slb_prison(), update_things_subpos_and_height_for_slab(), and update_torch_things_near_slab().
1.5.6