[Bug 43918] Crysis 3: Mouse movement unreliable,mouse cursor jumps around

wine-bugs at winehq.org wine-bugs at winehq.org
Sun Sep 2 16:15:42 CDT 2018


https://bugs.winehq.org/show_bug.cgi?id=43918

--- Comment #9 from bocadillodeatun <fernando at gluegarage.com> ---
In the previous comment I explained how the following configuration (number
#06) is the only one that works for me:


         CONFIGURATION SETTINGS              |      RESULT
---------------------------------------------|------------------------------
#   Virtual  Mouse warp  Capture  In-game    | Mouse     Mouse
    desktop  override    mouse    graphics   | in menus  in game
============================================================================
06  yes      force       no       fullscreen | fixed     ok


With these settings at least I can play the game, but I cannot use the menus
with the mouse (I must use the keyboard instead, but that's ok).

Anyway, trying to figure out what is going on with the mouse in the menus, I
enabled the "dinput" channel logs on this particular scenario and noticed how
the following message was been constantly generated:

  "warp_check Warping mouse to 960 - 540"

This message is being printed from the following piece of code:

  function mouse.c:warp_check()
  =============================

    1  if (!This->clipped)
    2  {
    3     mapped_center.x = (rect.left + rect.right) / 2;
    4     mapped_center.y = (rect.top + rect.bottom) / 2;
    5     TRACE("Warping mouse to %d - %d\n", mapped_center.x,
mapped_center.y);
    6     SetCursorPos( mapped_center.x, mapped_center.y );
    7  }

I have *no idea* about the wine code (this is the first time I have a look at
it)... but I tried to comment out line 6, and two things happened:

  1. Unsurprisingly, the mouse in the menus now works (great!)

  2. BUT... surprisingly, the mouse in the game no longer warps and
     its movement is limited to a virtual box (what I called "box
     limited" in the previous comment)

So... the "reset" of the mouse position back to the center of the screen is
somehow needed by the warping mechanism. It's just that we need to tell apart
between the two possible scenarios ("menus" and "in-game") to decide whether
the mouse position must be reset or not.

In other words, we need to add a condition here:

   1  if (!This->clipped) && some_new_condition
   2  {                      ------------------
   ...                         ^
   7  }                        here

If anyone knows what that condition might be, I can try it... in the mean time
I'll keep looking at the code.

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list