75 tmpSurface: PSDL_Surface; |
75 tmpSurface: PSDL_Surface; |
76 fpsTexture: PTexture; |
76 fpsTexture: PTexture; |
77 timeTexture: PTexture; |
77 timeTexture: PTexture; |
78 FPS: Longword; |
78 FPS: Longword; |
79 CountTicks: Longword; |
79 CountTicks: Longword; |
80 SoundTimerTicks: Longword; |
80 prevPoint{, prevTargetPoint}: TPoint; |
81 prevPoint, prevTargetPoint: TPoint; |
|
82 amSel: TAmmoType = amNothing; |
81 amSel: TAmmoType = amNothing; |
83 missionTex: PTexture; |
82 missionTex: PTexture; |
84 missionTimer: LongInt; |
83 missionTimer: LongInt; |
85 stereoDepth: GLfloat; |
84 stereoDepth: GLfloat; |
86 isFirstFrame: boolean; |
85 isFirstFrame: boolean; |
223 |
222 |
224 InitCameraBorders(); |
223 InitCameraBorders(); |
225 uCursor.init(); |
224 uCursor.init(); |
226 prevPoint.X:= 0; |
225 prevPoint.X:= 0; |
227 prevPoint.Y:= cScreenHeight div 2; |
226 prevPoint.Y:= cScreenHeight div 2; |
228 prevTargetPoint.X:= 0; |
227 //prevTargetPoint.X:= 0; |
229 prevTargetPoint.Y:= 0; |
228 //prevTargetPoint.Y:= 0; |
230 WorldDx:= -(LAND_WIDTH div 2) + cScreenWidth div 2; |
229 WorldDx:= -(LAND_WIDTH div 2) + cScreenWidth div 2; |
231 WorldDy:= -(LAND_HEIGHT - (playHeight div 2)) + (cScreenHeight div 2); |
230 WorldDy:= -(LAND_HEIGHT - (playHeight div 2)) + (cScreenHeight div 2); |
232 |
231 |
233 //aligns it to the bottom of the screen, minus the border |
232 //aligns it to the bottom of the screen, minus the border |
234 SkyOffset:= 0; |
233 SkyOffset:= 0; |
644 else |
643 else |
645 begin |
644 begin |
646 AMShiftX:= AMShiftTargetX; |
645 AMShiftX:= AMShiftTargetX; |
647 AMShiftY:= AMShiftTargetY; |
646 AMShiftY:= AMShiftTargetY; |
648 prevPoint:= CursorPoint; |
647 prevPoint:= CursorPoint; |
649 prevTargetPoint:= TargetCursorPoint; |
648 //prevTargetPoint:= TargetCursorPoint; |
650 AMState:= AMHidden; |
649 AMState:= AMHidden; |
651 end; |
650 end; |
652 end; |
651 end; |
653 |
652 |
654 DrawTexture(AmmoRect.x + AMShiftX, AmmoRect.y + AMShiftY, AmmoMenuTex); |
653 DrawTexture(AmmoRect.x + AMShiftX, AmmoRect.y + AMShiftY, AmmoMenuTex); |
1580 SDL_FreeSurface(tmpSurface) |
1579 SDL_FreeSurface(tmpSurface) |
1581 end; |
1580 end; |
1582 if fpsTexture <> nil then |
1581 if fpsTexture <> nil then |
1583 DrawTexture((cScreenWidth shr 1) - 60 - offsetY, offsetX, fpsTexture); |
1582 DrawTexture((cScreenWidth shr 1) - 60 - offsetY, offsetX, fpsTexture); |
1584 end; |
1583 end; |
1585 |
1584 end; |
1586 // lag warning (?) |
1585 |
1587 inc(SoundTimerTicks, Lag); |
|
1588 end; |
|
1589 |
|
1590 if SoundTimerTicks >= 50 then |
|
1591 begin |
|
1592 SoundTimerTicks:= 0; |
|
1593 if cVolumeDelta <> 0 then |
|
1594 begin |
|
1595 str(ChangeVolume(cVolumeDelta), s); |
|
1596 AddCaption(Format(trmsg[sidVolume], s), cWhiteColor, capgrpVolume); |
|
1597 end; |
|
1598 if isAudioMuted then |
|
1599 AddCaption(trmsg[sidMute], cWhiteColor, capgrpVolume) |
|
1600 end; |
|
1601 |
1586 |
1602 if GameState = gsConfirm then |
1587 if GameState = gsConfirm then |
1603 DrawTextureCentered(0, (cScreenHeight shr 1), ConfirmTexture); |
1588 DrawTextureCentered(0, (cScreenHeight shr 1)-40, ConfirmTexture); |
1604 |
1589 |
1605 if ScreenFade <> sfNone then |
1590 if ScreenFade <> sfNone then |
1606 begin |
1591 begin |
1607 if (not isFirstFrame) then |
1592 if (not isFirstFrame) then |
1608 case ScreenFade of |
1593 case ScreenFade of |