Opened 22 years ago

Closed 22 years ago

Last modified 6 years ago

#8026 closed patch

Fix for Loom flashlight glitch

Reported by: eriktorbjorn Owned by: SF/ender
Priority: normal Component: Engine: SCUMM
Version: Keywords:
Cc: Game: Loom

Description

When using the Night Vision draft in the tunnels beyond the dragon, the flashlight is drawn correctly, but at the same time the two exits vanish from sight. (They are then redrawn - and removed again - at various points as you walk around.)

Apparently both exits are actors, so what this patch does is to force a full redraw of them whenever a flashlight is drawn. Since the code already calls clear_fullRedraw() shortly afterwards it shouldn't affect anything else.

Unfortunately I can't check if this breaks any other games. Loom is the only one I own that uses the flashlight feature.

I'm attaching a saved game at the entrance to the tunnels. The Night Vision draft is "c d d c".

Ticket imported from: #600645. Ticket imported from: patches/131.

Attachments (3)

loomlight.diff (518 bytes ) - added by eriktorbjorn 22 years ago.
Patch against an August 26 CVS snapshot
loomcd.s08 (42.5 KB ) - added by eriktorbjorn 22 years ago.
Save game just outside the tunnels
loomlight2.diff (2.1 KB ) - added by eriktorbjorn 22 years ago.
New patch against a September 1 CVS snapshot

Download all attachments as: .zip

Change History (10)

by eriktorbjorn, 22 years ago

Attachment: loomlight.diff added

Patch against an August 26 CVS snapshot

by eriktorbjorn, 22 years ago

Attachment: loomcd.s08 added

Save game just outside the tunnels

comment:1 by fingolfin, 22 years ago

I see the problem occur, but I don't like this patch for it. It works around the problem instead of fixing it, and causes a full redraw on every turn when the flashlight is one, potentially wasting computing resources w/o need (as if it would matter <g>).

Maybe there is no better way, but I'd prefer if we researched this a bit more before just applying this "brute force" fix (and if we apply it, we should put in a comment that explains why it's there).

comment:2 by eriktorbjorn, 22 years ago

I guess you're right.

When I first suggested the change I thought that the redraw was only triggered when the flashlight square moved. It wasn't until later I realized that it was considerably more often than that.

comment:3 by eriktorbjorn, 22 years ago

Ok, I think I've figured out what's happening:

When drawFlashlight() is called, the parts of the screen that may be affected by the flashlight are marked as "dirty", so setActorRedrawFlags() is called to ensure that the actors occupying these areas are redrawn.

However, at this point resetActorBgs() has already been called, and processActors() only checks for needRedraw.

So the next time scummLoop() is called, there are potentially actors that should have had their backgrounds reset the last time, and who are no longer marked for redraw.

by eriktorbjorn, 22 years ago

Attachment: loomlight2.diff added

New patch against a September 1 CVS snapshot

comment:4 by eriktorbjorn, 22 years ago

This is a patch I would have attached yesterday, but I messed up my files. It adds two parameters to setActorRedrawFlags() to indicate which of the redraw flags should be updated.

This isn't the only way of fixing the bug, of course, but of the ones I could thing of that seemed least hackish.

comment:5 by SF/ender, 22 years ago

Well, nobody has objected to this new patch, so I've applied it.

comment:6 by SF/ender, 22 years ago

Owner: set to SF/ender
Status: newclosed

comment:7 by digitall, 6 years ago

Component: Engine: SCUMM
Game: Loom
Note: See TracTickets for help on using tickets.