[ scummvm-Patches-612847 ] SAM: paint-by-numbers fix

noreply at sourceforge.net noreply at sourceforge.net
Sun Sep 22 17:01:53 CEST 2002


Patches item #612847, was opened at 2002-09-22 17:01
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418822&aid=612847&group_id=37116

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Torbjörn Andersson (eriktorbjorn)
Assigned to: Nobody/Anonymous (nobody)
Summary: SAM: paint-by-numbers fix

Initial Comment:
This patch fixes the paint-by-number mini-game so that
it works flawlessly for me. I'm still a bit concerned
about the correctness of the patch, though. Here's what
it does:

First of all, it implements the missing kernelFunction
113. It pushes the palette index of the pixel the mouse
is currently over onto the stack. Since I still don't
quite understand how VirtScreen works, I don't know if
I got this right. I guess it also depends on whether
it's the real or virtual mouse coordinates.

In doing this I uncovered a problem in swapPalColors():
When calling setDirtyColors(), it doesn't make sure the
first parameter is smaller than the second one, and
that can cause ScummVM to crash. I've changed it to
dirty only the two colours in question, not every
colour in between. (The way dirty colours are
implemented it will dirty all those colours anyway, but
that's beside the point.)

Finally, for the whole thing to work, miscOps 123 had
to be changed to just copy one palette entry to
another, not swap them. Otherwise the crayons will
absorb the colour of everything they paint, which will
eventually leave you with a box full of mostly black
crayons. This change makes sense since there aready is
a miscOps 120 for swapping colours, but since I don't
know where else miscOps 123 is used I can't test if I
accidentally broke anything else.

Apart from these caveats, the patch is complete and
cleaned up.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418822&aid=612847&group_id=37116




More information about the Scummvm-tracker mailing list