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 |
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; |