1221 ScreenBottom:= (WorldDy - trunc(cScreenHeight/cScaleFactor) - (cScreenHeight div 2) + cWaterLine); |
1221 ScreenBottom:= (WorldDy - trunc(cScreenHeight/cScaleFactor) - (cScreenHeight div 2) + cWaterLine); |
1222 |
1222 |
1223 // note: offsetY is negative! |
1223 // note: offsetY is negative! |
1224 offsetY:= 10 * Min(0, -145 - ScreenBottom); // TODO limit this in the other direction too |
1224 offsetY:= 10 * Min(0, -145 - ScreenBottom); // TODO limit this in the other direction too |
1225 |
1225 |
|
1226 // Sky and horizont |
1226 if (cReducedQuality and rqNoBackground) = 0 then |
1227 if (cReducedQuality and rqNoBackground) = 0 then |
1227 begin |
1228 begin |
1228 // Offsets relative to camera - spare them to wimpier cpus, no bg or flakes for them anyway |
1229 // Offsets relative to camera - spare them to wimpier cpus, no bg or flakes for them anyway |
1229 SkyOffset:= offsetY div 35 + cWaveHeight; |
1230 SkyOffset:= offsetY div 35 + cWaveHeight; |
1230 HorizontOffset:= SkyOffset; |
1231 HorizontOffset:= SkyOffset; |
1313 if SuddenDeathDmg then |
1314 if SuddenDeathDmg then |
1314 DrawWater(SDWaterOpacity, 0, 0) |
1315 DrawWater(SDWaterOpacity, 0, 0) |
1315 else |
1316 else |
1316 DrawWater(WaterOpacity, 0, 0); |
1317 DrawWater(WaterOpacity, 0, 0); |
1317 |
1318 |
1318 // Waves |
1319 // Waves |
1319 ChangeDepth(RM, cStereo_Water_near); |
1320 ChangeDepth(RM, cStereo_Water_near); |
1320 DrawWaves( 1, 25 - WorldDx div 9, 0, 0, 12); |
1321 DrawWaves( 1, 25 - WorldDx div 9, 0, 0, 12); |
1321 |
1322 |
1322 if (cReducedQuality and rq2DWater) = 0 then |
1323 if (cReducedQuality and rq2DWater) = 0 then |
1323 begin |
1324 begin |
1324 //DrawWater(WaterOpacity, - offsetY div 40); |
|
1325 ChangeDepth(RM, cStereo_Water_near); |
1325 ChangeDepth(RM, cStereo_Water_near); |
1326 DrawWaves(-1, 50 + WorldDx div 6, - offsetY div 40, 23, 8); |
1326 DrawWaves(-1, 50 + WorldDx div 6, - offsetY div 40, 23, 8); |
1327 if SuddenDeathDmg then |
1327 if SuddenDeathDmg then |
1328 DrawWater(SDWaterOpacity, - offsetY div 20, 23) |
1328 DrawWater(SDWaterOpacity, - offsetY div 20, 23) |
1329 else |
1329 else |
1394 UnshiftWorld(); |
1394 UnshiftWorld(); |
1395 end; |
1395 end; |
1396 |
1396 |
1397 DrawVisualGears(3, false); |
1397 DrawVisualGears(3, false); |
1398 |
1398 |
1399 // Target |
1399 // Target (e.g. air attack, bee, ...) |
1400 if (TargetPoint.X <> NoPointX) and (CurrentTeam <> nil) and (CurrentHedgehog <> nil) then |
1400 if (TargetPoint.X <> NoPointX) and (CurrentTeam <> nil) and (CurrentHedgehog <> nil) then |
1401 begin |
1401 begin |
1402 with PHedgehog(CurrentHedgehog)^ do |
1402 with PHedgehog(CurrentHedgehog)^ do |
1403 begin |
1403 begin |
1404 if CurAmmoType = amBee then |
1404 if CurAmmoType = amBee then |
1438 UnshiftWorld(); |
1438 UnshiftWorld(); |
1439 end; |
1439 end; |
1440 |
1440 |
1441 RenderAttackBar(); |
1441 RenderAttackBar(); |
1442 |
1442 |
|
1443 // World edge |
1443 RenderWorldEdge(); |
1444 RenderWorldEdge(); |
1444 |
1445 |
1445 // this scale is used to keep the various widgets at the same dimension at all zoom levels |
1446 // This scale is used to keep the various widgets at the same dimension at all zoom levels |
1446 SetScale(cDefaultZoomLevel); |
1447 SetScale(cDefaultZoomLevel); |
1447 |
1448 |
1448 // cinematic effects |
1449 // Cinematic Mode: Effects |
1449 if CinematicScript or (InCinematicMode and autoCameraOn |
1450 if CinematicScript or (InCinematicMode and autoCameraOn |
1450 and ((CurrentHedgehog = nil) or CurrentHedgehog^.Team^.ExtDriven |
1451 and ((CurrentHedgehog = nil) or CurrentHedgehog^.Team^.ExtDriven |
1451 or (CurrentHedgehog^.BotLevel <> 0) or (GameType = gmtDemo))) then |
1452 or (CurrentHedgehog^.BotLevel <> 0) or (GameType = gmtDemo))) then |
1452 begin |
1453 begin |
1453 if CinematicSteps < 300 then |
1454 if CinematicSteps < 300 then |
1626 |
1628 |
1627 // Chat |
1629 // Chat |
1628 DrawChat; |
1630 DrawChat; |
1629 |
1631 |
1630 |
1632 |
1631 // various captions |
1633 // Centered status/menu messages (synchronizing, auto skip, pause, etc.) |
1632 if fastUntilLag then |
1634 if fastUntilLag then |
1633 DrawTextureCentered(0, (cScreenHeight shr 1), SyncTexture) |
1635 DrawTextureCentered(0, (cScreenHeight shr 1), SyncTexture) |
1634 else if isAFK then |
1636 else if isAFK then |
1635 DrawTextureCentered(0, (cScreenHeight shr 1), AFKTexture) |
1637 DrawTextureCentered(0, (cScreenHeight shr 1), AFKTexture) |
1636 else if isPaused then |
1638 else if isPaused then |
1637 DrawTextureCentered(0, (cScreenHeight shr 1), PauseTexture); |
1639 DrawTextureCentered(0, (cScreenHeight shr 1), PauseTexture); |
|
1640 |
|
1641 // Mission panel |
1638 if not isFirstFrame and (missionTimer <> 0) or isShowMission or isPaused or fastUntilLag or (GameState = gsConfirm) then |
1642 if not isFirstFrame and (missionTimer <> 0) or isShowMission or isPaused or fastUntilLag or (GameState = gsConfirm) then |
1639 begin |
1643 begin |
1640 if (ReadyTimeLeft = 0) and (missionTimer > 0) then |
1644 if (ReadyTimeLeft = 0) and (missionTimer > 0) then |
1641 dec(missionTimer, Lag); |
1645 dec(missionTimer, Lag); |
1642 if missionTimer < 0 then |
1646 if missionTimer < 0 then |
1645 DrawTextureCentered(0, Min((cScreenHeight shr 1) + 100, cScreenHeight - 48 - missionTex^.h), missionTex); |
1649 DrawTextureCentered(0, Min((cScreenHeight shr 1) + 100, cScreenHeight - 48 - missionTex^.h), missionTex); |
1646 end; |
1650 end; |
1647 if missionTimer = 0 then |
1651 if missionTimer = 0 then |
1648 isForceMission := false; |
1652 isForceMission := false; |
1649 |
1653 |
1650 // fps |
1654 // FPS and demo replay time |
1651 {$IFDEF USE_TOUCH_INTERFACE} |
1655 {$IFDEF USE_TOUCH_INTERFACE} |
1652 offsetX:= pauseButton.frame.y + pauseButton.frame.h + 12; |
1656 offsetX:= pauseButton.frame.y + pauseButton.frame.h + 12; |
1653 {$ELSE} |
1657 {$ELSE} |
1654 offsetX:= 10; |
1658 offsetX:= 10; |
1655 {$ENDIF} |
1659 {$ENDIF} |
1702 if fpsTexture <> nil then |
1709 if fpsTexture <> nil then |
1703 DrawTexture((cScreenWidth shr 1) - 60 - offsetY, offsetX, fpsTexture); |
1710 DrawTexture((cScreenWidth shr 1) - 60 - offsetY, offsetX, fpsTexture); |
1704 end; |
1711 end; |
1705 end; |
1712 end; |
1706 |
1713 |
1707 |
1714 // Quit Y/N question |
1708 if GameState = gsConfirm then |
1715 if GameState = gsConfirm then |
1709 DrawTextureCentered(0, (cScreenHeight shr 1)-40, ConfirmTexture); |
1716 DrawTextureCentered(0, (cScreenHeight shr 1)-40, ConfirmTexture); |
1710 |
1717 |
1711 if ScreenFade <> sfNone then |
1718 if ScreenFade <> sfNone then |
1712 begin |
1719 begin |
1751 recTexture:= Surface2Tex(tmpSurface, false); |
1758 recTexture:= Surface2Tex(tmpSurface, false); |
1752 SDL_FreeSurface(tmpSurface) |
1759 SDL_FreeSurface(tmpSurface) |
1753 end; |
1760 end; |
1754 DrawTexture( -(cScreenWidth shr 1) + 50, 20, recTexture); |
1761 DrawTexture( -(cScreenWidth shr 1) + 50, 20, recTexture); |
1755 |
1762 |
1756 //a:= Byte(Round(127*(1 + sin(RealTicks*0.007)))); |
|
1757 a:= Byte(min(255, abs(-255 + ((RealTicks div 2) and 511)))); |
1763 a:= Byte(min(255, abs(-255 + ((RealTicks div 2) and 511)))); |
1758 |
1764 |
1759 // draw red circle |
1765 // draw red circle |
1760 DrawCircleFilled(-(cScreenWidth shr 1) + 30, 35, 10, $FF, $00, $00, a); |
1766 DrawCircleFilled(-(cScreenWidth shr 1) + 30, 35, 10, $FF, $00, $00, a); |
1761 end; |
1767 end; |
1786 end; |
1792 end; |
1787 DrawSprite(PosSprite, TargetCursorPoint.X - (SpritesData[PosSprite].Width shr 1), cScreenHeight - TargetCursorPoint.Y - (SpritesData[PosSprite].Height shr 1),i); |
1793 DrawSprite(PosSprite, TargetCursorPoint.X - (SpritesData[PosSprite].Width shr 1), cScreenHeight - TargetCursorPoint.Y - (SpritesData[PosSprite].Height shr 1),i); |
1788 Untint(); |
1794 Untint(); |
1789 end; |
1795 end; |
1790 end; |
1796 end; |
1791 //DrawSprite(sprArrow, TargetCursorPoint.X, cScreenHeight - TargetCursorPoint.Y, (RealTicks shr 6) mod 8) |
|
1792 DrawTextureF(SpritesData[sprArrow].Texture, cDefaultZoomLevel / cScaleFactor, TargetCursorPoint.X + round(SpritesData[sprArrow].Width / cScaleFactor), cScreenHeight + round(SpritesData[sprArrow].Height / cScaleFactor) - TargetCursorPoint.Y, (RealTicks shr 6) mod 8, 1, SpritesData[sprArrow].Width, SpritesData[sprArrow].Height); |
1797 DrawTextureF(SpritesData[sprArrow].Texture, cDefaultZoomLevel / cScaleFactor, TargetCursorPoint.X + round(SpritesData[sprArrow].Width / cScaleFactor), cScreenHeight + round(SpritesData[sprArrow].Height / cScaleFactor) - TargetCursorPoint.Y, (RealTicks shr 6) mod 8, 1, SpritesData[sprArrow].Width, SpritesData[sprArrow].Height); |
1793 end; |
1798 end; |
1794 |
1799 |
1795 // debug stuff |
1800 // debug stuff |
1796 if cViewLimitsDebug then |
1801 if cViewLimitsDebug then |