00001
00016
00017
00018 #ifndef ADIKT_LEVFILES_H
00019 #define ADIKT_LEVFILES_H
00020
00021 #include "globals.h"
00022
00023 struct LEVEL;
00024 struct MEMORY_FILE;
00025
00026
00027
00028
00029 #define ERR_NONE 0
00030 #define ERR_FILE_TOOSMLL -24
00031 #define ERR_FILE_BADDATA -25
00032 #define ERR_FILE_BADNAME -26
00033 #define ERR_CANT_MALLOC -27
00034 #define ERR_CANT_OPENWR -28
00035 #define ERR_CANT_WRITE -29
00036 #define ERR_VERIF -30
00037 #define ERR_INTERNAL -31
00038 #define WARN_BAD_COUNT 24
00039
00043 enum EXTRA_OBJ_LOAD {
00044 EXLD_THING = 0x01,
00045 EXLD_ACTNPT = 0x02,
00046 EXLD_STLGHT = 0x04,
00047 };
00048
00052 enum LEVEL_FILE_FLAGS {
00053 LFF_IGNORE_INTERNAL = 0x0001,
00054 LFF_IGNORE_CANNOT_LOAD = 0x0002,
00055 LFF_DONT_EVEN_WARN = 0x0004,
00056 };
00057
00058 #define LFF_IGNORE_NONE (0)
00059 #define LFF_IGNORE_ALL (LFF_IGNORE_INTERNAL|LFF_IGNORE_CANNOT_LOAD)
00060 #define LFF_IGNORE_WITHOUT_WARN (LFF_IGNORE_INTERNAL|LFF_IGNORE_CANNOT_LOAD|LFF_DONT_EVEN_WARN)
00061
00062 DLLIMPORT short save_dk1_map(struct LEVEL *lvl);
00063 DLLIMPORT short save_dke_map(struct LEVEL *lvl);
00064 DLLIMPORT short user_save_map(struct LEVEL *lvl,short prior_save);
00065
00066 DLLIMPORT short load_dk1_map(struct LEVEL *lvl);
00067 DLLIMPORT short load_dke_map(struct LEVEL *lvl);
00068 DLLIMPORT short load_map_preview(struct LEVEL *lvl);
00069 DLLIMPORT short user_load_map(struct LEVEL *lvl,short new_on_error);
00070
00071 DLLIMPORT short script_load_and_execute(struct LEVEL *lvl,
00072 struct MEMORY_FILE *mem,char *err_msg);
00073 DLLIMPORT short script_load_and_execute_file(struct LEVEL *lvl,char *fname,char *err_msg);
00074 DLLIMPORT short save_nfo_file(struct LEVEL *lvl);
00075 DLLIMPORT short load_text_file(char ***lines,int *lines_count,char *fname);
00076 DLLIMPORT short write_text_file(char **lines,int lines_count,char *fname);
00077
00078 DLLIMPORT short write_def_clm_source(struct LEVEL *lvl,char *fname);
00079 DLLIMPORT short write_def_tng_source(struct LEVEL *lvl,char *fname);
00080
00081 DLLIMPORT char *levfile_error(int errcode);
00082
00083 #endif // ADIKT_LEVFILES_H