Opened 22 years ago

Closed 22 years ago

#437 closed defect (fixed)

LOOM: Flashlight glitch

Reported by: eriktorbjorn Owned by: fingolfin
Priority: normal Component: Engine: SCUMM
Version: Keywords:
Cc: Game: Loom

Description

When a line of text is removed while in a dark room, that area is repainted with the lit room's background, not the dark room's. See screenshots.

The problem is that restoreBG() is restoring the wrong background. I can work around this by putting this code at the top of the function:

if (!(_vars[VAR_CURRENT_LIGHTS] & LIGHTMODE_screen) && _vars[VAR_CURRENT_LIGHTS] & LIGHTMODE_flashlight) { _fullRedraw = true; return; }

But that seems like an ugly hack to me. Surely there has to be a better way than this?

Ticket imported from: #601139. Ticket imported from: bugs/437.

Attachments (3)

scr0000.png (5.9 KB ) - added by eriktorbjorn 22 years ago.
Screenshot, with a line of text being displayed
scr0001.png (7.3 KB ) - added by eriktorbjorn 22 years ago.
Screenshot, after the text has been removed
loomcd.s02 (51.7 KB ) - added by eriktorbjorn 22 years ago.
Savegame

Download all attachments as: .zip

Change History (12)

by eriktorbjorn, 22 years ago

Attachment: scr0000.png added

Screenshot, with a line of text being displayed

by eriktorbjorn, 22 years ago

Attachment: scr0001.png added

Screenshot, after the text has been removed

comment:1 by SF/andrej4000, 22 years ago

I dindn't notice this problem ni CVS from 7th November. Could anyone please cheack for it, too?

comment:2 by eriktorbjorn, 22 years ago

I can still reproduce it. It happens if you move Bobbin to the lower part of the screen (so that the message is printed in the picture, rather than under it) and then provoke him into saying something, e.g. by making him spin a draft without pointing at anything first.

So it's not something you'd be likely to notice unless you were looking for it.

comment:3 by SF/ender, 22 years ago

Fingolfin, you looked at the flashlight code recently (for that indy
bug) - I don't suppose you have any insight on this?

At worst, can we setup some different dirtyrects, or invalidate the charset-mask rectangle, instead of just doing a COMPLETE redraw...?

comment:4 by SF/ender, 22 years ago

Owner: set to fingolfin

comment:5 by fingolfin, 22 years ago

Well, while the lights are off, all background is black, except for where the flashlight is. Since the flashlight is redrawn everytime anyway, we could just add a check in restoreBG() and if lights are off, just clear the background to black instead of drawin the "real" back image.

However, that is *not* what the original code does as far as I can tell (at least in Monkey Island), so I wonder what is the real problem... hmm

comment:6 by fingolfin, 22 years ago

Owner: fingolfin removed

comment:7 by eriktorbjorn, 22 years ago

It still happens with recent CVS versions.

by eriktorbjorn, 22 years ago

Attachment: loomcd.s02 added

Savegame

comment:8 by fingolfin, 22 years ago

Owner: set to fingolfin
Resolution: fixed
Status: newclosed

comment:9 by fingolfin, 22 years ago

Actually, after looking closer, I saw VAR_V5_DRAWFLAGS being used in restorBG (but commented out)... gues what, that's the same as VAR_CURRENT_LIGHTS :-)

Sure enough, this fixes the problem. A somewhat related problem remains: the flashlight removes any text it moves over, i.e. a text masking issue. Looking into that one now.

Note: See TracTickets for help on using tickets.