225 |
226 |
226 DrawLand(WorldDx, WorldDy); |
227 DrawLand(WorldDx, WorldDy); |
227 // Water |
228 // Water |
228 r.y:= WorldDy + cWaterLine + 32; |
229 r.y:= WorldDy + cWaterLine + 32; |
229 if r.y < cScreenHeight then |
230 if r.y < cScreenHeight then |
230 begin |
231 begin |
231 if r.y < 0 then r.y:= 0; |
232 if r.y < 0 then r.y:= 0; |
232 |
233 |
233 glDisable(GL_TEXTURE_2D); |
234 glDisable(GL_TEXTURE_2D); |
234 glBegin(GL_QUADS); |
235 VertexBuffer[0].X:= 0; |
235 glColor3ub(WaterColor.r, WaterColor.g, WaterColor. b); // water color |
236 VertexBuffer[0].Y:= r.y; |
236 glVertex2i(0, r.y); |
237 VertexBuffer[1].X:= cScreenWidth; |
237 glVertex2i(cScreenWidth, r.y); |
238 VertexBuffer[1].Y:= r.y; |
238 glColor3ub(DeepWaterColor.r, DeepWaterColor.g, DeepWaterColor. b); // deep water color |
239 VertexBuffer[2].X:= cScreenWidth; |
239 glVertex2i(cScreenWidth, cScreenHeight); |
240 VertexBuffer[2].Y:= cScreenHeight; |
240 glVertex2i(0, cScreenHeight); |
241 VertexBuffer[3].X:= 0; |
241 glEnd(); |
242 VertexBuffer[3].Y:= cScreenHeight; |
242 glColor4f(1, 1, 1, 1); // disable coloring |
243 |
243 glEnable(GL_TEXTURE_2D) |
244 glEnableClientState (GL_COLOR_ARRAY); |
244 end; |
245 glColorPointer(3, GL_UNSIGNED_BYTE, 0, @WaterColorArray[0]); |
|
246 |
|
247 glEnableClientState(GL_VERTEX_ARRAY); |
|
248 glVertexPointer(2, GL_FLOAT, 0, @VertexBuffer[0]); |
|
249 |
|
250 glDrawArrays(GL_TRIANGLE_FAN, 0, Length(VertexBuffer)); |
|
251 |
|
252 glEnableClientState(GL_COLOR_ARRAY); |
|
253 glDisableClientState(GL_COLOR_ARRAY); |
|
254 |
|
255 glColor4f(1, 1, 1, 1); // disable coloring |
|
256 glEnable(GL_TEXTURE_2D) |
|
257 end; |
245 |
258 |
246 // Attack bar |
259 // Attack bar |
247 if CurrentTeam <> nil then |
260 if CurrentTeam <> nil then |
248 case AttackBar of |
261 case AttackBar of |
249 (* 1: begin |
262 (* 1: begin |