72 //glDisable(GL_LINE_SMOOTH) |
72 //glDisable(GL_LINE_SMOOTH) |
73 end |
73 end |
74 end; |
74 end; |
75 |
75 |
76 |
76 |
77 procedure DrawRopeLine(X1, Y1, X2, Y2, roplen: LongInt); |
77 function DrawRopeLine(X1, Y1, X2, Y2, roplen: LongInt): LongInt; |
78 var eX, eY, dX, dY: LongInt; |
78 var eX, eY, dX, dY: LongInt; |
79 i, sX, sY, x, y, d: LongInt; |
79 i, sX, sY, x, y, d: LongInt; |
80 b: boolean; |
80 b: boolean; |
81 begin |
81 begin |
82 if (X1 = X2) and (Y1 = Y2) then |
82 if (X1 = X2) and (Y1 = Y2) then |
150 if RopePoints.Count > 0 then |
151 if RopePoints.Count > 0 then |
151 begin |
152 begin |
152 i:= 0; |
153 i:= 0; |
153 while i < Pred(RopePoints.Count) do |
154 while i < Pred(RopePoints.Count) do |
154 begin |
155 begin |
155 DrawRopeLine(hwRound(RopePoints.ar[i].X) + WorldDx, hwRound(RopePoints.ar[i].Y) + WorldDy, |
156 roplen:= DrawRopeLine(hwRound(RopePoints.ar[i].X) + WorldDx, hwRound(RopePoints.ar[i].Y) + WorldDy, |
156 hwRound(RopePoints.ar[Succ(i)].X) + WorldDx, hwRound(RopePoints.ar[Succ(i)].Y) + WorldDy, roplen); |
157 hwRound(RopePoints.ar[Succ(i)].X) + WorldDx, hwRound(RopePoints.ar[Succ(i)].Y) + WorldDy, roplen); |
157 inc(i) |
158 inc(i) |
158 end; |
159 end; |
159 DrawRopeLine(hwRound(RopePoints.ar[i].X) + WorldDx, hwRound(RopePoints.ar[i].Y) + WorldDy, |
160 roplen:= DrawRopeLine(hwRound(RopePoints.ar[i].X) + WorldDx, hwRound(RopePoints.ar[i].Y) + WorldDy, |
160 hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, roplen); |
161 hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, roplen); |
161 DrawRopeLine(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, |
162 roplen:= DrawRopeLine(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, |
162 hwRound(Gear^.Hedgehog^.Gear^.X) + WorldDx, hwRound(Gear^.Hedgehog^.Gear^.Y) + WorldDy, roplen); |
163 hwRound(Gear^.Hedgehog^.Gear^.X) + WorldDx, hwRound(Gear^.Hedgehog^.Gear^.Y) + WorldDy, roplen); |
163 end else |
164 end else |
164 if Gear^.Elasticity.QWordValue > 0 then |
165 if Gear^.Elasticity.QWordValue > 0 then |
165 DrawRopeLine(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, |
166 roplen:= DrawRopeLine(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, |
166 hwRound(Gear^.Hedgehog^.Gear^.X) + WorldDx, hwRound(Gear^.Hedgehog^.Gear^.Y) + WorldDy, roplen); |
167 hwRound(Gear^.Hedgehog^.Gear^.X) + WorldDx, hwRound(Gear^.Hedgehog^.Gear^.Y) + WorldDy, roplen); |
167 end; |
168 end; |
168 |
169 |
169 |
170 |
170 if RopePoints.Count > 0 then |
171 if RopePoints.Count > 0 then |