Opened 16 years ago

Closed 15 years ago

#1601 closed defect (fixed)

SAM: Inventory masking regression

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

Description

Here's a bug I get in the latest CVS, but not in 0.6.0:

Walk Sam to the foreground, so that he can't be masked
by anything. I don't think you can do this in the
office, but you can do it in the hallway outside.

Open the inventory box. Examine something (e.g. Max, if
you're not carrying anything else). Wait for the
subtitles to be removed.

Sam is now visible through the inventory box.

I'm not quite sure what's happening, but Sam & Max uses
the dbDrawMaskOnAll feature to draw the inventory. This
causes the object's mask to be drawn on all mask
buffers, including (and this is the important one) the
same one as is used by the charset mask.

Is it possible that the recent charset mask changes
means that enough of the charset mask is cleared that
Sam is no longer masked after the subtitles have been
removed?

Ticket imported from: #937017. Ticket imported from: bugs/1601.

Change History (8)

comment:1 by eriktorbjorn, 16 years ago

Owner: set to fingolfin

comment:2 by fingolfin, 16 years ago

The new charset mask code will indeed remove the entire mask on level
0 (i.e. the charset mask). Hrrrrmm. As a matter of fact, I think it always
used to do it, just by lucky coincidence, this didn't cause visible glitches
?!?

I'll try to take a closer look tomorrow...

comment:3 by fingolfin, 16 years ago

Priority: normalhigh

comment:4 by eriktorbjorn, 15 years ago

What's the status of this? I know the bug still happens, but
have you had the time to look at it yet?

I've been thinking of taking a look myself, but I don't want
to get in your way. ;-)

comment:5 by fingolfin, 15 years ago

I haven't looked into fixing this yet, no. It's clear to me what causes the
problem, and there are some potential ways to fix it, but I don't know
which one to go at this moment, and it's a bit difficult to judge the impact
of the various changes properly...

One way would be to stop (ab)using mask level 0 for the charset mask
and introduce another separate buffer for the charset mask. That would
allow to cleanly separate the two and should fix the problem at hand; but
it will require changes to several spots in the code (costume & font
renderer, gfx.cpp code, etc.).
Another advantage of that approach: if done properly it might make it
possible to cleanly solve another text rendering related bug: namely, in
newer games, scrolling should *not* erase text but rather it should stay
fixed with regards to the real screen (so it stays in the same spot on the
screen, but "moves" over the game graphics) (SAM and COMI have open
bug reports on this, I believe). Currently there is no good way around
this, since the masks are relative to the virtual screen coords, not real
screen coords. Our new separate charset mask could be based on real
screen coords, though, thus "fixing" the problem.

Anyway: if you want to tackle this, feel free to go ahead :-). And if you
have other ideas how to solve it, please voice them; I am not fixed on
the above approach in any way, maybe there are much better solutions!

comment:6 by eriktorbjorn, 15 years ago

I like the sound of it, though as you say it'll mean little
changes in a lot of places.

comment:7 by fingolfin, 15 years ago

Resolution: fixed
Status: newclosed

comment:8 by fingolfin, 15 years ago

Done as described in CVS. We'll see what new regression *that* will
cause :-)

Note: See TracTickets for help on using tickets.