hedgewars/uWorld.pas
changeset 6415 af2047bb4f70
parent 6394 f0a9042e7387
parent 6344 cba81e10235c
child 6453 11c578d30bd3
equal deleted inserted replaced
6414:8474b7fa84d6 6415:af2047bb4f70
   920 
   920 
   921 // this scale is used to keep the various widgets at the same dimension at all zoom levels
   921 // this scale is used to keep the various widgets at the same dimension at all zoom levels
   922 SetScale(cDefaultZoomLevel);
   922 SetScale(cDefaultZoomLevel);
   923 
   923 
   924 // Turn time
   924 // Turn time
   925 {$IFDEF IPHONEOS}
   925 {$IFDEF MOBILE}
   926 offsetX:= cScreenHeight - 13;
   926 offsetX:= cScreenHeight - 13;
   927 {$ELSE}
   927 {$ELSE}
   928 offsetX:= 48;
   928 offsetX:= 48;
   929 {$ENDIF}
   929 {$ENDIF}
   930 offsetY:= cOffsetY;
   930 offsetY:= cOffsetY;
   949    end;
   949    end;
   950 
   950 
   951 // Captions
   951 // Captions
   952 DrawCaptions;
   952 DrawCaptions;
   953 
   953 
       
   954 {$IFDEF ANDROID}
       
   955 // Draw buttons Related to the Touch interface
       
   956 DrawTexture(Round(-cScreenWidth*0.5 + cScreenHeight*0.02),Round((cScreenHeight*0.98)-(spritesData[sprFireButton].Height*0.4) ),spritesData[sprFireButton].Texture, 0.4);
       
   957 {$ENDIF}
   954 // Teams Healths
   958 // Teams Healths
   955 if TeamsCount * 20 > Longword(cScreenHeight) div 7 then  // take up less screen on small displays
   959 if TeamsCount * 20 > Longword(cScreenHeight) div 7 then  // take up less screen on small displays
   956     begin
   960     begin
   957     SetScale(1.5);
   961     SetScale(1.5);
   958     smallScreenOffset:= cScreenHeight div 6;
   962     smallScreenOffset:= cScreenHeight div 6;
  1022 
  1026 
  1023 // Lag alert
  1027 // Lag alert
  1024 if isInLag then DrawSprite(sprLag, 32 - (cScreenWidth shr 1), 32, (RealTicks shr 7) mod 12);
  1028 if isInLag then DrawSprite(sprLag, 32 - (cScreenWidth shr 1), 32, (RealTicks shr 7) mod 12);
  1025 
  1029 
  1026 // Wind bar
  1030 // Wind bar
  1027 {$IFDEF IPHONEOS}
  1031 {$IFDEF MOBILE}
  1028     offsetX:= cScreenHeight - 13;
  1032     offsetX:= cScreenHeight - 13;
  1029     offsetY:= (cScreenWidth shr 1) + 74;
  1033     offsetY:= (cScreenWidth shr 1) + 74;
  1030 {$ELSE}
  1034 {$ELSE}
  1031     offsetX:= 30;
  1035     offsetX:= 30;
  1032     offsetY:= 180;
  1036     offsetY:= 180;
  1074     if missionTex <> nil then
  1078     if missionTex <> nil then
  1075         DrawCentered(0, Min((cScreenHeight shr 1) + 100, cScreenHeight - 48 - missionTex^.h), missionTex);
  1079         DrawCentered(0, Min((cScreenHeight shr 1) + 100, cScreenHeight - 48 - missionTex^.h), missionTex);
  1076     end;
  1080     end;
  1077 
  1081 
  1078 // fps
  1082 // fps
  1079 {$IFDEF IPHONEOS}
  1083 {$IFDEF MOBILE}
  1080 offsetX:= 8;
  1084 offsetX:= 8;
  1081 {$ELSE}
  1085 {$ELSE}
  1082 offsetX:= 10;
  1086 offsetX:= 10;
  1083 {$ENDIF}
  1087 {$ENDIF}
  1084 offsetY:= cOffsetY;
  1088 offsetY:= cOffsetY;
  1213 
  1217 
  1214 procedure MoveCamera;
  1218 procedure MoveCamera;
  1215 var EdgesDist, wdy, shs,z: LongInt;
  1219 var EdgesDist, wdy, shs,z: LongInt;
  1216     PrevSentPointTime: LongWord = 0;
  1220     PrevSentPointTime: LongWord = 0;
  1217 begin
  1221 begin
  1218 {$IFNDEF IPHONEOS}
  1222 {$IFNDEF MOBILE}
  1219 if (not (CurrentTeam^.ExtDriven and isCursorVisible and not bShowAmmoMenu)) and cHasFocus and (GameState <> gsConfirm) then
  1223 if (not (CurrentTeam^.ExtDriven and isCursorVisible and not bShowAmmoMenu)) and cHasFocus and (GameState <> gsConfirm) then
  1220     uCursor.updatePosition();
  1224     uCursor.updatePosition();
  1221 {$ENDIF}
  1225 {$ENDIF}
  1222 z:= round(200/zoom);
  1226 z:= round(200/zoom);
  1223 if not PlacingHogs and (FollowGear <> nil) and not isCursorVisible and not bShowAmmoMenu and not fastUntilLag then
  1227 if not PlacingHogs and (FollowGear <> nil) and not isCursorVisible and not bShowAmmoMenu and not fastUntilLag then
  1241 
  1245 
  1242 if ((CursorPoint.X = prevPoint.X) and (CursorPoint.Y = prevpoint.Y)) then exit;
  1246 if ((CursorPoint.X = prevPoint.X) and (CursorPoint.Y = prevpoint.Y)) then exit;
  1243 
  1247 
  1244 if AMxShift < AMWidth then
  1248 if AMxShift < AMWidth then
  1245 begin
  1249 begin
  1246 {$IFDEF IPHONEOS}
  1250 {$IFDEF MOBILE}
  1247     if CursorPoint.X < cScreenWidth div 2 + AMxShift - AMWidth then CursorPoint.X:= cScreenWidth div 2 + AMxShift - AMWidth;
  1251     if CursorPoint.X < cScreenWidth div 2 + AMxShift - AMWidth then CursorPoint.X:= cScreenWidth div 2 + AMxShift - AMWidth;
  1248     if CursorPoint.X > cScreenWidth div 2 + AMxShift - AMxOffset then CursorPoint.X:= cScreenWidth div 2 + AMxShift - AMxOffset;
  1252     if CursorPoint.X > cScreenWidth div 2 + AMxShift - AMxOffset then CursorPoint.X:= cScreenWidth div 2 + AMxShift - AMxOffset;
  1249     if CursorPoint.Y < cScreenHeight - AMyOffset - SlotsNum * AMSlotSize then CursorPoint.Y:= cScreenHeight - AMyOffset - SlotsNum * AMSlotSize;
  1253     if CursorPoint.Y < cScreenHeight - AMyOffset - SlotsNum * AMSlotSize then CursorPoint.Y:= cScreenHeight - AMyOffset - SlotsNum * AMSlotSize;
  1250     if CursorPoint.Y > cScreenHeight - AMyOffset then CursorPoint.Y:= cScreenHeight - AMyOffset;
  1254     if CursorPoint.Y > cScreenHeight - AMyOffset then CursorPoint.Y:= cScreenHeight - AMyOffset;
  1251 {$ELSE}
  1255 {$ELSE}