hedgewars/hwengine.pas
changeset 12806 8a359cc248d1
parent 12798 575c0de98505
child 12823 d3113a4cba36
equal deleted inserted replaced
12805:5bdb2f43641e 12806:8a359cc248d1
   203                         SDL_WINDOWEVENT_FOCUS_LOST:
   203                         SDL_WINDOWEVENT_FOCUS_LOST:
   204                                 begin
   204                                 begin
   205                                 cHasFocus:= false;
   205                                 cHasFocus:= false;
   206                                 onFocusStateChanged();
   206                                 onFocusStateChanged();
   207                                 end;
   207                                 end;
       
   208 {$IFDEF MOBILE}
       
   209 (* Suspend game if minimized on mobile.
       
   210 NOTE: Mobile doesn't support online multiplayer yet, so it's not a problem.
       
   211 BUT: This section WILL become a bug when online multiplayer is added to
       
   212 Hedgewars and needs to be rethought. This is because it will cause the
       
   213 game to freeze if one online player minimizes Hedgewars. *)
   208                         SDL_WINDOWEVENT_MINIMIZED:
   214                         SDL_WINDOWEVENT_MINIMIZED:
   209                                 begin
   215                                 begin
   210                                 previousGameState:= GameState;
   216                                 previousGameState:= GameState;
   211                                 GameState:= gsSuspend;
   217                                 GameState:= gsSuspend;
   212                                 end;
   218                                 end;
       
   219 {$ENDIF}
   213                         SDL_WINDOWEVENT_RESTORED:
   220                         SDL_WINDOWEVENT_RESTORED:
   214                                 begin
   221                                 begin
   215                                 if GameState = gsSuspend then
   222                                 if GameState = gsSuspend then
   216                                     GameState:= previousGameState;
   223                                     GameState:= previousGameState;
   217 {$IFDEF ANDROID}
   224 {$IFDEF ANDROID}