ScummVM API documentation
Sci::SingleRemap Class Reference

#include <remap32.h>

Public Member Functions

void reset ()
 
bool update ()
 

Public Attributes

RemapType _type
 
uint8 _from
 
uint8 _to
 
int16 _delta
 
int16 _percent
 
uint8 _gray
 
uint8 _remapColors [237]
 

Detailed Description

SingleRemap objects each manage one remapping operation.

Member Function Documentation

◆ reset()

void Sci::SingleRemap::reset ( )

Resets this SingleRemap's color information to default values.

◆ update()

bool Sci::SingleRemap::update ( )

Recalculates and reapplies remap colors to the _remapColors array.

Member Data Documentation

◆ _type

RemapType Sci::SingleRemap::_type

The type of remap.

◆ _from

uint8 Sci::SingleRemap::_from

The first color that should be shifted by a range remap.

◆ _to

uint8 Sci::SingleRemap::_to

The last color that should be shifted a range remap.

◆ _delta

int16 Sci::SingleRemap::_delta

The direction and amount that the colors should be shifted in a range remap.

◆ _percent

int16 Sci::SingleRemap::_percent

The difference in brightness that should be applied by a brightness (percent) remap.

This value may be be greater than 100, in which case the color will be oversaturated.

◆ _gray

uint8 Sci::SingleRemap::_gray

The amount of desaturation that should be applied by a saturation (gray) remap, where 0 is full saturation and 100 is full desaturation.

◆ _remapColors

uint8 Sci::SingleRemap::_remapColors[237]

The final array used by CelObj renderers to composite remapped pixels to the screen buffer.

Here is how it works:

The source bitmap being rendered will have pixels within the remap range (236-245 or 236-254), and the target buffer will have colors in the non-remapped range (0-235).

To arrive at the correct color, first the source pixel is used to look up the correct SingleRemap for that pixel. Then, the final composited color is looked up in this array using the target's pixel color. In other words, target = _remaps[remapEndColor - source].remapColors[target].

Mac SSCI includes entry 236 in the non-remapped range at the cost of one remap entry and so the Mac remap range starts at 237. The final entry in this array, and the others in this class, is not used by PC games.


The documentation for this class was generated from the following file: