Opened 21 years ago

Closed 21 years ago

#773 closed defect (fixed)

SAM: Max walks around in the inventory

Reported by: SF/trinity78 Owned by: eriktorbjorn
Priority: normal Component: Engine: SCUMM
Version: Keywords:
Cc: Game: Sam and Max


ScummVM Cvs Build 0.41 Win2k with SP3 Sam and Max German Talkie CD

When opening the inventory screen, you can still see Max walking around.

See attached screenshot.

Ticket imported from: #737923. Ticket imported from: bugs/773.

Attachments (1)

sam.jpg (51.4 KB ) - added by SF/trinity78 21 years ago.

Download all attachments as: .zip

Change History (12)

by SF/trinity78, 21 years ago

Attachment: sam.jpg added

comment:1 by SF/trinity78, 21 years ago

I noticed that this does NOT happend with the ScummVM 0.4.0 release build. So this must be a very, very, very recent regression.

comment:2 by eriktorbjorn, 21 years ago

I wasn't able to reproduce it when I gave it a very quick try. Does it happen in every room, or just in a few?

comment:3 by SF/trinity78, 21 years ago

It happens in front of Trixies trailer, behind the the hall of oddities (circus). Just wait some moments until Max walks from the right to the left and back. Be sure to use the latest cvs, it doesn't happen with 0.40 release.

comment:4 by eriktorbjorn, 21 years ago

Thanks, that helps! Now I can reproduce the bug. I still don't know what's causing it though, but at least I know where to start looking.

comment:5 by fingolfin, 21 years ago

I recently made some changes to the masking handling in akos.cpp. Maybe that causes this regression.

If it does, I'd like to first investigate this a bit instead of just undoing them, though. This problem (actors drawn atop the inventory) is pretty old, and only works because of a workaround in drawObject...

comment:6 by eriktorbjorn, 21 years ago

It's the change in costume.cpp - not akos.cpp - of course, but I guess that's what you meant.

There's a lengthy comment about this in drawBitmap(), but the short version is that Sam & Max uses the dbDrawMaskOnAll flag to make some objects, e.g. the inventory box, have their mask applied to all Z-planes, including the frontmost one.

The change to costume.cpp was to change an "else" to "else if (_zbuf != 0)", which made it ignore the frontmost mask, except for text masking.

There are other games that can use this flag as well, but I believe they all use akos.cpp rather than costume.cpp, so it should be ok to just change the "else if (_zbuf != 0)" to "else if (_zbuf != 0 || _vm->_gameId == GID_SAMNMAX)".

Unless, of course, you know of a better way to make the inventory mask everything.

comment:7 by fingolfin, 21 years ago

Hrm, this is a bit annoying. Maybe the whole check for _zbuf != 0 shoudl be removed again... But we originally always had that _zbuf != 0 check in, it only got lost one day in the course of some SMALL_HEADER change... Hrm.

comment:8 by eriktorbjorn, 21 years ago

I don't know. CVS history doesn't say why the change was made.

Come to think of it, the only reason we set variables like charsetmask, masking, etc. seems to be so we can have a bunch of costume-drawing functions which basically do the same thing, but which have been optimized for different cases.

If we're willing to sacrifice that extra bit of speed (how much is that anyway?) we should be able to simplify the costume code a lot...

comment:9 by eriktorbjorn, 21 years ago

I've submitted an experimental patch that removes all of the proc*() functions from costume.cpp, except for one which has been slightly extended. I still don't know if it's a good idea, and it's not very tested, but it does cut the size of costume.cpp from 30 KB to 14 KB.

Oh, and it would fix this bug, of course, since not masking would no longer be an option. :-)

comment:10 by eriktorbjorn, 21 years ago

Owner: set to eriktorbjorn
Resolution: fixed
Status: newclosed

comment:11 by eriktorbjorn, 21 years ago

A revised version of the costume patch is now in CVS, so this bug is fixed now. Knock on wood...

Note: See TracTickets for help on using tickets.