hedgewars/uWorld.pas
changeset 154 5667e6f38704
parent 146 458f4f58c1b6
child 161 d8870bbf960e
equal deleted inserted replaced
153:dc10da2a73f9 154:5667e6f38704
   344 Captions[m].EndTime:= RealTicks + 1200
   344 Captions[m].EndTime:= RealTicks + 1200
   345 end;
   345 end;
   346 
   346 
   347 procedure MoveCamera;
   347 procedure MoveCamera;
   348 const PrevSentPointTime: LongWord = 0;
   348 const PrevSentPointTime: LongWord = 0;
   349 var s: string[9];
       
   350 begin
   349 begin
   351 if not (CurrentTeam.ExtDriven and isCursorVisible) then SDL_GetMouseState(@CursorPoint.X, @CursorPoint.Y);
   350 if not (CurrentTeam.ExtDriven and isCursorVisible) then SDL_GetMouseState(@CursorPoint.X, @CursorPoint.Y);
   352 if (FollowGear <> nil) then
   351 if (FollowGear <> nil) then
   353    if abs(CursorPoint.X - prevPoint.X) + abs(CursorPoint.Y - prevpoint.Y) > 4 then
   352    if abs(CursorPoint.X - prevPoint.X) + abs(CursorPoint.Y - prevpoint.Y) > 4 then
   354       begin
   353       begin
   364 
   363 
   365 if isCursorVisible then
   364 if isCursorVisible then
   366    begin
   365    begin
   367    if (not CurrentTeam.ExtDriven)and(GameTicks >= PrevSentPointTime + cSendCursorPosTime) then
   366    if (not CurrentTeam.ExtDriven)and(GameTicks >= PrevSentPointTime + cSendCursorPosTime) then
   368       begin
   367       begin
   369       s[0]:= #5;
   368       SendIPCXY('P', CursorPoint.X - WorldDx, CursorPoint.Y - WorldDy);
   370       s[1]:= 'P';
       
   371       PSmallInt(@s[2])^:= CursorPoint.X - WorldDx;
       
   372       PSmallInt(@s[4])^:= CursorPoint.Y - WorldDy;
       
   373       SendIPC(s);
       
   374       PrevSentPointTime:= GameTicks
   369       PrevSentPointTime:= GameTicks
   375       end;
   370       end;
   376    end;
   371    end;
   377 if isCursorVisible or (FollowGear <> nil) then
   372 if isCursorVisible or (FollowGear <> nil) then
   378    begin
   373    begin