[Scummvm-devel] [Scummvm-cvs-logs] SF.net SVN: scummvm:[38881] scummvm/trunk/engines/sci/gfx

Max Horn max at quendi.de
Wed Feb 25 23:06:05 CET 2009


Am 25.02.2009 um 16:00 schrieb Walter van Niftrik:

> Hi Max,
>
> I'm talking about the following, from gfx_driver.cpp:
>
>               case Common::EVENT_LBUTTONDOWN:
>                       input.type = SCI_EVT_MOUSE_PRESS;
>                       input.data = 1;
>                       drv->pointer_x = p.x;
>                       drv->pointer_y = p.y;
>                       break;
>
> The coordinates are stored 'statically' rather than inside of the  
> event. These coordinates are then later re-added in kGetEvent. As a  
> result, when the game calls kGetEvent the mouse coordinates returned  
> will be those of the last mouse event seen by scumm_get_event, and  
> not necessarily the coordinates of the event itself.


Ah. Well, yeah, sure, store the coords in the event, not the driver.  
Makes perfect sense. You need to take care of the internal scaling of  
SCI, but that should be easy enough.

All in all, it might actually be easiest to get rid of the SCI event  
type, and use Common::Event for everything. After all, kGetEvent()  
needs to convert the SCI event data again anyway. So, we could convert  
SCI to use the "native" ScummVM event types and keycodes everywhere,  
and perform a conversion only when it is necessary, i.e., when we need  
to feed data to the scripts.

Bye,
Max




More information about the Scummvm-devel mailing list