286 if AMxShift = 0 then DrawSprite(sprArrow, CursorPoint.X, cScreenHeight - CursorPoint.Y, (RealTicks shr 6) mod 8) |
286 if AMxShift = 0 then DrawSprite(sprArrow, CursorPoint.X, cScreenHeight - CursorPoint.Y, (RealTicks shr 6) mod 8) |
287 end; |
287 end; |
288 |
288 |
289 procedure MoveCamera; forward; |
289 procedure MoveCamera; forward; |
290 |
290 |
291 procedure DrawWater(Alpha: byte); |
291 procedure DrawWater(Alpha: byte; OffsetY: LongInt); |
292 var VertexBuffer: array [0..3] of TVertex2f; |
292 var VertexBuffer: array [0..3] of TVertex2f; |
293 r: TSDL_Rect; |
293 r: TSDL_Rect; |
294 lw, lh: GLfloat; |
294 lw, lh: GLfloat; |
295 begin |
295 begin |
296 WaterColorArray[0].a := Alpha; |
296 WaterColorArray[0].a := Alpha; |
299 WaterColorArray[3].a := Alpha; |
299 WaterColorArray[3].a := Alpha; |
300 |
300 |
301 lw:= cScreenWidth / cScaleFactor; |
301 lw:= cScreenWidth / cScaleFactor; |
302 lh:= trunc(cScreenHeight / cScaleFactor) + cScreenHeight div 2 + 16; |
302 lh:= trunc(cScreenHeight / cScaleFactor) + cScreenHeight div 2 + 16; |
303 // Water |
303 // Water |
304 r.y:= WorldDy + cWaterLine; |
304 r.y:= OffsetY + WorldDy + cWaterLine; |
305 if WorldDy < trunc(cScreenHeight / cScaleFactor) + cScreenHeight div 2 - cWaterLine then |
305 if WorldDy < trunc(cScreenHeight / cScaleFactor) + cScreenHeight div 2 - cWaterLine then |
306 begin |
306 begin |
307 if r.y < 0 then r.y:= 0; |
307 if r.y < 0 then r.y:= 0; |
308 |
308 |
309 glDisable(GL_TEXTURE_2D); |
309 glDisable(GL_TEXTURE_2D); |
466 DrawVisualGears(0); |
466 DrawVisualGears(0); |
467 end; |
467 end; |
468 |
468 |
469 // Waves |
469 // Waves |
470 offsetY:= 10 * min(0, -145 - screenBottom); |
470 offsetY:= 10 * min(0, -145 - screenBottom); |
471 DrawWaves( 1, 0 + WorldDx div 32, - cWaveHeight + offsetY div 35, 0.25); |
471 DrawWater(255, offsetY div 35); |
|
472 DrawWaves( 1, 0 - WorldDx div 32, - cWaveHeight + offsetY div 35, 0.25); |
472 DrawWaves( -1, 25 + WorldDx div 25, - cWaveHeight + offsetY div 38, 0.19); |
473 DrawWaves( -1, 25 + WorldDx div 25, - cWaveHeight + offsetY div 38, 0.19); |
473 DrawWaves( 1, 75 + WorldDx div 19, - cWaveHeight + offsetY div 45, 0.14); |
474 DrawWaves( 1, 75 - WorldDx div 19, - cWaveHeight + offsetY div 45, 0.14); |
474 DrawWaves(-1, 100 + WorldDx div 14, - cWaveHeight + offsetY div 70, 0.09); |
475 DrawWaves(-1, 100 + WorldDx div 14, - cWaveHeight + offsetY div 70, 0.09); |
475 |
476 |
476 |
477 |
477 DrawLand(WorldDx, WorldDy); |
478 DrawLand(WorldDx, WorldDy); |
478 |
479 |
479 DrawWater(255); |
480 DrawWater(255, 0); |
480 |
481 |
481 // Attack bar |
482 // Attack bar |
482 if CurrentTeam <> nil then |
483 if CurrentTeam <> nil then |
483 case AttackBar of |
484 case AttackBar of |
484 (* 1: begin |
485 (* 1: begin |
504 |
505 |
505 DrawGears; |
506 DrawGears; |
506 |
507 |
507 DrawVisualGears(2); |
508 DrawVisualGears(2); |
508 |
509 |
509 DrawWater(cWaterOpacity); |
510 DrawWater(cWaterOpacity, 0); |
510 |
511 |
511 // Waves |
512 // Waves |
512 DrawWaves( 1, 25 + WorldDx div 9, - cWaveHeight, 0.05); |
513 DrawWaves( 1, 25 - WorldDx div 9, - cWaveHeight, 0.05); |
513 DrawWaves(-1, 50 + WorldDx div 6, 1 - cWaveHeight - offsetY div 40, 0.03); |
514 //DrawWater(cWaterOpacity, - offsetY div 40); |
514 DrawWaves( 1, 75 + WorldDx div 4, 3- cWaveHeight - offsetY div 20, 0.01); |
515 DrawWaves(-1, 50 + WorldDx div 6, - cWaveHeight - offsetY div 40, 0.03); |
515 DrawWaves( -1, 25 + WorldDx div 3, 5 - cWaveHeight - offsetY div 10, 0); |
516 DrawWater(cWaterOpacity, - offsetY div 20); |
|
517 DrawWaves( 1, 75 - WorldDx div 4, - cWaveHeight - offsetY div 20, 0.01); |
|
518 DrawWater(cWaterOpacity, - offsetY div 10); |
|
519 DrawWaves( -1, 25 + WorldDx div 3, - cWaveHeight - offsetY div 10, 0); |
516 |
520 |
517 |
521 |
518 {$WARNINGS OFF} |
522 {$WARNINGS OFF} |
519 // Target |
523 // Target |
520 if TargetPoint.X <> NoPointX then |
524 if (TargetPoint.X <> NoPointX) and (CurrentTeam <> nil) and (CurrentHedgehog <> nil) then |
521 DrawRotatedF(sprTargetP, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360); |
525 begin |
|
526 with PHedgehog(CurrentHedgehog)^ do |
|
527 begin |
|
528 if (Ammo^[CurSlot, CurAmmo].AmmoType = amBee) then |
|
529 DrawRotatedF(sprTargetBee, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360) |
|
530 else |
|
531 DrawRotatedF(sprTargetP, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360); |
|
532 end; |
|
533 end; |
522 {$WARNINGS ON} |
534 {$WARNINGS ON} |
523 |
535 |
524 {$IFDEF IPHONEOS} |
536 {$IFDEF IPHONEOS} |
525 scale:= 1.5; |
537 scale:= 1.5; |
526 {$ELSE} |
538 {$ELSE} |