Opened 17 years ago

Closed 16 years ago

#437 closed defect (fixed)

LOOM: Flashlight glitch

Reported by: eriktorbjorn Owned by: fingolfin
Priority: normal Component: Engine: SCUMM
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 17 years ago.
Screenshot, with a line of text being displayed
scr0001.png (7.3 KB) - added by eriktorbjorn 17 years ago.
Screenshot, after the text has been removed
loomcd.s02 (51.7 KB) - added by eriktorbjorn 16 years ago.
Savegame

Download all attachments as: .zip

Change History (12)

Changed 17 years ago by eriktorbjorn

Attachment: scr0000.png added

Screenshot, with a line of text being displayed

Changed 17 years ago by eriktorbjorn

Attachment: scr0001.png added

Screenshot, after the text has been removed

comment:1 Changed 17 years ago by SF/andrej4000

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

comment:2 Changed 17 years ago by eriktorbjorn

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 Changed 17 years ago by SF/ender

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 Changed 17 years ago by SF/ender

Owner: set to fingolfin

comment:5 Changed 17 years ago by fingolfin

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 Changed 17 years ago by fingolfin

Owner: fingolfin deleted

comment:7 Changed 16 years ago by eriktorbjorn

It still happens with recent CVS versions.

Changed 16 years ago by eriktorbjorn

Attachment: loomcd.s02 added

Savegame

comment:8 Changed 16 years ago by fingolfin

Owner: set to fingolfin
Resolution: fixed
Status: newclosed

comment:9 Changed 16 years ago by fingolfin

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.