hedgewars/uGearsRender.pas
changeset 15200 0879fba70510
parent 15185 9231247b1f83
child 15201 fb2da6145595
equal deleted inserted replaced
15199:b0ed2b17c0cf 15200:0879fba70510
    37          end;
    37          end;
    38 procedure RenderGear(Gear: PGear; x, y: LongInt);
    38 procedure RenderGear(Gear: PGear; x, y: LongInt);
    39 procedure RenderGearTimer(Gear: PGear; x, y: LongInt);
    39 procedure RenderGearTimer(Gear: PGear; x, y: LongInt);
    40 procedure RenderGearHealth(Gear: PGear; x, y: LongInt);
    40 procedure RenderGearHealth(Gear: PGear; x, y: LongInt);
    41 procedure RenderHHGuiExtras(Gear: PGear; ox, oy: LongInt);
    41 procedure RenderHHGuiExtras(Gear: PGear; ox, oy: LongInt);
       
    42 procedure RenderAirMineGuiExtras(Gear: PGear; ox, oy: LongInt);
    42 procedure DrawHHOrder();
    43 procedure DrawHHOrder();
    43 
    44 
    44 var RopePoints: record
    45 var RopePoints: record
    45                 Count: Longword;
    46                 Count: Longword;
    46                 HookAngle: GLfloat;
    47                 HookAngle: GLfloat;
   311     if ((Gear^.State and gstHHDriven) <> 0) and (CurAmmoGear <> nil) then
   312     if ((Gear^.State and gstHHDriven) <> 0) and (CurAmmoGear <> nil) then
   312         begin
   313         begin
   313         case CurAmmoGear^.Kind of
   314         case CurAmmoGear^.Kind of
   314             gtJetpack:      begin
   315             gtJetpack:      begin
   315                             // render jetpack contour if underwater
   316                             // render jetpack contour if underwater
   316                             if (((not SuddenDeathDmg) and (WaterOpacity > 179)) or (SuddenDeathDmg and (SDWaterOpacity > 179))) and
   317                             if (((not SuddenDeathDmg) and (WaterOpacity > cGearContourThreshold)) or (SuddenDeathDmg and (SDWaterOpacity > cGearContourThreshold))) and
   317                                     ((cWaterLine < (hwRound(Gear^.Y) + Gear^.Radius - 16)) or
   318                                     ((cWaterLine < (hwRound(Gear^.Y) + Gear^.Radius - 16)) or
   318                                     ((WorldEdge = weSea) and ((hwRound(Gear^.X) < LeftX) or (hwRound(Gear^.X) > RightX)))) then
   319                                     ((WorldEdge = weSea) and ((hwRound(Gear^.X) < LeftX) or (hwRound(Gear^.X) > RightX)))) then
   319                                 DrawSprite(sprJetpack, sx-32, sy-32, 4);
   320                                 DrawSprite(sprJetpack, sx-32, sy-32, 4);
   320                             if CurAmmoGear^.Tex <> nil then
   321                             if CurAmmoGear^.Tex <> nil then
   321                                 DrawTextureCentered(sx, sy - 40, CurAmmoGear^.Tex);
   322                                 DrawTextureCentered(sx, sy - 40, CurAmmoGear^.Tex);
   333         end
   334         end
   334     else if ((Gear^.State and gstHHDriven) <> 0) then
   335     else if ((Gear^.State and gstHHDriven) <> 0) then
   335         begin
   336         begin
   336         DrawSelectedWeapon(Gear, sx, sy, false);
   337         DrawSelectedWeapon(Gear, sx, sy, false);
   337         end
   338         end
       
   339 end;
       
   340 
       
   341 procedure RenderAirMineGuiExtras(Gear: PGear; ox, oy: LongInt);
       
   342 begin
       
   343 // render air mine contour, if underwater
       
   344     if (((not SuddenDeathDmg) and (WaterOpacity > cGearContourThreshold)) or (SuddenDeathDmg and (SDWaterOpacity > cGearContourThreshold))) and
       
   345         ((cWaterLine < (hwRound(Gear^.Y) + Gear^.Radius + 16)) or
       
   346         ((WorldEdge = weSea) and ((hwRound(Gear^.X) < LeftX + 24) or (hwRound(Gear^.X) > RightX - 24)))) then
       
   347         DrawSprite(sprAirMine, ox-16, oy-16, 32);
   338 end;
   348 end;
   339 
   349 
   340 procedure DrawHH(Gear: PGear; ox, oy: LongInt);
   350 procedure DrawHH(Gear: PGear; ox, oy: LongInt);
   341 var i, t: LongInt;
   351 var i, t: LongInt;
   342     amt: TAmmoType;
   352     amt: TAmmoType;