CMI: Possible SO_ROOM_SATURATION implementation
|Reported by:||eriktorbjorn||Owned by:||fingolfin|
|Cc:||Game:||Monkey Island 3|
This is an attempt at implementing what SO_ROOM_SATURATION might be meant to do. Fingolfin already guessed that it is similar to darkenPalette() in that it takes three scaling parameters and a palette range, but apparently wasn't sure how the scaling was done. Neither am I, but I'm guessing that it's the colour's hue, saturation and value (HSV) that are to be scaled.
CMI uses this opcode when Guybrush walks off the beach towards the swamp to make him sort of fade into the background mists.
It's not meant to be a definitive implementation. The result doesn't look quite like the original, and it uses floating-point math because I didn't want to stray too far from the description I had of the algorithm until I was more certain that I was using the right algorithm at all. I'll look into simplifying it later.
Ticket imported from: #686427. Ticket imported from: patches/279.