947 WeaponTooltipTex:= nil |
944 WeaponTooltipTex:= nil |
948 end; |
945 end; |
949 |
946 |
950 procedure chFullScr(var s: shortstring); |
947 procedure chFullScr(var s: shortstring); |
951 var flags: Longword = 0; |
948 var flags: Longword = 0; |
952 {$IFNDEF IPHONEOS}ico: PSDL_Surface;{$ENDIF} |
949 reinit: boolean = false; |
953 reinit: boolean; |
950 {$IFNDEF DARWIN}ico: PSDL_Surface;{$ENDIF} |
954 {$IFDEF SDL13}x, y: LongInt;{$ENDIF} |
951 {$IFDEF SDL13}x, y: LongInt;{$ENDIF} |
955 begin |
952 begin |
956 if Length(s) = 0 then cFullScreen:= not cFullScreen |
953 if Length(s) = 0 then cFullScreen:= not cFullScreen |
957 else cFullScreen:= s = '1'; |
954 else cFullScreen:= s = '1'; |
958 |
955 |
959 AddFileLog('Preparing to change video parameters...'); |
956 AddFileLog('Preparing to change video parameters...'); |
960 reinit:= false; |
|
961 {$IFNDEF IPHONEOS} |
957 {$IFNDEF IPHONEOS} |
962 if SDLPrimSurface = nil then |
958 if SDLPrimSurface = nil then |
963 begin |
959 begin |
964 // set window title |
960 // set window title |
965 SDL_WM_SetCaption('Hedgewars', nil); |
961 SDL_WM_SetCaption('Hedgewars', nil); |
966 {$IFDEF SDL_IMAGE_NEWER} |
|
967 WriteToConsole('Init SDL_image... '); |
962 WriteToConsole('Init SDL_image... '); |
968 SDLTry(IMG_Init(IMG_INIT_PNG) <> 0, true); |
963 SDLTry(IMG_Init(IMG_INIT_PNG) <> 0, true); |
969 WriteLnToConsole(msgOK); |
964 WriteLnToConsole(msgOK); |
970 {$ENDIF} |
|
971 // load engine icon |
965 // load engine icon |
972 {$IFDEF DARWIN} |
966 {$IFNDEF DARWIN} |
973 ico:= LoadImage(UserPathz[ptGraphics] + '/hwengine_mac', ifIgnoreCaps); |
|
974 if ico = nil then ico:= LoadImage(Pathz[ptGraphics] + '/hwengine_mac', ifIgnoreCaps); |
|
975 {$ELSE} |
|
976 ico:= LoadImage(UserPathz[ptGraphics] + '/hwengine', ifIgnoreCaps); |
967 ico:= LoadImage(UserPathz[ptGraphics] + '/hwengine', ifIgnoreCaps); |
977 if ico = nil then ico:= LoadImage(Pathz[ptGraphics] + '/hwengine', ifIgnoreCaps); |
968 if ico = nil then ico:= LoadImage(Pathz[ptGraphics] + '/hwengine', ifIgnoreCaps); |
978 {$ENDIF} |
|
979 if ico <> nil then |
969 if ico <> nil then |
980 begin |
970 begin |
981 SDL_WM_SetIcon(ico, 0); |
971 SDL_WM_SetIcon(ico, 0); |
982 SDL_FreeSurface(ico) |
972 SDL_FreeSurface(ico) |
983 end; |
973 end; |
|
974 {$ENDIF} |
984 end |
975 end |
985 else |
976 else |
986 begin |
977 begin |
987 SetScale(cDefaultZoomLevel); |
978 SetScale(cDefaultZoomLevel); |
988 {$IF DEFINED(DARWIN) OR DEFINED(WIN32)} |
979 {$IF DEFINED(DARWIN) OR DEFINED(WIN32)} |