4 * |
4 * |
5 * This program is free software; you can redistribute it and/or modify |
5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License as published by |
6 * it under the terms of the GNU General Public License as published by |
7 * the Free Software Foundation; version 2 of the License |
7 * the Free Software Foundation; version 2 of the License |
8 * |
8 * |
9 * This program is distributed in the hope that it will be useful, |
9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. |
12 * GNU General Public License for more details. |
13 * |
13 * |
14 * You should have received a copy of the GNU General Public License |
14 * You should have received a copy of the GNU General Public License |
217 defaultPos, HatVisible: boolean; |
217 defaultPos, HatVisible: boolean; |
218 HH: PHedgehog; |
218 HH: PHedgehog; |
219 CurWeapon: PAmmo; |
219 CurWeapon: PAmmo; |
220 iceOffset:Longint; |
220 iceOffset:Longint; |
221 r:TSDL_Rect; |
221 r:TSDL_Rect; |
|
222 curhat: PTexture; |
222 begin |
223 begin |
223 HH:= Gear^.Hedgehog; |
224 HH:= Gear^.Hedgehog; |
224 if HH^.Unplaced then |
225 if HH^.Unplaced then |
225 exit; |
226 exit; |
|
227 if (HH^.CurAmmoType = amKnife) and (HH = CurrentHedgehog) then |
|
228 curhat:= ChefHatTexture |
|
229 else curhat:= HH^.HatTex; |
226 m:= 1; |
230 m:= 1; |
227 if ((Gear^.State and gstHHHJump) <> 0) and (not cArtillery) then |
231 if ((Gear^.State and gstHHHJump) <> 0) and (not cArtillery) then |
228 m:= -1; |
232 m:= -1; |
229 sx:= ox + 1; // this offset is very common |
233 sx:= ox + 1; // this offset is very common |
230 sy:= oy - 3; |
234 sy:= oy - 3; |
429 i, |
433 i, |
430 1, |
434 1, |
431 0, |
435 0, |
432 DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + dAngle); |
436 DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + dAngle); |
433 with HH^ do |
437 with HH^ do |
434 if (HatTex <> nil) then |
438 if (curhat <> nil) then |
435 begin |
439 begin |
436 DrawTextureRotatedF(HatTex, 1.0, -1.0, -6.0, ox, oy, 0, i, 32, 32, |
440 DrawTextureRotatedF(curhat, 1.0, -1.0, -6.0, ox, oy, 0, i, 32, 32, |
437 i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle); |
441 i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle); |
438 if HatTex^.w > 64 then |
442 if curhat^.w > 64 then |
439 begin |
443 begin |
440 Tint(HH^.Team^.Clan^.Color shl 8 or $FF); |
444 Tint(HH^.Team^.Clan^.Color shl 8 or $FF); |
441 DrawTextureRotatedF(HatTex, 1.0, -1.0, -6.0, ox, oy, 32, i, 32, 32, |
445 DrawTextureRotatedF(curhat, 1.0, -1.0, -6.0, ox, oy, 32, i, 32, 32, |
442 i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle); |
446 i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle); |
443 untint |
447 untint |
444 end |
448 end |
445 end |
449 end |
446 end; |
450 end; |
826 else |
830 else |
827 else |
831 else |
828 if HatVisibility > 0.0 then |
832 if HatVisibility > 0.0 then |
829 HatVisibility:= HatVisibility - 0.2; |
833 HatVisibility:= HatVisibility - 0.2; |
830 |
834 |
831 if (HatTex <> nil) |
835 if (curhat <> nil) |
832 and (HatVisibility > 0) then |
836 and (HatVisibility > 0) then |
833 if DefaultPos then |
837 if DefaultPos then |
834 begin |
838 begin |
835 DrawTextureF(HatTex, |
839 DrawTextureF(curhat, |
836 HatVisibility, |
840 HatVisibility, |
837 sx, |
841 sx, |
838 sy - 5, |
842 sy - 5, |
839 (RealTicks div 128 + Gear^.Pos) mod 19, |
843 (RealTicks div 128 + Gear^.Pos) mod 19, |
840 sign, |
844 sign, |
841 32, |
845 32, |
842 32); |
846 32); |
843 if HatTex^.w > 64 then |
847 if curhat^.w > 64 then |
844 begin |
848 begin |
845 Tint(HH^.Team^.Clan^.Color shl 8 or $FF); |
849 Tint(HH^.Team^.Clan^.Color shl 8 or $FF); |
846 DrawTextureF(HatTex, |
850 DrawTextureF(curhat, |
847 HatVisibility, |
851 HatVisibility, |
848 sx, |
852 sx, |
849 sy - 5, |
853 sy - 5, |
850 (RealTicks div 128 + Gear^.Pos) mod 19 + 32, |
854 (RealTicks div 128 + Gear^.Pos) mod 19 + 32, |
851 sign, |
855 sign, |