hedgewars/uCursor.pas
changeset 5199 5eae5da831e1
parent 5191 c7000a6b397b
child 6580 6155187bf599
equal deleted inserted replaced
5198:6533e5450a21 5199:5eae5da831e1
    19 begin
    19 begin
    20     SDL_GetMouseState(@x, @y);
    20     SDL_GetMouseState(@x, @y);
    21 
    21 
    22     if(x <> cScreenWidth div 2) or (y <> cScreenHeight div 2) then
    22     if(x <> cScreenWidth div 2) or (y <> cScreenHeight div 2) then
    23         begin
    23         begin
    24 writeln(x, ', ', y);
       
    25         CursorPoint.X:= CursorPoint.X + x - cScreenWidth div 2;
    24         CursorPoint.X:= CursorPoint.X + x - cScreenWidth div 2;
    26         CursorPoint.Y:= CursorPoint.Y - y + cScreenHeight div 2;
    25         CursorPoint.Y:= CursorPoint.Y - y + cScreenHeight div 2;
    27 
    26 
    28         if cHasFocus then SDL_WarpMouse(cScreenWidth div 2, cScreenHeight div 2);
    27         if cHasFocus then SDL_WarpMouse(cScreenWidth div 2, cScreenHeight div 2);
    29         end
    28         end