182 prevFocusState:= cHasFocus; |
181 prevFocusState:= cHasFocus; |
183 cHasFocus:= event.active.gain = 1; |
182 cHasFocus:= event.active.gain = 1; |
184 if prevFocusState xor cHasFocus then |
183 if prevFocusState xor cHasFocus then |
185 onFocusStateChanged() |
184 onFocusStateChanged() |
186 end; |
185 end; |
|
186 SDL_VIDEORESIZE: begin |
|
187 // using lower values causes widget overlap and video issues |
|
188 if event.resize.w > cMinScreenWidth then cScreenWidth:= event.resize.w |
|
189 else cScreenWidth:= cMinScreenWidth; |
|
190 if event.resize.h > cMinScreenHeight then cScreenHeight:= event.resize.h |
|
191 else cScreenHeight:= cMinScreenHeight; |
|
192 ParseCommand('fullscr '+intToStr(LongInt(cFullScreen)), true); |
|
193 WriteLnToConsole('window resize'); |
|
194 InitCameraBorders(); |
|
195 end; |
187 {$ENDIF} |
196 {$ENDIF} |
188 SDL_JOYAXISMOTION: ControllerAxisEvent(event.jaxis.which, event.jaxis.axis, event.jaxis.value); |
197 SDL_JOYAXISMOTION: ControllerAxisEvent(event.jaxis.which, event.jaxis.axis, event.jaxis.value); |
189 SDL_JOYHATMOTION: ControllerHatEvent(event.jhat.which, event.jhat.hat, event.jhat.value); |
198 SDL_JOYHATMOTION: ControllerHatEvent(event.jhat.which, event.jhat.hat, event.jhat.value); |
190 SDL_JOYBUTTONDOWN: ControllerButtonEvent(event.jbutton.which, event.jbutton.button, true); |
199 SDL_JOYBUTTONDOWN: ControllerButtonEvent(event.jbutton.which, event.jbutton.button, true); |
191 SDL_JOYBUTTONUP: ControllerButtonEvent(event.jbutton.which, event.jbutton.button, false); |
200 SDL_JOYBUTTONUP: ControllerButtonEvent(event.jbutton.which, event.jbutton.button, false); |
242 cAltDamage:= gameArgs[8] = '1'; |
251 cAltDamage:= gameArgs[8] = '1'; |
243 val(gameArgs[9], rotationQt); |
252 val(gameArgs[9], rotationQt); |
244 recordFileName:= gameArgs[10]; |
253 recordFileName:= gameArgs[10]; |
245 cStereoMode:= smNone; |
254 cStereoMode:= smNone; |
246 {$ENDIF} |
255 {$ENDIF} |
|
256 cMinScreenWidth:= cScreenWidth; |
|
257 cMinScreenHeight:= cScreenHeight; |
|
258 cOrigScreenWidth:= cScreenWidth; |
|
259 cOrigScreenHeight:= cScreenHeight; |
|
260 if 480 < cMinScreenWidth then cMinScreenWidth:= 480; |
|
261 if 320 < cMinScreenHeight then cMinScreenHeight:= 320; |
247 |
262 |
248 initEverything(true); |
263 initEverything(true); |
249 WriteLnToConsole('Hedgewars ' + cVersionString + ' engine (network protocol: ' + inttostr(cNetProtoVersion) + ')'); |
264 WriteLnToConsole('Hedgewars ' + cVersionString + ' engine (network protocol: ' + inttostr(cNetProtoVersion) + ')'); |
250 AddFileLog('Prefix: "' + PathPrefix +'"'); |
265 AddFileLog('Prefix: "' + PathPrefix +'"'); |
251 AddFileLog('UserPrefix: "' + UserPathPrefix +'"'); |
266 AddFileLog('UserPrefix: "' + UserPathPrefix +'"'); |