Opened 16 years ago

Closed 16 years ago

Last modified 8 months ago

#8236 closed patch

ALL: restoreBG() doesn't always completely remove the mask

Reported by: eriktorbjorn Owned by: fingolfin
Priority: normal Component: Engine: SCUMM
Keywords: Cc:
Game: Sam and Max


There are cases where restoreBG() doesn't completely
remove the mask. One noticeable case is in Sam & Max
where Max says "Your main attraction was a block of
ice?". In this case

rect.left = 12
rect.right = 234
width = 222

With the current method mask_width will be 28. The
result is that part of the "f" (the last character on
the first line) still masks the Kushman brothers. With
the patch it will be 29, and all of the mask is removed.

A simpler case to verify by hand:

rect.left = 7
rect.right = 17
width = 10

Note that while pixel 17 is not considered to be inside
the rectangle it still spans over three bytes of mask
buffer. But we calculate the mask_width to 2.

I'm a bit too tired right now to feel confident enough
to apply this change myself, but I *think* I got it right.

Ticket imported from: #744448. Ticket imported from: patches/341.

Attachments (1)

restorebg.diff (859 bytes) - added by eriktorbjorn 16 years ago.
Patch against a May 27 CVS snapshot

Download all attachments as: .zip

Change History (4)

Changed 16 years ago by eriktorbjorn

Attachment: restorebg.diff added

Patch against a May 27 CVS snapshot

comment:1 Changed 16 years ago by fingolfin

Looks good to me.

comment:2 Changed 16 years ago by fingolfin

Owner: set to fingolfin
Status: newclosed

comment:3 Changed 8 months ago by digitall

Component: Engine: SCUMM
Game: Sam and Max
Note: See TracTickets for help on using tickets.