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

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 839 of file map.c.

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

Referenced by get_empty_map(), load_temporary_map(), mapfile_load(), 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 
)

Loads (and parses) the objects into a given map from the specified file pointer.

Parameters
mm being loaded.
fpfile to read from.
mapflagsthe same as we get with mapfile_load()

Definition at line 612 of file map.c.

References FLAG_IS_FLOOR, FLAG_OBJ_ORIGINAL, FLAG_OVERLAY_FLOOR, FLAG_UNIQUE, FOR_MAP_FINISH, FOR_MAP_PREPARE, INS_ABOVE_FLOOR_ONLY, INS_MAP_LOAD, INS_NO_MERGE, INS_NO_WALK_ON, INS_ON_TOP, link_multipart_objects(), LL_MORE, LL_NORMAL, llevDebug, llevError, LO_NEWFILE, LO_REPEAT, load_object(), LOG(), m, MAP_HEIGHT, MAP_OVERLAY, MAP_PLAYER_UNIQUE, MAP_STYLE, MAP_WIDTH, obj::more, object_free_drop_inventory(), object_insert_in_map_at(), object_new(), object_remove_from_active_list(), object_sum_weight(), give::op, PLAYER, PROFILE_BEGIN, PROFILE_END, QUERY_FLAG, and SET_FLAG.

Referenced by load_overlay_map(), load_temporary_map(), load_unique_objects(), mapfile_load(), and mapsave_test().

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

◆ main()

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

Definition at line 47 of file check_mapsave.c.

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.c.

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. Modified by MSW 2001-07-01 to do in a single pass - reduces code, and 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 725 of file map.c.

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: