Opened 16 years ago

Closed 16 years ago

Last modified 12 months ago

#8223 closed patch

SAM: Hack to fix bug #737387

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

Description

This patch fixes bug #737387 ("SAM: Part of text
(subtitles) disappears when moving mouse"), albeit in a
slightly hacky way.

The problem is that our useIm01Cursor() works by
drawing the cursor image to the upper left corner, from
which it then copies it into _grabbedCursor before
finally restoring the screen. It's the last step that
doesn't quite work. I think it simply redraws the
original background, and that does not include the text
that was drawn there.

This patch fixes that by copying the screen are to a
temporary buffer and restore it from there instead. A
nicer solution would probably be if useIm01Cursor()
could render the image directly into _grabbedCursor
instead, like useBompCursor() does, but I'm not
familiar enough with the code.

There is a possibly related glitch with The Dig, where
it draws a cursor image in the upper left corner
without erasing it afterwards. Unfortunately this patch
does nothing whatsoever to fix that.

Ticket imported from: #738100. Ticket imported from: patches/328.

Attachments (1)

cursor-fix.diff (1.0 KB ) - added by eriktorbjorn 16 years ago.
Patch against a May 14 CVS snapshot

Download all attachments as: .zip

Change History (4)

by eriktorbjorn, 16 years ago

Attachment: cursor-fix.diff added

Patch against a May 14 CVS snapshot

comment:1 by fingolfin, 16 years ago

I think this isn't really a hack, rather it cleans up the hack which
useIm01Cursor is ;-)

Anyway, the "nice" fix you mention would mean to either write a seperate
function to decode the image data (i.e. duplicate code from drawBitmap), or
to make drawBitmap "retargetable". Neither seems very appealing to me.

BTW a somewhat related issue: the only place useIm01Cursor is called is
setCursorImg(), which is also called in script_v5.cpp. Yet for both V6 *and*
older games, it seems thsi code is executed:
setCursorHotspot(READ_LE_UINT16(&foir.imhd->old.hotspot[0].x),
READ_LE_UINT16(&foir.imhd->old.hotspot[0].y));
w = READ_LE_UINT16(&foir.cdhd->v6.w) >> 3;
h = READ_LE_UINT16(&foir.cdhd->v6.h) >> 3;

cdhd->v6 ? Not cdhd->old for V5 games ??? Very strange...

comment:2 by fingolfin, 16 years ago

Owner: set to fingolfin
Status: newclosed

comment:3 by digitall, 12 months ago

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