Opened 5 years ago

Closed 5 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
Keywords: Cc:
Game: Zork Nemesis


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)

znemesis.015 (13.8 KB ) - added by SF/tnm23 5 years ago.
Screenshot.png (243.4 KB ) - added by SF/tnm23 5 years ago.
poster.png (14.8 KB ) - added by eriktorbjorn 5 years ago.
mp2eb11c.png (59.5 KB ) - added by eriktorbjorn 5 years ago.

Download all attachments as: .zip

Change History (9)

by SF/tnm23, 5 years ago

Attachment: znemesis.015 added

by eriktorbjorn, 5 years ago

Attachment: poster.png added

comment:1 by eriktorbjorn, 5 years ago

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

by eriktorbjorn, 5 years ago

Attachment: mp2eb11c.png added

comment:2 by eriktorbjorn, 5 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 eriktorbjorn, 5 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 SF/marisa-chan, 5 years ago

You are right, yesterday I found this in original engine and now already prepare patch:

and pull request

comment:5 by eriktorbjorn, 5 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 eriktorbjorn, 5 years ago

Owner: set to eriktorbjorn
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.