Opened 4 years ago

Last modified 3 years ago

#11923 closed defect

AGI Splatter patterns appear to be incorrect — at Version 1

Reported by: rwtodd Owned by:
Priority: high Component: Engine: AGI
Version: Keywords: agi pic
Cc: rwtodd Game:

Description (last modified by rwtodd)

When I take, for example, Space Quest 2 room 16 or room 22, and compare the ScummVM image to the game running in DosBox, I can see that the splatter patterns are all wrong in the trees in the background.


I think way back in github commmit 0d279e8de07fc5 when the AGI splatter plotting was redone, the texture_number variable accidentally got hard-coded to 0. In fact, the texture number should start as the pattern number pulled in plotBrush() (notice: the code at present does nothing with _patNum, which is a clue something isn't right).

I think maybe the resulting plot errors were why a subsequent commit changed the ditherCond from 2 to 1. I believe that was incorrect and should be reverted.

To make the games I have look like the original, I believe the following changes are needed:

1) make plotBrush() store the raw byte it reads in _patNum (forget the >>1 and &0x7f part... that's left over from an older table-based approach to splatter).
2) in plotPattern(), initialize t to (_patNum | 0x01) and forget the zero texture_num.
3) in plotPattern(), change ditherCond back to 2 like it was originally.

I don't have an exhaustive list of games to test this with, but the few AGI games I have which use splatter plots look more accurate to me after these changes. If people agree it's an improvement, I can offer a pull request on github, or I'm just as happy if one of the usual devs makes the fix.

As further evidence, I believe nagi's pic_render.c agrees with the changes I'm suggesting. (https://github.com/sonneveld/nagi/blob/master/src/picture/pic_render.c). It sets texture_num in plot_with_pen(), and I think in the translation to scummvm, texture_num got converted to a local var and always set to zero.

Change History (2)

by rwtodd, 4 years ago

Attachment: comparison.png added

comment:1 by rwtodd, 4 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.