1299 else |
1301 else |
1300 DrawSpriteRotatedF(sprTargetP, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360) |
1302 DrawSpriteRotatedF(sprTargetP, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360) |
1301 end |
1303 end |
1302 end; |
1304 end; |
1303 {$WARNINGS ON} |
1305 {$WARNINGS ON} |
|
1306 |
|
1307 if WorldEdge <> weNone then |
|
1308 begin |
|
1309 (* I think for a bounded world, will fill the left and right areas with black or something. Also will probably want various border effects/animations based on border type. Prob also, say, trigger a border animation timer on an impact. *) |
|
1310 |
|
1311 FillChar(WorldFade, sizeof(WorldFade), 0); |
|
1312 WorldFade[0].a:= 255; |
|
1313 WorldFade[1].a:= 255; |
|
1314 FillChar(WorldEnd, sizeof(WorldEnd), 0); |
|
1315 WorldEnd[0].a:= 255; |
|
1316 WorldEnd[1].a:= 255; |
|
1317 WorldEnd[2].a:= 255; |
|
1318 WorldEnd[3].a:= 255; |
|
1319 |
|
1320 glDisable(GL_TEXTURE_2D); |
|
1321 glDisableClientState(GL_TEXTURE_COORD_ARRAY); |
|
1322 glEnableClientState(GL_COLOR_ARRAY); |
|
1323 |
|
1324 glPushMatrix; |
|
1325 glTranslatef(WorldDx, WorldDy, 0); |
|
1326 glColorPointer(4, GL_UNSIGNED_BYTE, 0, @WorldFade[0]); |
|
1327 |
|
1328 VertexBuffer[0].X:= leftX-20; |
|
1329 VertexBuffer[0].Y:= -3000; |
|
1330 VertexBuffer[1].X:= leftX-20; |
|
1331 VertexBuffer[1].Y:= cWaterLine+cVisibleWater; |
|
1332 VertexBuffer[2].X:= leftX+30; |
|
1333 VertexBuffer[2].Y:= cWaterLine+cVisibleWater; |
|
1334 VertexBuffer[3].X:= leftX+30; |
|
1335 VertexBuffer[3].Y:= -3000; |
|
1336 |
|
1337 glVertexPointer(2, GL_FLOAT, 0, @VertexBuffer[0]); |
|
1338 glDrawArrays(GL_TRIANGLE_FAN, 0, Length(VertexBuffer)); |
|
1339 |
|
1340 VertexBuffer[0].X:= rightX+20; |
|
1341 VertexBuffer[1].X:= rightX+20; |
|
1342 VertexBuffer[2].X:= rightX-30; |
|
1343 VertexBuffer[3].X:= rightX-30; |
|
1344 |
|
1345 glVertexPointer(2, GL_FLOAT, 0, @VertexBuffer[0]); |
|
1346 glDrawArrays(GL_TRIANGLE_FAN, 0, Length(VertexBuffer)); |
|
1347 |
|
1348 glColorPointer(4, GL_UNSIGNED_BYTE, 0, @WorldEnd[0]); |
|
1349 |
|
1350 VertexBuffer[0].X:= -5000; |
|
1351 VertexBuffer[1].X:= -5000; |
|
1352 VertexBuffer[2].X:= leftX-20; |
|
1353 VertexBuffer[3].X:= leftX-20; |
|
1354 |
|
1355 glVertexPointer(2, GL_FLOAT, 0, @VertexBuffer[0]); |
|
1356 glDrawArrays(GL_TRIANGLE_FAN, 0, Length(VertexBuffer)); |
|
1357 |
|
1358 VertexBuffer[0].X:= rightX+5000; |
|
1359 VertexBuffer[1].X:= rightX+5000; |
|
1360 VertexBuffer[2].X:= rightX+20; |
|
1361 VertexBuffer[3].X:= rightX+20; |
|
1362 |
|
1363 glVertexPointer(2, GL_FLOAT, 0, @VertexBuffer[0]); |
|
1364 glDrawArrays(GL_TRIANGLE_FAN, 0, Length(VertexBuffer)); |
|
1365 |
|
1366 glPopMatrix; |
|
1367 glDisableClientState(GL_COLOR_ARRAY); |
|
1368 glEnableClientState(GL_TEXTURE_COORD_ARRAY); |
|
1369 |
|
1370 glColor4ub($FF, $FF, $FF, $FF); // must not be Tint() as color array seems to stay active and color reset is required |
|
1371 glEnable(GL_TEXTURE_2D); |
|
1372 |
|
1373 DrawLine(leftX, -3000, leftX, cWaterLine+cVisibleWater, 3.0, $FF, $00, $FF, $FF); |
|
1374 DrawLine(rightX, -3000, rightX, cWaterLine+cVisibleWater, 3.0, $FF, $00, $FF, $FF); |
|
1375 end; |
1304 |
1376 |
1305 // this scale is used to keep the various widgets at the same dimension at all zoom levels |
1377 // this scale is used to keep the various widgets at the same dimension at all zoom levels |
1306 SetScale(cDefaultZoomLevel); |
1378 SetScale(cDefaultZoomLevel); |
1307 |
1379 |
1308 // Turn time |
1380 // Turn time |