hedgewars/uGearsRender.pas
branchhedgeroid
changeset 5615 104f69e798bb
parent 5561 dfbe55237c64
child 5644 4ad07103cfae
equal deleted inserted replaced
5613:a7e40b20ce44 5615:104f69e798bb
   186 
   186 
   187 
   187 
   188 procedure DrawHH(Gear: PGear; ox, oy: LongInt);
   188 procedure DrawHH(Gear: PGear; ox, oy: LongInt);
   189 var i, t: LongInt;
   189 var i, t: LongInt;
   190     amt: TAmmoType;
   190     amt: TAmmoType;
   191     sign, hx, hy, cx, cy, tx, ty, sx, sy, m: LongInt;  // hedgehog, crosshair, temp, sprite, direction
   191     sign, hx, hy, tx, ty, sx, sy, m: LongInt;  // hedgehog, crosshair, temp, sprite, direction
   192     dx, dy, ax, ay, aAngle, dAngle, hAngle, lx, ly: real;  // laser, change
   192     dx, dy, ax, ay, aAngle, dAngle, hAngle, lx, ly: real;  // laser, change
   193     defaultPos, HatVisible: boolean;
   193     defaultPos, HatVisible: boolean;
   194     HH: PHedgehog;
   194     HH: PHedgehog;
   195     CurWeapon: PAmmo;
   195     CurWeapon: PAmmo;
   196 begin
   196 begin
   324                     begin
   324                     begin
   325                     DrawLine(hx, hy, tx, ty, 1.0, $FF, $00, $00, $C0);
   325                     DrawLine(hx, hy, tx, ty, 1.0, $FF, $00, $00, $C0);
   326                     end;
   326                     end;
   327                 end;
   327                 end;
   328             // draw crosshair
   328             // draw crosshair
   329             cx:= Round(hwRound(Gear^.X) + dx * 80 + GetLaunchX(HH^.CurAmmoType, sign * m, Gear^.Angle));
   329             CrosshairX := Round(hwRound(Gear^.X) + dx * 80 + GetLaunchX(HH^.CurAmmoType, sign * m, Gear^.Angle));
   330             cy:= Round(hwRound(Gear^.Y) + dy * 80 + GetLaunchY(HH^.CurAmmoType, Gear^.Angle));
   330             CrosshairY := Round(hwRound(Gear^.Y) + dy * 80 + GetLaunchY(HH^.CurAmmoType, Gear^.Angle));
       
   331  
       
   332             
   331             DrawRotatedTex(HH^.Team^.CrosshairTex,
   333             DrawRotatedTex(HH^.Team^.CrosshairTex,
   332                     12, 12, cx + WorldDx, cy + WorldDy, 0,
   334                     12, 12, CrosshairX + WorldDx, CrosshairY + WorldDy, 0,
   333                     sign * (Gear^.Angle * 180.0) / cMaxAngle);
   335                     sign * (Gear^.Angle * 180.0) / cMaxAngle);
   334             end;
   336             end;
   335         hx:= ox + 8 * sign;
   337         hx:= ox + 8 * sign;
   336         hy:= oy - 2;
   338         hy:= oy - 2;
   337         aangle:= Gear^.Angle * 180 / cMaxAngle - 90;
   339         aangle:= Gear^.Angle * 180 / cMaxAngle - 90;