Definition in file lev_files.h.
#include "globals.h"
Go to the source code of this file.
Defines | |
#define | ERR_NONE 0 |
#define | ERR_FILE_TOOSMLL -24 |
#define | ERR_FILE_BADDATA -25 |
#define | ERR_FILE_BADNAME -26 |
#define | ERR_CANT_MALLOC -27 |
#define | ERR_CANT_OPENWR -28 |
#define | ERR_CANT_WRITE -29 |
#define | ERR_VERIF -30 |
#define | ERR_INTERNAL -31 |
#define | WARN_BAD_COUNT 24 |
#define | LFF_IGNORE_NONE (0) |
#define | LFF_IGNORE_ALL (LFF_IGNORE_INTERNAL|LFF_IGNORE_CANNOT_LOAD) |
#define | LFF_IGNORE_WITHOUT_WARN (LFF_IGNORE_INTERNAL|LFF_IGNORE_CANNOT_LOAD|LFF_DONT_EVEN_WARN) |
Enumerations | |
enum | EXTRA_OBJ_LOAD { RNC_IGNORE_NONE = 0x0000, RNC_IGNORE_FILE_IS_NOT_RNC = 0x0001, RNC_IGNORE_HUF_DECODE_ERROR = 0x0002, RNC_IGNORE_FILE_SIZE_MISMATCH = 0x0004, RNC_IGNORE_PACKED_CRC_ERROR = 0x0008, RNC_IGNORE_UNPACKED_CRC_ERROR = 0x0010, RNC_IGNORE_HEADER_VAL_ERROR = 0x0020, RNC_IGNORE_HUF_EXCEEDS_RANGE = 0x0040, EXLD_THING = 0x01, EXLD_ACTNPT = 0x02, EXLD_STLGHT = 0x04 } |
Flags to load extra objects when reading map. More... | |
enum | LEVEL_FILE_FLAGS { LFF_IGNORE_INTERNAL = 0x0001, LFF_IGNORE_CANNOT_LOAD = 0x0002, LFF_DONT_EVEN_WARN = 0x0004 } |
Flags to ignore errors when loading/saving. More... | |
Functions | |
DLLIMPORT short | save_dk1_map (struct LEVEL *lvl) |
Saves the whole map. | |
DLLIMPORT short | save_dke_map (struct LEVEL *lvl) |
Saves the whole DK Extended map. | |
DLLIMPORT short | user_save_map (struct LEVEL *lvl, short prior_save) |
Saves the whole map. | |
DLLIMPORT short | load_dk1_map (struct LEVEL *lvl) |
Loads the whole map. | |
DLLIMPORT short | load_dke_map (struct LEVEL *lvl) |
Loads the whole map. | |
DLLIMPORT short | load_map_preview (struct LEVEL *lvl) |
Loads the map preview. | |
DLLIMPORT short | user_load_map (struct LEVEL *lvl, short new_on_error) |
Loads the whole map. | |
DLLIMPORT short | script_load_and_execute (struct LEVEL *lvl, struct MEMORY_FILE *mem, char *err_msg) |
Loads ADiKtEd script (.ADI file) from MEMORY_FILE executes all commands. | |
DLLIMPORT short | script_load_and_execute_file (struct LEVEL *lvl, char *fname, char *err_msg) |
Loads ADiKtEd script (.ADI file) and executes all commands. | |
DLLIMPORT short | save_nfo_file (struct LEVEL *lvl) |
DLLIMPORT short | load_text_file (char ***lines, int *lines_count, char *fname) |
Loads any text file as lines. | |
DLLIMPORT short | write_text_file (char **lines, int lines_count, char *fname) |
Saves any text file. | |
DLLIMPORT short | write_def_clm_source (struct LEVEL *lvl, char *fname) |
Utility function for reverse engineering the CLM format. | |
DLLIMPORT short | write_def_tng_source (struct LEVEL *lvl, char *fname) |
Utility function for reverse engineering the TNG format. | |
DLLIMPORT char * | levfile_error (int errcode) |
Returns load error message for specified error code. |
#define ERR_CANT_MALLOC -27 |
Definition at line 33 of file lev_files.h.
Referenced by load_apt(), load_lgt(), load_mapfile(), load_mapfile_msg(), and save_mapfile().
#define ERR_CANT_OPENWR -28 |
Definition at line 34 of file lev_files.h.
Referenced by write_apt(), write_clm(), write_dat(), write_flg(), write_inf(), write_lgt(), write_own(), write_slb(), write_text_file(), write_tng(), write_vsn(), write_wib(), and write_wlb().
#define ERR_CANT_WRITE -29 |
Definition at line 35 of file lev_files.h.
#define ERR_FILE_BADDATA -25 |
Definition at line 31 of file lev_files.h.
Referenced by load_clm(), load_dat(), load_flg(), load_inf(), load_lif(), load_mapfile_msg(), load_own(), load_palette(), load_slb(), load_vsn(), load_wib(), load_wlb(), and script_load_and_execute().
#define ERR_FILE_BADNAME -26 |
Definition at line 32 of file lev_files.h.
Referenced by load_dk1_map(), load_dke_map(), and load_map_preview().
#define ERR_FILE_TOOSMLL -24 |
Definition at line 30 of file lev_files.h.
Referenced by levfile_error(), load_apt(), load_clm(), load_lgt(), load_text_file(), load_tng(), load_txt(), and script_load_and_execute().
#define ERR_INTERNAL -31 |
Definition at line 37 of file lev_files.h.
Referenced by draw_text_on_buffer(), get_draw_subtile_rect(), get_draw_tile_rect(), get_full_draw_dimensions(), get_full_draw_dimensions_opt(), get_object_with_circle_at(), get_subtile_from_draw_coords(), get_subtile_from_draw_coords_adv(), get_subtile_from_draw_coords_ip(), get_thing_with_circle_at(), load_apt(), load_clm(), load_dke_map(), load_lgt(), load_tng(), save_dke_map(), user_load_map(), and user_save_map().
#define ERR_NONE 0 |
Definition at line 29 of file lev_files.h.
#define ERR_VERIF -30 |
#define LFF_IGNORE_ALL (LFF_IGNORE_INTERNAL|LFF_IGNORE_CANNOT_LOAD) |
#define LFF_IGNORE_NONE (0) |
#define LFF_IGNORE_WITHOUT_WARN (LFF_IGNORE_INTERNAL|LFF_IGNORE_CANNOT_LOAD|LFF_DONT_EVEN_WARN) |
#define WARN_BAD_COUNT 24 |
Definition at line 38 of file lev_files.h.
Referenced by levfile_error(), load_apt(), load_lgt(), and load_tng().
enum EXTRA_OBJ_LOAD |
Flags to load extra objects when reading map.
Definition at line 43 of file lev_files.h.
enum LEVEL_FILE_FLAGS |
DLLIMPORT char* levfile_error | ( | int | errcode | ) |
Returns load error message for specified error code.
errcode | The integer error code. |
Definition at line 49 of file lev_files.c.
Referenced by load_mapfile(), save_mapfile(), and script_load_and_execute().
DLLIMPORT short load_dk1_map | ( | struct LEVEL * | lvl | ) |
Loads the whole map.
Tries to open all files editable in ADiKtEd. Accepts failure for less importand files. Makes no stats update. If you want a complete loading function, use user_load_map() instead.
lvl | Pointer to the LEVEL structure. |
Definition at line 1857 of file lev_files.c.
Referenced by user_load_map().
DLLIMPORT short load_dke_map | ( | struct LEVEL * | lvl | ) |
Loads the whole map.
Tries to open all files editable in ADiKtEd. Accepts failure for less importand files. Makes no stats update. If you want a complete loading function, use user_load_map() instead. DK Extended map files won't work in standard Dungeon Keeper on DD.
lvl | Pointer to the LEVEL structure. |
Definition at line 1930 of file lev_files.c.
Referenced by user_load_map().
DLLIMPORT short load_map_preview | ( | struct LEVEL * | lvl | ) |
Loads the map preview.
Tries to open only files needed for Slab mode preview. If you want a complete loading function, use user_load_map() instead.
lvl | Pointer to the LEVEL structure. |
Definition at line 2039 of file lev_files.c.
DLLIMPORT short load_text_file | ( | char *** | lines, | |
int * | lines_count, | |||
char * | fname | |||
) |
Loads any text file as lines.
If input structure is not empty, appends the loaded data at end of it.
lines | Pointer to the text lines array. | |
lines_count | Amount of lines in the array. | |
fname | Source file name. |
Definition at line 850 of file lev_files.c.
Referenced by load_lif().
DLLIMPORT short save_dk1_map | ( | struct LEVEL * | lvl | ) |
Saves the whole map.
Includes all files editable in ADiKtEd. On failure, tries to save at least some of the files. Does not perform an update before saving - to do this, use user_save_map() instead.
lvl | Pointer to the LEVEL structure. |
Definition at line 1498 of file lev_files.c.
Referenced by user_save_map().
DLLIMPORT short save_dke_map | ( | struct LEVEL * | lvl | ) |
Saves the whole DK Extended map.
Includes all files editable in ADiKtEd. On failure, tries to save at least some of the files. DK Extended map files won't load in standard Dungeon Keeper on DD. Does not perform an update before saving - to do this, use user_save_map() instead.
lvl | Pointer to the LEVEL structure. |
Definition at line 1565 of file lev_files.c.
Referenced by user_save_map().
DLLIMPORT short save_nfo_file | ( | struct LEVEL * | lvl | ) |
Definition at line 1546 of file lev_files.c.
DLLIMPORT short script_load_and_execute | ( | struct LEVEL * | lvl, | |
struct MEMORY_FILE * | mem, | |||
char * | err_msg | |||
) |
Loads ADiKtEd script (.ADI file) from MEMORY_FILE executes all commands.
lvl | Pointer to the LEVEL structure. | |
mem | Source file data. | |
err_msg | Error message text. |
Definition at line 763 of file lev_files.c.
Referenced by load_dk1_map(), load_dke_map(), load_mapfile_msg(), and script_load_and_execute_file().
DLLIMPORT short script_load_and_execute_file | ( | struct LEVEL * | lvl, | |
char * | fname, | |||
char * | err_msg | |||
) |
Loads ADiKtEd script (.ADI file) and executes all commands.
lvl | Pointer to the LEVEL structure. | |
fname | Source file name. | |
err_msg | Error message text. |
Definition at line 825 of file lev_files.c.
DLLIMPORT short user_load_map | ( | struct LEVEL * | lvl, | |
short | new_on_error | |||
) |
Loads the whole map.
Tries to open all files editable in Adikted. Accepts failure for less importand files.
lvl | Pointer to the LEVEL structure. | |
new_on_error | If nonzero, the function will automatically start new map on load error. |
Definition at line 2005 of file lev_files.c.
DLLIMPORT short user_save_map | ( | struct LEVEL * | lvl, | |
short | prior_save | |||
) |
Saves the whole map.
Includes all files editable in ADiKtEd. On failure, tries to save at least some of the files. Makes updates required for saving before it starts. Also, fails if the map verification will return serious error. Should be used instead of save_dk1_map(), as it prepares the map before the saving operation is performed.
lvl | Pointer to the LEVEL structure. | |
prior_save | Informs how to increase level version before saving. Prior saves get greater version increase than minor saves. |
Definition at line 1631 of file lev_files.c.
DLLIMPORT short write_def_clm_source | ( | struct LEVEL * | lvl, | |
char * | fname | |||
) |
Utility function for reverse engineering the CLM format.
Used in rework mode.
lvl | Pointer to the LEVEL structure. | |
fname | Destination file name. |
Definition at line 2073 of file lev_files.c.
DLLIMPORT short write_def_tng_source | ( | struct LEVEL * | lvl, | |
char * | fname | |||
) |
Utility function for reverse engineering the TNG format.
Used in rework mode.
lvl | Pointer to the LEVEL structure. | |
fname | Destination file name. |
Definition at line 2160 of file lev_files.c.
DLLIMPORT short write_text_file | ( | char ** | lines, | |
int | lines_count, | |||
char * | fname | |||
) |
Saves any text file.
lines | Pointer to the lines array. | |
lines_count | Lines count. | |
fname | Destination file name. |
Definition at line 1420 of file lev_files.c.
Referenced by write_adi_script(), write_lif(), write_nfo(), and write_txt().