1140 exit |
1140 exit |
1141 end; |
1141 end; |
1142 if Length(s) = 0 then |
1142 if Length(s) = 0 then |
1143 cFullScreen:= (not cFullScreen) |
1143 cFullScreen:= (not cFullScreen) |
1144 else cFullScreen:= s = '1'; |
1144 else cFullScreen:= s = '1'; |
|
1145 |
|
1146 if cFullScreen then |
|
1147 begin |
|
1148 cScreenWidth:= cFullscreenWidth; |
|
1149 cScreenHeight:= cFullscreenHeight; |
|
1150 end |
|
1151 else |
|
1152 begin |
|
1153 cScreenWidth:= cWindowedWidth; |
|
1154 cScreenHeight:= cWindowedHeight; |
|
1155 end; |
1145 |
1156 |
1146 AddFileLog('Preparing to change video parameters...'); |
1157 AddFileLog('Preparing to change video parameters...'); |
1147 {$IFDEF SDL13} |
1158 {$IFDEF SDL13} |
1148 if SDLwindow = nil then |
1159 if SDLwindow = nil then |
1149 {$ELSE} |
1160 {$ELSE} |
1217 flags:= flags or SDL_WINDOW_BORDERLESS; |
1228 flags:= flags or SDL_WINDOW_BORDERLESS; |
1218 {$ENDIF} |
1229 {$ENDIF} |
1219 |
1230 |
1220 if SDLwindow = nil then |
1231 if SDLwindow = nil then |
1221 if cFullScreen then |
1232 if cFullScreen then |
1222 SDLwindow:= SDL_CreateWindow('Hedgewars', x, y, cOrigScreenWidth, cOrigScreenHeight, flags or SDL_WINDOW_FULLSCREEN) |
1233 SDLwindow:= SDL_CreateWindow('Hedgewars', x, y, cScreenWidth, cScreenHeight, flags or SDL_WINDOW_FULLSCREEN) |
1223 else |
1234 else |
|
1235 begin |
1224 SDLwindow:= SDL_CreateWindow('Hedgewars', x, y, cScreenWidth, cScreenHeight, flags); |
1236 SDLwindow:= SDL_CreateWindow('Hedgewars', x, y, cScreenWidth, cScreenHeight, flags); |
|
1237 end; |
1225 SDLTry(SDLwindow <> nil, true); |
1238 SDLTry(SDLwindow <> nil, true); |
1226 {$ELSE} |
1239 {$ELSE} |
1227 flags:= SDL_OPENGL or SDL_RESIZABLE; |
1240 flags:= SDL_OPENGL or SDL_RESIZABLE; |
1228 if cFullScreen then |
1241 if cFullScreen then |
|
1242 begin |
1229 flags:= flags or SDL_FULLSCREEN; |
1243 flags:= flags or SDL_FULLSCREEN; |
1230 |
1244 end; |
1231 if not cOnlyStats then |
1245 if not cOnlyStats then |
1232 begin |
1246 begin |
1233 {$IFDEF WIN32} |
1247 {$IFDEF WIN32} |
1234 s:= SDL_getenv('SDL_VIDEO_CENTERED'); |
1248 s:= SDL_getenv('SDL_VIDEO_CENTERED'); |
1235 SDL_putenv('SDL_VIDEO_CENTERED=1'); |
1249 SDL_putenv('SDL_VIDEO_CENTERED=1'); |