Crossfire Server, Trunk
perf_mapsave.cpp
Go to the documentation of this file.
1
#include "
global.h
"
2
3
#ifdef HAVE_GPERFTOOLS_PROFILER_H
4
#include <gperftools/profiler.h>
5
#endif
6
7
int
main
(
int
argc,
char
*argv[]) {
8
if
(argc < 3) {
9
puts(
"usage: perf_mapsave PATH N_TIMES"
);
10
return
0;
11
}
12
13
settings
.
debug
=
llevDebug
;
14
init_library
();
15
int
flags
= 0;
16
if
(argv[1][0] ==
'~'
) {
17
flags
|=
MAP_PLAYER_UNIQUE
;
18
}
19
#ifdef HAVE_GPERFTOOLS_PROFILER_H
20
ProfilerStart(
"mapsave.prof"
);
21
#endif
22
for
(
int
i = 0; i < (
int
)strtol(argv[2], NULL, 10); i++) {
23
mapstruct
*
m
=
mapfile_load
(argv[1],
flags
);
24
if
(
m
== NULL) {
25
break
;
26
}
27
save_map
(
m
, 0);
28
free_map
(
m
);
29
}
30
#ifdef HAVE_GPERFTOOLS_PROFILER_H
31
ProfilerStop();
32
#endif
33
}
global.h
settings
struct Settings settings
Definition:
init.cpp:139
flags
static const flag_definition flags[]
Definition:
gridarta-types-convert.cpp:101
MAP_PLAYER_UNIQUE
#define MAP_PLAYER_UNIQUE
Definition:
map.h:92
m
static event_registration m
Definition:
citylife.cpp:425
Settings::debug
LogLevel debug
Definition:
global.h:243
free_map
void free_map(mapstruct *m)
Definition:
map.cpp:1650
init_library
void init_library(void)
Definition:
init.cpp:324
mapstruct
Definition:
map.h:313
make_face_from_files.int
int
Definition:
make_face_from_files.py:32
main
int main(int argc, char *argv[])
Definition:
perf_mapsave.cpp:7
save_map
int save_map(mapstruct *m, int flag)
Definition:
map.cpp:1395
mapfile_load
mapstruct * mapfile_load(const char *map, int flags)
Definition:
map.cpp:1216
llevDebug
@ llevDebug
Definition:
logger.h:13
crossfire-crossfire-server
test
performance
perf_mapsave.cpp
Generated by
1.8.17