hedgewars/hwengine.pas
changeset 15908 014f4edd0421
parent 15320 3bf780084c86
equal deleted inserted replaced
15907:a323e1954a6f 15908:014f4edd0421
    30 {$ENDIF}
    30 {$ENDIF}
    31 
    31 
    32 uses {$IFDEF IPHONEOS}cmem, {$ENDIF} SDLh, uMisc, uConsole, uGame, uConsts, uLand, uAmmos, uVisualGears, uGears, uStore, uWorld, uInputHandler
    32 uses {$IFDEF IPHONEOS}cmem, {$ENDIF} SDLh, uMisc, uConsole, uGame, uConsts, uLand, uAmmos, uVisualGears, uGears, uStore, uWorld, uInputHandler
    33      , uSound, uScript, uTeams, uStats, uIO, uLocale, uChat, uAI, uAIMisc, uAILandMarks, uLandTexture, uCollisions
    33      , uSound, uScript, uTeams, uStats, uIO, uLocale, uChat, uAI, uAIMisc, uAILandMarks, uLandTexture, uCollisions
    34      , SysUtils, uTypes, uVariables, uCommands, uUtils, uCaptions, uDebug, uCommandHandlers, uLandPainted
    34      , SysUtils, uTypes, uVariables, uCommands, uUtils, uCaptions, uDebug, uCommandHandlers, uLandPainted
    35      , uPhysFSLayer, uCursor, uRandom, ArgParsers, uVisualGearsHandlers, uTextures, uRender
    35      , uPhysFSLayer, uCursor, uRandom, ArgParsers, uVisualGearsHandlers, uTextures, uRender, uDrawing
    36      {$IFDEF USE_VIDEO_RECORDING}, uVideoRec {$ENDIF}
    36      {$IFDEF USE_VIDEO_RECORDING}, uVideoRec {$ENDIF}
    37      {$IFDEF USE_TOUCH_INTERFACE}, uTouch {$ENDIF}
    37      {$IFDEF USE_TOUCH_INTERFACE}, uTouch {$ENDIF}
    38      {$IFDEF ANDROID}, GLUnit{$ENDIF}
    38      {$IFDEF ANDROID}, GLUnit{$ENDIF}
    39      {$IFDEF UNIX}, clocale{$ENDIF}
    39      {$IFDEF UNIX}, clocale{$ENDIF}
    40      {$IFDEF WINDOWS}, dynlibs{$ENDIF}
    40      {$IFDEF WINDOWS}, dynlibs{$ENDIF}
   205                     begin
   205                     begin
   206                     case event.window.event of
   206                     case event.window.event of
   207                         SDL_WINDOWEVENT_FOCUS_GAINED:
   207                         SDL_WINDOWEVENT_FOCUS_GAINED:
   208                                 begin
   208                                 begin
   209                                 cHasFocus:= true;
   209                                 cHasFocus:= true;
   210                                 onFocusStateChanged();
   210                                 uWorld.onFocusStateChanged();
       
   211                                 uDrawing.onFocusStateChanged();
   211                                 end;
   212                                 end;
   212                         SDL_WINDOWEVENT_FOCUS_LOST:
   213                         SDL_WINDOWEVENT_FOCUS_LOST:
   213                                 begin
   214                                 begin
   214                                 cHasFocus:= false;
   215                                 cHasFocus:= false;
   215                                 onFocusStateChanged();
   216                                 uWorld.onFocusStateChanged();
       
   217                                 uDrawing.onFocusStateChanged();
   216                                 end;
   218                                 end;
   217 {$IFDEF MOBILE}
   219 {$IFDEF MOBILE}
   218 (* Suspend game if minimized on mobile.
   220 (* Suspend game if minimized on mobile.
   219 NOTE: Mobile doesn't support online multiplayer yet, so it's not a problem.
   221 NOTE: Mobile doesn't support online multiplayer yet, so it's not a problem.
   220 BUT: This section WILL become a bug when online multiplayer is added to
   222 BUT: This section WILL become a bug when online multiplayer is added to
   539         uStore.initModule;
   541         uStore.initModule;
   540         uRender.initModule;
   542         uRender.initModule;
   541         uTeams.initModule;
   543         uTeams.initModule;
   542         uVisualGears.initModule;
   544         uVisualGears.initModule;
   543         uVisualGearsHandlers.initModule;
   545         uVisualGearsHandlers.initModule;
       
   546         uDrawing.initModule;
   544         uWorld.initModule;
   547         uWorld.initModule;
   545     end;
   548     end;
   546 end;
   549 end;
   547 
   550 
   548 procedure freeEverything (complete:boolean);
   551 procedure freeEverything (complete:boolean);
   553         uAI.freeModule;             // AI things need to be freed first
   556         uAI.freeModule;             // AI things need to be freed first
   554         uAIMisc.freeModule;         //stub
   557         uAIMisc.freeModule;         //stub
   555         uAILandMarks.freeModule;
   558         uAILandMarks.freeModule;
   556         uCaptions.freeModule;
   559         uCaptions.freeModule;
   557         uWorld.freeModule;
   560         uWorld.freeModule;
       
   561         uDrawing.freeModule;
   558         uVisualGears.freeModule;
   562         uVisualGears.freeModule;
   559         uTeams.freeModule;
   563         uTeams.freeModule;
   560         uInputHandler.freeModule;
   564         uInputHandler.freeModule;
   561         uStats.freeModule;          //stub
   565         uStats.freeModule;          //stub
   562         uSound.freeModule;
   566         uSound.freeModule;