[Scummvm-devel] making mouse position changes only when mouse is within ScummVM window?

M. Kiewitz m_kiewitz at users.sourceforge.net
Thu Jun 10 16:13:38 CEST 2010


Hi there,

Some SCI games change mouse position sometimes and in special cases they even change mouse positions for some seconds all the time - like when playing piano with patti in larry 5. We currently set mouse position at any time, which means if the user wants to do something else during that scene, he simply can't.

So maybe we should limit warpMouse to only set mouse position, when the mouse position is currently within the ScummVM window. This can be done by adding

    if (!(SDL_GetAppState( ) & SDL_APPMOUSEFOCUS))
        return;

to OSystem_SDL::warpMouse(). This would also make the patti piano scene escapeable.

Many engines use warpMouse(), so I don't know if this could create problems. For example the cannon scene in Monkey Island 3 works even with this change and it's now (?) possible to get out of the window as well. Maybe this wasn't possible before (I didn't try it w/o that change).

Also it would be great, if people on other platforms could try this change out. It definitely works under Windows XP (32-bit).

If there are problems, I guess they could be solved by just setting the game cursor only, when the mouse is outside of the ScummVM window.

Theoretically we could just implement this change for SCI only, although I think that no engine should change mouse cursor position at any time. Limiting it to the Ctrl-M mode isn't good as well, because we would disable it completely for the regular windowed mode and this would break some games and I also bet that most users don't use that mode anyway. Personally I'm not using it either, because that's even worse when I want to do multiple things simultaneously.

Any thoughts about this?

Regards
  M. Kiewitz



      




More information about the Scummvm-devel mailing list