#8061 closed patch
SAM: paint-by-numbers fix
Reported by: | eriktorbjorn | Owned by: | SF/ender |
---|---|---|---|
Priority: | normal | Component: | Engine: SCUMM |
Version: | Keywords: | ||
Cc: | Game: | Sam and Max |
Description
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.
Ticket imported from: #612847. Ticket imported from: patches/166.
Attachments (2)
Change History (5)
by , 22 years ago
Attachment: | painting.diff added |
---|
comment:1 by , 22 years ago
Owner: | set to |
---|---|
Status: | new → closed |
comment:2 by , 22 years ago
Looks good :)
miscOps 123 was only used there, and its implementation was just a total guess when I first coded it. I've never seen it used elsewhere, and I'm pretty sure thats the correct behavor anyway.
Thanks.
comment:3 by , 6 years ago
Component: | → Engine: SCUMM |
---|---|
Game: | → Sam and Max |
Patch against a September 21 CVS snapshot