• Show log

    Commit

  • Hash : aa188048
    Author : hmk
    Date : 2020-04-10T12:23:08

    render: Scale relative mouse motion better for logical sizing
    
    From hmk:
    
    "When scaling is enabled (e.g. via SDL_RenderSetLogicalSize, size not equal
    to window size), mouse motion events are also scaled.  Small motions are
    rounded up (SDL_max() when the value after scaling is less than 1), while
    larger motions are truncated by the floating point -> integer conversion.
    
    https://hg.libsdl.org/SDL/file/b18197f9bf9d/src/render/SDL_render.c#l658
    
    The end result feels something like mouse reverse mouse acceleration + angle
    snapping at low speeds, but less consistent (amount of truncation & rounding
    depends on how fast the mouse is moved) and potentially much worse if the
    scaling factor is large.  This pretty much makes it useless for anything
    where you need precise mouse aiming (think of games).  I suspect this is why
    aiming gets so terrible in some games that let you use scaling to reduce the
    render resolution (e.g. Ion Fury).
    
    With 4x4 scaling, I can reproduce a situation where it takes three fast flicks
    of the mouse across the pad to undo one slow sweep across the pad.  In other
    words, extreme reverse acceleration.  This does not happen when scaling is
    disabled.
    
    Furthermore, any game that uses relative mouse motion events for 3D camera
    rotation probably wants the raw mouse deltas and not a value that depends on
    scaling and resolution and rounding and truncation.  Ideal camera rotation
    just takes mouse input, multiplies it by sensitivity, and adds it to the
    angle-in-radians or whatever measure is used for yaw & pitch.  Pixels and
    screen resolution or window dimensions should not be a part of the equation
    at all, even if it could be implemented without rounding errors.
    
    [...]
    
    This [patch] completely eliminates angle snapping for me, and makes
    sensitivity consistent.  In other words, it's completely usable for, say,
    aiming in a first person shooter."
    
    Partially fixes Bugzilla #4811.
    

  • Properties

  • Git HTTP https://git.kmx.io/kc3-lang/SDL.git
    Git SSH git@git.kmx.io:kc3-lang/SDL.git
    Public access ? public
    Description

    Fork of https://github.com/libsdl-org/SDL

    Users
    thodg_m kc3_lang_org thodg_w thodg_l www_kmx_io thodg
    Tags