hedgewars/hwengine.pas
changeset 3487 b1d00f1950c8
parent 3463 23c50be687a9
child 3490 016b3172b645
equal deleted inserted replaced
3486:e1b1a4c18c5b 3487:b1d00f1950c8
   181     event: TSDL_Event;
   181     event: TSDL_Event;
   182 begin
   182 begin
   183     PrevTime:= SDL_GetTicks;
   183     PrevTime:= SDL_GetTicks;
   184     while isTerminated = false do
   184     while isTerminated = false do
   185     begin
   185     begin
       
   186 {$IFNDEF IPHONEOS}
   186 // have to remove this cycle because otherwise it segfaults at exit
   187 // have to remove this cycle because otherwise it segfaults at exit
   187         while SDL_PollEvent(@event) <> 0 do
   188         while SDL_PollEvent(@event) <> 0 do
   188         begin
   189         begin
   189             case event.type_ of
   190             case event.type_ of
   190                 SDL_KEYDOWN: if GameState = gsChat then KeyPressChat(event.key.keysym.unicode);
   191                 SDL_KEYDOWN: if GameState = gsChat then KeyPressChat(event.key.keysym.unicode);
   207                 SDL_JOYBUTTONDOWN: ControllerButtonEvent(event.jbutton.which, event.jbutton.button, true);
   208                 SDL_JOYBUTTONDOWN: ControllerButtonEvent(event.jbutton.which, event.jbutton.button, true);
   208                 SDL_JOYBUTTONUP: ControllerButtonEvent(event.jbutton.which, event.jbutton.button, false);
   209                 SDL_JOYBUTTONUP: ControllerButtonEvent(event.jbutton.which, event.jbutton.button, false);
   209                 SDL_QUITEV: isTerminated:= true
   210                 SDL_QUITEV: isTerminated:= true
   210             end; // end case event.type_
   211             end; // end case event.type_
   211         end; // end while SDL_PollEvent(@event) <> 0
   212         end; // end while SDL_PollEvent(@event) <> 0
       
   213 {$ENDIF}
   212 
   214 
   213         if isTerminated = false then
   215         if isTerminated = false then
   214         begin
   216         begin
   215             CurrTime:= SDL_GetTicks;
   217             CurrTime:= SDL_GetTicks;
   216             if PrevTime + cTimerInterval <= CurrTime then
   218             if PrevTime + cTimerInterval <= CurrTime then