Crossfire Server, Trunk
check_mapsave.cpp File Reference
#include "global.h"
+ Include dependency graph for check_mapsave.cpp:

Go to the source code of this file.

Functions

void allocate_map (mapstruct *m)
 
void load_objects (mapstruct *m, FILE *fp, int mapflags)
 
int main (int argc, char *argv[])
 
int mapsave_test (const char *map)
 
int save_objects (mapstruct *m, FILE *fp, FILE *fp2, int flag)
 

Function Documentation

◆ allocate_map()

void allocate_map ( mapstruct m)

This basically allocates the dynamic array of spaces for the map.

Parameters
mmap to check.
Note
will never fail, since it calls fatal() if memory allocation failure.

Definition at line 813 of file map.cpp.

References fatal(), llevError, LOG(), m, MAP_IN_MEMORY, map_size(), and OUT_OF_MEMORY.

Referenced by get_empty_map(), load_temporary_map(), mapfile_load_lowlevel(), and mapsave_test().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ load_objects()

void load_objects ( mapstruct m,
FILE *  fp,
int  mapflags 
)

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 47 of file check_mapsave.cpp.

References Settings::debug, init_library(), llevDebug, mapsave_test(), and settings.

+ Here is the call graph for this function:

◆ mapsave_test()

int mapsave_test ( const char *  map)

Definition at line 7 of file check_mapsave.cpp.

References allocate_map(), flags, free_map(), get_linked_map(), load_objects(), m, disinfect::map, MAP_LOADING, MAP_PLAYER_UNIQUE, MAP_SAVING, MAP_STYLE, mapfile_load(), and save_objects().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save_objects()

int save_objects ( mapstruct m,
FILE *  fp,
FILE *  fp2,
int  flag 
)

This saves all the objects on the map in a non destructive fashion. We only save the head of multi part objects - this is needed in order to do map tiling properly.

Parameters
mmap to save.
fpfile where regular objects are saved.
fp2file to save unique objects.
flagcombination of SAVE_FLAG_xxx flags.
Returns
one of SAVE_ERROR_xxx value.

Definition at line 715 of file map.cpp.

References disinfect::count, FLAG_IS_FLOOR, FLAG_OBJ_ORIGINAL, FLAG_UNIQUE, FLAG_UNPAID, FOR_MAP_FINISH, FOR_MAP_PREPARE, llevDebug, LOG(), m, MAP_HEIGHT, MAP_WIDTH, object_get_owner(), give::op, PLAYER, PROFILE_BEGIN, PROFILE_END, QUERY_FLAG, SAVE_FLAG_NO_REMOVE, SAVE_FLAG_SAVE_UNPAID, save_object_in_sb(), stringbuffer_finish(), and stringbuffer_new().

Referenced by mapsave_test(), and save_map().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: