790
791
792
793
794
795
796
797
798
799
800
801
802
803
|
}
}
void run_game(void) {
int i;
SDL_Event ev;
set_caption();
if(side_mode==255) setup_game();
begin_level(level_id);
redraw_game();
timerflag=0;
SDL_SetTimer(10,timer_callback);
while(SDL_WaitEvent(&ev)) {
switch(ev.type) {
|
>
|
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
|
}
}
void run_game(void) {
int i;
SDL_Event ev;
set_caption();
replay_count=0;
if(side_mode==255) setup_game();
begin_level(level_id);
redraw_game();
timerflag=0;
SDL_SetTimer(10,timer_callback);
while(SDL_WaitEvent(&ev)) {
switch(ev.type) {
|
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
|
case SDL_KEYDOWN:
i=exec_key_binding(&ev,0,0,0,game_command,0);
command:
if(i==-1) goto quit;
if(i==-2) {
main_options['e']=1;
SDL_SetTimer(0,0);
return;
}
replay:
if(inputs_count) {
for(i=0;i<inputs_count && !gameover;i++) if(inputs[i]) input_move(inputs[i]);
inputs_count=0;
no_dead_anim=0;
}
redraw_game();
timerflag=0; // ensure we have not missed a timer event
break;
}
}
quit:
save_replay();
exit(0);
}
void run_auto_test(void) {
Uint8 rc=0;
int lvl,pro,i,n;
|
>
>
|
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
|
case SDL_KEYDOWN:
i=exec_key_binding(&ev,0,0,0,game_command,0);
command:
if(i==-1) goto quit;
if(i==-2) {
main_options['e']=1;
SDL_SetTimer(0,0);
save_replay();
return;
}
replay:
if(inputs_count) {
for(i=0;i<inputs_count && !gameover;i++) if(inputs[i]) input_move(inputs[i]);
inputs_count=0;
no_dead_anim=0;
}
redraw_game();
timerflag=0; // ensure we have not missed a timer event
break;
}
}
quit:
SDL_SetTimer(0,0);
save_replay();
exit(0);
}
void run_auto_test(void) {
Uint8 rc=0;
int lvl,pro,i,n;
|