hedgewars/uCursor.pas
branchqmlfrontend
changeset 12855 1b2b84315d27
parent 12831 1fbc0d5a82d0
child 12890 9c259fb4d405
child 13494 424944a835a7
equal deleted inserted replaced
11843:01f88c3b7b66 12855:1b2b84315d27
    16     resetPosition();
    16     resetPosition();
    17 end;
    17 end;
    18 
    18 
    19 procedure resetPosition;
    19 procedure resetPosition;
    20 begin
    20 begin
       
    21     // Move curser by 1px in case it's already centered.
       
    22     // The game camera in the Alpha for 0.9.23 screwed up if
       
    23     // the game started with the mouse already being centered.
       
    24     // This fixes it, but we might have overlooked a related
       
    25     // bug somewhere else.
       
    26     // No big deal since this function is (so far) only called once.
       
    27     SDL_WarpMouse((cScreenWidth div 2) + 1, cScreenHeight div 2);
    21     SDL_WarpMouse(cScreenWidth div 2, cScreenHeight div 2);
    28     SDL_WarpMouse(cScreenWidth div 2, cScreenHeight div 2);
    22 end;
    29 end;
    23 
    30 
    24 procedure updatePosition;
    31 procedure updatePosition;
    25 var x, y: LongInt;
    32 var x, y: LongInt;