19 {$INCLUDE "options.inc"} |
19 {$INCLUDE "options.inc"} |
20 |
20 |
21 unit uGearsRender; |
21 unit uGearsRender; |
22 |
22 |
23 interface |
23 interface |
24 uses uTypes, uConsts, GLunit, uFloat, SDLh; |
24 uses uTypes, uConsts, GLunit, uFloat, SDLh, uRandom; |
25 |
25 |
26 procedure RenderGear(Gear: PGear; x, y: LongInt); |
26 procedure RenderGear(Gear: PGear; x, y: LongInt); |
27 |
27 |
28 var RopePoints: record |
28 var RopePoints: record |
29 Count: Longword; |
29 Count: Longword; |
1013 i:= 0; |
1013 i:= 0; |
1014 i:= i mod 12; |
1014 i:= i mod 12; |
1015 DrawSprite(sprUtility, x - 24, y - 24, i); |
1015 DrawSprite(sprUtility, x - 24, y - 24, i); |
1016 end; |
1016 end; |
1017 end; |
1017 end; |
1018 if Gear^.Timer <= 1833 then |
1018 if Gear^.Timer < 1833 then |
1019 begin |
1019 begin |
1020 DrawTextureRotatedF(SpritesData[sprPortal].texture, min(abs(1.25 - (Gear^.Timer mod 1333) / 400), 1.25), 0, 0, |
1020 DrawTextureRotatedF(SpritesData[sprPortal].texture, min(abs(1.25 - (Gear^.Timer mod 1333) / 400), 1.25), 0, 0, |
1021 Gear^.Angle+WorldDx, Gear^.Power+WorldDy-16, 4+Gear^.Tag, 1, 32, 32, 270); |
1021 x, Gear^.Angle+WorldDy-16, 4+Gear^.Tag, 1, 32, 32, 270); |
1022 end |
1022 end |
1023 end; |
1023 end; |
1024 gtExplosives: begin |
1024 gtExplosives: begin |
1025 if ((Gear^.State and gstDrowning) <> 0) then |
1025 if ((Gear^.State and gstDrowning) <> 0) then |
1026 DrawSprite(sprExplosivesRoll, x - 24, y - 24, 0) |
1026 DrawSprite(sprExplosivesRoll, x - 24, y - 24, 0) |
1211 if Gear^.Target.X <> NoPointX then |
1211 if Gear^.Target.X <> NoPointX then |
1212 DrawLine(Gear^.Target.X, Gear^.Target.Y, hwRound(HHGear^.X), hwRound(HHGear^.Y), 4.0, i, i, $FF, $40) |
1212 DrawLine(Gear^.Target.X, Gear^.Target.Y, hwRound(HHGear^.X), hwRound(HHGear^.Y), 4.0, i, i, $FF, $40) |
1213 else DrawLine(hwRound(HHGear^.X), hwRound(HHGear^.Y), hwRound(Gear^.X), hwRound(Gear^.Y), 4.0, i, i, $FF, $40); |
1213 else DrawLine(hwRound(HHGear^.X), hwRound(HHGear^.Y), hwRound(Gear^.X), hwRound(Gear^.Y), 4.0, i, i, $FF, $40); |
1214 end |
1214 end |
1215 end |
1215 end |
1216 end |
1216 end; |
1217 |
1217 gtGenericFaller: DrawCircle(x, y, 3, 3, $FF, $00, $00, $FF); // debug |
1218 |
|
1219 end; |
1218 end; |
1220 if Gear^.RenderTimer and (Gear^.Tex <> nil) then |
1219 if Gear^.RenderTimer and (Gear^.Tex <> nil) then |
1221 DrawTextureCentered(x + 8, y + 8, Gear^.Tex); |
1220 DrawTextureCentered(x + 8, y + 8, Gear^.Tex); |
1222 end; |
1221 end; |
1223 |
1222 |