Opened 18 years ago

Closed 18 years ago

Last modified 6 years ago

#3050 closed defect (fixed)

BASS: mouse initialized wrong in control panel

Reported by: salty-horse Owned by: fingolfin
Priority: normal Component: Engine: Sky
Version: Keywords:
Cc: Game: Beneath a Steel Sky

Description

Using latest svn.

1) Enter the control panel. 2) Position the cursor over a button. 3) Press ESC and enter the control panel again. 4) The cursor is over a button, but clicking has no effect.

When the control panel is initialized, The current mouse x/y positions are taken from the mouse class. These values are out-dated since the mouse class last got them when the game started - the Sky class seems to manage its own x/y values.

I'm not familiar with the mouse class' purpose, but perhaps this problem is a cause for other bugs?

Ticket imported from: #1656880. Ticket imported from: bugs/3050.

Change History (4)

comment:1 by bluegr, 18 years ago

Well, it's not as bad as it sounds, you can just move the mouse and you can click on the button again

comment:2 by fingolfin, 18 years ago

Owner: set to fingolfin
Resolution: fixed
Status: newclosed

comment:3 by fingolfin, 18 years ago

Actually, the cursor position stored in the Mouse class is updated regulary by SkyEngine via Mouse::mouseEngine. And doing this makes sure the mouse position is synced during each "frame" of the game.

The real problem is that the control panel uses its own even loop, and its own copy of _mouseX / _mouseY. And it never updates the SkyMouse nor the SkyEngine class with these values. Hence, when you press ESC, both SkyEngine and SkyMouse contain invalid values. When you then press F5, their old invalid values are passed to the "Control" class. Hence, if you move the mouse 1 pixel between ESC and F5, things work just fine.

So I updated class Control to notify the mouse class about mouse movements, which fixes the issue.

comment:4 by digitall, 6 years ago

Component: Engine: Sky
Game: Beneath a Steel Sky
Note: See TracTickets for help on using tickets.