hedgewars/uWorld.pas
branchhedgeroid
changeset 5725 e27100a0e2d0
parent 5619 2ec22ebeb6f5
parent 5684 bc3d2a58921c
child 5824 2e5835130d9a
equal deleted inserted replaced
5671:ba4c3a4c8b09 5725:e27100a0e2d0
    30 procedure DrawWorld(Lag: LongInt);
    30 procedure DrawWorld(Lag: LongInt);
    31 procedure DrawWorldStereo(Lag: LongInt; RM: TRenderMode);
    31 procedure DrawWorldStereo(Lag: LongInt; RM: TRenderMode);
    32 procedure ShowMission(caption, subcaption, text: ansistring; icon, time : LongInt);
    32 procedure ShowMission(caption, subcaption, text: ansistring; icon, time : LongInt);
    33 procedure HideMission;
    33 procedure HideMission;
    34 procedure ShakeCamera(amount: LongWord);
    34 procedure ShakeCamera(amount: LongWord);
       
    35 procedure InitCameraBorders;
    35 procedure MoveCamera;
    36 procedure MoveCamera;
    36 procedure onFocusStateChanged;
    37 procedure onFocusStateChanged;
    37 
    38 
    38 implementation
    39 implementation
    39 uses
    40 uses
   173 
   174 
   174 cWaveWidth:= SpritesData[sprWater].Width;
   175 cWaveWidth:= SpritesData[sprWater].Width;
   175 //cWaveHeight:= SpritesData[sprWater].Height;
   176 //cWaveHeight:= SpritesData[sprWater].Height;
   176 cWaveHeight:= 32;
   177 cWaveHeight:= 32;
   177 
   178 
   178 cGearScrEdgesDist:= Min(cScreenWidth div 2 - 100, cScreenHeight div 2 - 50);
   179 InitCameraBorders();
   179 uCursor.init();
   180 uCursor.init();
   180 prevPoint.X:= 0;
   181 prevPoint.X:= 0;
   181 prevPoint.Y:= cScreenHeight div 2;
   182 prevPoint.Y:= cScreenHeight div 2;
   182 WorldDx:=  - (LAND_WIDTH div 2) + cScreenWidth div 2;
   183 WorldDx:=  - (LAND_WIDTH div 2) + cScreenWidth div 2;
   183 WorldDy:=  - (LAND_HEIGHT - (playHeight div 2)) + (cScreenHeight div 2);
   184 WorldDy:=  - (LAND_HEIGHT - (playHeight div 2)) + (cScreenHeight div 2);
   194 AMxShift:= AMWidth;
   195 AMxShift:= AMWidth;
   195 SkyOffset:= 0;
   196 SkyOffset:= 0;
   196 HorizontOffset:= 0;
   197 HorizontOffset:= 0;
   197 end;
   198 end;
   198 
   199 
       
   200 procedure InitCameraBorders;
       
   201 begin
       
   202 cGearScrEdgesDist:= min(2 * cScreenHeight div 5, 2 * cScreenWidth div 5);
       
   203 end;
   199 
   204 
   200 procedure ShowAmmoMenu;
   205 procedure ShowAmmoMenu;
   201 const MENUSPEED = 15;
   206 const MENUSPEED = 15;
   202 const BORDERSIZE = 2;
   207 const BORDERSIZE = 2;
   203 var x, y, i, t, g: LongInt;
   208 var x, y, i, t, g: LongInt;
  1162    if not bShowAmmoMenu then
  1167    if not bShowAmmoMenu then
  1163      begin
  1168      begin
  1164      with CurrentHedgehog^ do
  1169      with CurrentHedgehog^ do
  1165        if (Gear <> nil) and ((Gear^.State and gstHHChooseTarget) <> 0) then
  1170        if (Gear <> nil) and ((Gear^.State and gstHHChooseTarget) <> 0) then
  1166          begin
  1171          begin
  1167          if CurAmmoType = amNapalm then
  1172          if (CurAmmoType = amNapalm) or (CurAmmoType = amMineStrike) then
  1168            DrawLine(-3000, topY-300, 7000, topY-300, 3.0, (Team^.Clan^.Color shr 16), (Team^.Clan^.Color shr 8) and $FF, Team^.Clan^.Color and $FF, $FF);
  1173            DrawLine(-3000, topY-300, 7000, topY-300, 3.0, (Team^.Clan^.Color shr 16), (Team^.Clan^.Color shr 8) and $FF, Team^.Clan^.Color and $FF, $FF);
  1169          i:= GetAmmoEntry(CurrentHedgehog^)^.Pos;
  1174          i:= GetAmmoEntry(CurrentHedgehog^)^.Pos;
  1170          with Ammoz[CurAmmoType] do
  1175          with Ammoz[CurAmmoType] do
  1171            if PosCount > 1 then
  1176            if PosCount > 1 then
  1172              DrawSprite(PosSprite, CursorPoint.X - (SpritesData[PosSprite].Width shr 1), cScreenHeight - CursorPoint.Y - (SpritesData[PosSprite].Height shr 1),i);
  1177              DrawSprite(PosSprite, CursorPoint.X - (SpritesData[PosSprite].Width shr 1), cScreenHeight - CursorPoint.Y - (SpritesData[PosSprite].Height shr 1),i);