hedgewars/uCursor.pas
changeset 12659 545e1198e8b9
parent 10017 de822cd3df3a
child 12660 d3fb69e31165
equal deleted inserted replaced
12658:966124c80861 12659:545e1198e8b9
    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     // Due to switch to SDL2, the game camera in the Alpha for 0.9.23
       
    23     // screwed up if the game started with the mouse already being
       
    24     // centered.
       
    25     // No big deal since this function is (so far) only called once.
       
    26     // This fixes it, but we might have overlooked an SDL2-related
       
    27     // bug somewhere else.
       
    28     SDL_WarpMouse((cScreenWidth div 2) + 1, cScreenHeight div 2);
    21     SDL_WarpMouse(cScreenWidth div 2, cScreenHeight div 2);
    29     SDL_WarpMouse(cScreenWidth div 2, cScreenHeight div 2);
    22 end;
    30 end;
    23 
    31 
    24 procedure updatePosition;
    32 procedure updatePosition;
    25 var x, y: LongInt;
    33 var x, y: LongInt;