Opened 18 years ago

Closed 18 years ago

Last modified 2 years ago

#8236 closed patch

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

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

Description

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 18 years ago.
Patch against a May 27 CVS snapshot

Download all attachments as: .zip

Change History (4)

by eriktorbjorn, 18 years ago

Attachment: restorebg.diff added

Patch against a May 27 CVS snapshot

comment:1 by fingolfin, 18 years ago

Looks good to me.

comment:2 by fingolfin, 18 years ago

Owner: set to fingolfin
Status: newclosed

comment:3 by digitall, 2 years ago

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