51 |
51 |
52 implementation |
52 implementation |
53 uses uRender, uUtils, uVariables, uAmmos, Math, uVisualGearsList; |
53 uses uRender, uUtils, uVariables, uAmmos, Math, uVisualGearsList; |
54 |
54 |
55 procedure DrawRopeLinesRQ(Gear: PGear); |
55 procedure DrawRopeLinesRQ(Gear: PGear); |
|
56 var n: LongInt; |
56 begin |
57 begin |
57 with RopePoints do |
58 with RopePoints do |
58 begin |
59 begin |
59 rounded[Count].X:= hwRound(Gear^.X); |
60 rounded[Count].X:= hwRound(Gear^.X); |
60 rounded[Count].Y:= hwRound(Gear^.Y); |
61 rounded[Count].Y:= hwRound(Gear^.Y); |
62 rounded[Count + 1].Y:= hwRound(Gear^.Hedgehog^.Gear^.Y); |
63 rounded[Count + 1].Y:= hwRound(Gear^.Hedgehog^.Gear^.Y); |
63 end; |
64 end; |
64 |
65 |
65 if (RopePoints.Count > 0) or (Gear^.Elasticity.QWordValue > 0) then |
66 if (RopePoints.Count > 0) or (Gear^.Elasticity.QWordValue > 0) then |
66 begin |
67 begin |
67 glDisable(GL_TEXTURE_2D); |
68 EnableTexture(false); |
68 //glEnable(GL_LINE_SMOOTH); |
69 //glEnable(GL_LINE_SMOOTH); |
69 |
70 |
70 glPushMatrix; |
71 Tint($70, $70, $70, $FF); |
71 |
72 |
72 glTranslatef(WorldDx, WorldDy, 0); |
73 n:= RopePoints.Count + 2; |
73 |
74 |
|
75 SetVertexPointer(@RopePoints.rounded[0], n); |
|
76 |
|
77 openglPushMatrix(); |
|
78 openglTranslatef(WorldDx, WorldDy, 0); |
|
79 |
|
80 glLineWidth(3.0 * cScaleFactor); |
|
81 glDrawArrays(GL_LINE_STRIP, 0, n); |
|
82 Tint($D8, $D8, $D8, $FF); |
74 glLineWidth(2.0 * cScaleFactor); |
83 glLineWidth(2.0 * cScaleFactor); |
75 |
84 glDrawArrays(GL_LINE_STRIP, 0, n); |
76 Tint($C0, $C0, $C0, $FF); |
85 |
77 |
|
78 glVertexPointer(2, GL_FLOAT, 0, @RopePoints.rounded[0]); |
|
79 glDrawArrays(GL_LINE_STRIP, 0, RopePoints.Count + 2); |
|
80 untint; |
86 untint; |
81 |
87 |
82 glPopMatrix; |
88 openglPopMatrix(); |
83 |
89 |
84 glEnable(GL_TEXTURE_2D); |
90 EnableTexture(true); |
85 //glDisable(GL_LINE_SMOOTH) |
91 //glDisable(GL_LINE_SMOOTH) |
86 end |
92 end |
87 end; |
93 end; |
88 |
94 |
89 |
95 |