tobiaspfaff / grim_mouse

ResidualVM main repository
http://residualvm.org
GNU General Public License v2.0
56 stars 8 forks source link

Mouse location offset after loading game or toggling fullscreen #3

Closed auwsmit closed 10 years ago

auwsmit commented 10 years ago

When I load my game, the mouse starts behaving weirdly. Any interactive spots are in completely nonsensical places. Like the icons are changing in wrong places and when I click, Manny goes off into usually lower screen space. The same thing happens when I switch from windowed to fullscreen or vice versa.

This basically makes the game unplayable without stock controls, unless I play from the very beginning to the end, in one session, without ever loading a save or switching to/from fullscreen.

Gonkalbell commented 10 years ago

I can confirm, I also ran into this bug. I also noticed that clicking on non-interactive spots to just walk to a certain location works fine. In other words, this glitch only affects the locations of hotspots.

auwsmit commented 10 years ago

Yeah, I was having trouble articulating just that. You can still accurately walk to a location on the floor, just all the clickable hotspots are in odd locations

Gonkalbell commented 10 years ago

New discovery. If you save and reload, the hotspots go back to where they should. Save and load again, and they get messed up again. Each time you save and load, it seams to toggle.

tobiaspfaff commented 10 years ago

I couldn't quite reproduce the bug, but have a suspicion what's going on. I pushed a fix (it's also in the binaries -> http://forums.residualvm.org/viewtopic.php?t=623 ). Can you check if that resolves the issue ?

jonrico commented 10 years ago

Thanks very much for this patch - mouse based Grim will be great for me.

I am seeing the problem with hotspots in the wrong places after switching to full screen mode. Switching back to windowed mode makes them appear in the correct places again, back to fullscreen again and they are in the wrong place. Its consistent each time. I am attaching a screenshot showing the first screen detailing where the hotspots are incorrectly placed in case the locations help you work out what is going on. Apologies for the super lo-fi photo!

I have been testing with version 0.2 from the forum post on Windows.

photo

Botje commented 10 years ago

Looking at the correct/wrong state in http://forums.residualvm.org/viewtopic.php?p=3075#3075 , it looks like the x-y coordinates of the hotspots are being transposed somehow. EDIT: just looked at the code. engines/grim/hotspot.cpp#L766 relies on the fact that arguments are evaluated left to right, which is not the case.

tobiaspfaff commented 10 years ago

aah, that explains why it only failed for the windows build

tobiaspfaff commented 10 years ago

fixed in git now (thanks Botje)

tobiaspfaff commented 10 years ago

fixed in 0.3