794
795
796
797
798
799
800
801
802
803
804
805
806
807
|
}
#endif
const char*log_if_error(const char*t) {
if(t && main_options['v']) fprintf(stderr,"!! %s\n",t);
return t;
}
int main(int argc,char**argv) {
int optind=1;
while(argc>optind && argv[optind][0]=='-') {
int i;
const char*s=argv[optind++];
if(s[1]=='-' && !s[2]) break;
|
>
>
>
>
>
>
>
>
>
>
>
|
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
|
}
#endif
const char*log_if_error(const char*t) {
if(t && main_options['v']) fprintf(stderr,"!! %s\n",t);
return t;
}
static void set_tracing(void) {
const char*v;
int i;
optionquery[1]=Q_traceAll;
v=xrm_get_resource(resourcedb,optionquery,optionquery,2)?:"";
if(boolxrm(v,0)) {
memset(message_trace,255,sizeof(message_trace));
for(i=0;i<0x4000;i++) if(classes[i]) classes[i]->cflags|=CF_TRACEIN|CF_TRACEOUT;
}
}
int main(int argc,char**argv) {
int optind=1;
while(argc>optind && argv[optind][0]=='-') {
int i;
const char*s=argv[optind++];
if(s[1]=='-' && !s[2]) break;
|
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
|
return 0;
}
init_usercache();
load_classes();
load_level_index();
optionquery[1]=Q_maxObjects;
max_objects=strtoll(xrm_get_resource(resourcedb,optionquery,optionquery,2)?:"",0,0)?:0xFFFF0000L;
annihilate();
optionquery[1]=Q_level;
if(level_ord=strtol(xrm_get_resource(resourcedb,optionquery,optionquery,2)?:"",0,10)) log_if_error(load_level(-level_ord));
if(main_options['x']) {
fprintf(stderr,"Ready for executing SQL statements.\n");
do_sql_mode();
return 0;
}
for(;;) { if(main_options['e']) run_editor(); else run_game(); }
}
|
>
|
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
|
return 0;
}
init_usercache();
load_classes();
load_level_index();
optionquery[1]=Q_maxObjects;
max_objects=strtoll(xrm_get_resource(resourcedb,optionquery,optionquery,2)?:"",0,0)?:0xFFFF0000L;
set_tracing();
annihilate();
optionquery[1]=Q_level;
if(level_ord=strtol(xrm_get_resource(resourcedb,optionquery,optionquery,2)?:"",0,10)) log_if_error(load_level(-level_ord));
if(main_options['x']) {
fprintf(stderr,"Ready for executing SQL statements.\n");
do_sql_mode();
return 0;
}
for(;;) { if(main_options['e']) run_editor(); else run_game(); }
}
|