hedgewars/uWorld.pas
changeset 3638 33ee433749ba
parent 3629 86212d2b116a
child 3641 98319a621dc8
equal deleted inserted replaced
3637:0db298524c3d 3638:33ee433749ba
    46 procedure DrawWorld(Lag: LongInt);
    46 procedure DrawWorld(Lag: LongInt);
    47 procedure AddCaption(s: shortstring; Color: Longword; Group: TCapGroup);
    47 procedure AddCaption(s: shortstring; Color: Longword; Group: TCapGroup);
    48 procedure ShowMission(caption, subcaption, text: ansistring; icon, time : LongInt);
    48 procedure ShowMission(caption, subcaption, text: ansistring; icon, time : LongInt);
    49 procedure HideMission;
    49 procedure HideMission;
    50 procedure ShakeCamera(amount: LongWord);
    50 procedure ShakeCamera(amount: LongWord);
       
    51 procedure MoveCamera;
    51 
    52 
    52 implementation
    53 implementation
    53 uses    uStore, uMisc, uTeams, uIO, uKeys, uLocale, uSound, uAmmos, uVisualGears, uChat, uLandTexture, uLand, GLunit;
    54 uses    uStore, uMisc, uTeams, uIO, uKeys, uLocale, uSound, uAmmos, uVisualGears, uChat, uLandTexture, uLand, GLunit;
    54 
    55 
    55 type TCaptionStr = record
    56 type TCaptionStr = record
   388 
   389 
   389 bSelected:= false;
   390 bSelected:= false;
   390 if AMxShift = 0 then DrawSprite(sprArrow, CursorPoint.X, cScreenHeight - CursorPoint.Y, (RealTicks shr 6) mod 8)
   391 if AMxShift = 0 then DrawSprite(sprArrow, CursorPoint.X, cScreenHeight - CursorPoint.Y, (RealTicks shr 6) mod 8)
   391 end;
   392 end;
   392 
   393 
   393 procedure MoveCamera; forward;
       
   394 
       
   395 procedure DrawWater(Alpha: byte; OffsetY: LongInt);
   394 procedure DrawWater(Alpha: byte; OffsetY: LongInt);
   396 var VertexBuffer: array [0..3] of TVertex2f;
   395 var VertexBuffer: array [0..3] of TVertex2f;
   397     r: TSDL_Rect;
   396     r: TSDL_Rect;
   398     lw, lh: GLfloat;
   397     lw, lh: GLfloat;
   399 begin
   398 begin
  1010         Captions[Group].EndTime:= RealTicks + 1400 + LongWord(Captions[Group].Tex^.w) * 3;
  1009         Captions[Group].EndTime:= RealTicks + 1400 + LongWord(Captions[Group].Tex^.w) * 3;
  1011     end;
  1010     end;
  1012 end;
  1011 end;
  1013 
  1012 
  1014 procedure MoveCamera;
  1013 procedure MoveCamera;
  1015 const PrevSentPointTime: LongWord = 0;
       
  1016 var EdgesDist,  wdy: LongInt;
  1014 var EdgesDist,  wdy: LongInt;
       
  1015     PrevSentPointTime: LongWord = 0;
  1017 begin
  1016 begin
  1018 {$IFNDEF IPHONEOS}
  1017 {$IFNDEF IPHONEOS}
  1019 if (not (CurrentTeam^.ExtDriven and isCursorVisible and not bShowAmmoMenu)) and cHasFocus then
  1018 if (not (CurrentTeam^.ExtDriven and isCursorVisible and not bShowAmmoMenu)) and cHasFocus then
  1020 begin
  1019 begin
  1021     SDL_GetMouseState(@CursorPoint.X, @CursorPoint.Y);
  1020     SDL_GetMouseState(@CursorPoint.X, @CursorPoint.Y);