1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
-
|
#if 0
gcc ${CFLAGS:--s -O2} -o ${EXE:-~/bin/heromesh} -Wno-multichar main.c class.o picture.o bindings.o function.o exec.o game.o edit.o picedit.o sound.o smallxrm.o hash.o sqlite3.o `sdl-config --cflags --libs` -ldl -lpthread -lm
exit
#endif
/*
This program is part of Free Hero Mesh and is public domain.
*/
//#define _GNU_SOURCE
#define HEROMESH_MAIN
#include "SDL.h"
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/file.h>
|
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
|
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
|
-
+
|
main_options['r']=1;
}
if(main_options['n'] && main_options['i']) fatal("Switches -n and -i are conflicting\n");
if(main_options['n'] || main_options['i']) {
if(main_options['r']) fatal("Switches -r and -%c are conflicting\n",main_options['i']?'i':'n');
main_options['x']=1;
}
if(main_options['a']) main_options['r']=main_options['x']=1;
if(main_options['a'] || main_options['O']) main_options['r']=main_options['x']=1;
if(main_options['p']) main_options['r']=1;
if(main_options['f']) main_options['x']=1;
if(!main_options['c']) {
set_path(argv[0]);
load_options();
}
if(argc>optind) read_options(argc-optind,argv+optind);
|
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
|
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
|
+
|
} else if(level_ord=strtol(xrm_get_resource(resourcedb,optionquery,optionquery,2)?:"",0,10)) {
if(level_ord>level_nindex) level_ord=level_nindex;
log_if_error(load_level(-level_ord));
}
optionquery[1]=Q_maxTrigger;
max_trigger=strtol(xrm_get_resource(resourcedb,optionquery,optionquery,2)?:"",0,10);
if(main_options['a']) run_auto_test();
if(main_options['O']) export_private_solutions();
if(main_options['x']) {
if(main_options['i']) {
batch_import();
if(main_options['f']) flush_usercache();
return 0;
} else if(main_options['f']) {
if(main_options['r']) fatal("Cannot flush user cache; puzzle set is read-only\n");
|