Opened 22 years ago
Closed 22 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 |
Description
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)
Change History (12)
by , 22 years ago
comment:1 by , 22 years ago
comment:2 by , 22 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 , 22 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 , 22 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 , 22 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 , 22 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 , 22 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 , 22 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 , 22 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 , 22 years ago
Owner: | set to |
---|---|
Resolution: | → fixed |
Status: | new → closed |
comment:11 by , 22 years ago
A revised version of the costume patch is now in CVS, so this bug is fixed now. Knock on wood...
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.