Opened 10 years ago
Closed 10 years ago
#6787 closed defect (fixed)
Backgrounds tend to turn green when overlaid decals change
Reported by: | SF/tnm23 | Owned by: | eriktorbjorn |
---|---|---|---|
Priority: | normal | Component: | Engine: ZVision |
Version: | Keywords: | ||
Cc: | Game: | Zork Nemesis |
Description
Scummvm version: ScummVM 1.8.0git (Jan 16 2015 10:31:43) Features compiled in: TAINTED Vorbis FLAC MP3 ALSA SEQ TiMidity RGB zLib MPEG2 Theora AAC FreeType2 JPEG PNG Optimised/Release build.
Bug details: This actually affects both Zvision games, but the most glaring example is the locked gate in the monastery in Nemesis (see screenshot) - the most noticeable similar example in Grand Inquisitor is probably the poster on the prison cell wall. Basically, when parts of the screen are redrawn over the background, for example when an object is picked up and the area is redrawn empty, there's some kind of palette bug that tends to turn parts of the area green.
GOG version of Zork Nemesis. Installed under wine, subtitles patch applied, then all required files copied into /usr/share/scummvm/nemesis
Debian Wheezy 7.8, Kernel 3.2.0-4-amd64 (#1 SMP Debian 3.2.65-1), gcc version 4.7 (x86_64-linux-gnu)
Steps to reproduce: Load attached saved game.
Ticket imported from: bugs/6787.
Attachments (4)
Change History (9)
by , 10 years ago
Attachment: | Screenshot.png added |
---|
by , 10 years ago
Attachment: | poster.png added |
---|
comment:1 by , 10 years ago
by , 10 years ago
Attachment: | mp2eb11c.png added |
---|
comment:2 by , 10 years ago
And here's what Zork Nemesis's mp2eb11c.tga looks like when it comes out of the image decoder.
So I guess the next step is trying to understand the image decoder...
comment:3 by , 10 years ago
Perhaps significant, perhaps not, but I did notice that in LzssReadStream it initializes _window[] by filling it with zeroes. If I change to fill the buffer with 255 instead, it looks like the parts that are green now turn yellow.
So presumably it's using parts of _window[] that hasn't been initialized with data from the file it's decompressing, so it contains default values instead. Which could be bad, but I don't know for sure if it is.
comment:4 by , 10 years ago
You are right, yesterday I found this in original engine and now already prepare patch: https://github.com/Marisa-Chan/scummvm/commit/f46af2eded0155a05d0e19717e6c4efd1191dab3
and pull request
comment:5 by , 10 years ago
I tried the patch for a bit, and could only see improvements, so I've merged the pull request. (Never done that before, so I hope I did it right.) Thanks!
comment:6 by , 10 years ago
Owner: | set to |
---|---|
Resolution: | → fixed |
Status: | new → closed |
That's odd. At least in the case of Zork Nemesis, the green pixels are there when the image comes out of the image decoder in RenderManager::readImageToSurface(). It's a TGZ image, so maybe there's a problem with our LzssReadStream?
The image is made from ej10y121.tga