GetMessage related Jagged Alliance 2 regression

Martin Bosner m.bosner at c-t-b.info
Sat Dec 8 04:41:00 CST 2007


On Friday 07 December 2007 05:49:26 Alexander Dorofeyev wrote:
> Hello.
>
> I get freezes in Jagged Alliance 2 (seems to be tied to moving the mouse).
> It used to work in older versions. The game doesn't lock up totally (the
> music and sounds continue to play normally, for example), but the screen
> doesn't redraw and it doesn't respond to input. Activating some other
> window than the game window (if it's not full screen) usually unfreezes it.
>
> Bisect pointed to this change:
>
> http://source.winehq.org/git/wine.git/?a=commitdiff;h=2896540a34a18b8aff848
>d728308c5811cdd122a
>
> server: Set the queue mask directly in get_message to avoid an extra server
> call.
>
> I did a bit of debugging and it looks like the game is getting stuck within
> a GetMessageW call. It stays in that while loop in GetMessage, mostly in
> MsgWaitForMultipleObjectsEx. If the mouse is moved, then it awakes, gets to
> PeekMessageW, from there it goes to peek_message which returns false and so
> PeekMessageW returns false and the game goes back to waiting within
> GetMessageW.
>
> peek_message returns false, because in a first call to server it gets a
> MSG_HARDWARE (mouse) message which it drops for some reason, then it clears
> PM_QS_ flags and so in a next call to server it can't get a WM_TIMER
> message despite an expired timer seems to be ready in the queue.
>
> I'm not sure what would be a proper fix, although I did find out that
> commenting out this line in peek_message()
>
> if (HIWORD(flags)) flags = PM_QS_SENDMESSAGE | LOWORD(flags);
>
> makes the game playable. Maybe this clearing of PM_QS_* flags shouldn't be
> done in case when the message gets dropped? Before that commit nothing was
> passed in flags high word, which is probably why this problem wasn't
> happening.
I just wanted to say that that JA2 is the most unstable windows game i ever 
played (on windows XP!). JA2 crashing is a 100% natural Windows behaviour. 
Most times it just became unresponsive and the music was still playing in the 
background...

Martin




More information about the wine-devel mailing list