Public Types | |
enum | { numGammaTables = 6 } |
Public Member Functions | |
GfxPalette32 (ResourceManager *resMan) | |
void | saveLoadWithSerializer (Common::Serializer &s) |
const Palette & | getNextPalette () const |
const Palette & | getCurrentPalette () const |
bool | loadPalette (const GuiResourceId resourceId) |
int16 | matchColor (const uint8 r, const uint8 g, const uint8 b) |
uint8 | getPlatformBlack () const |
uint8 | getPlatformWhite () const |
void | submit (const Palette &palette) |
void | submit (const HunkPalette &palette) |
bool | updateForFrame () |
void | updateFFrame () |
void | updateHardware () |
void | setVary (const Palette &target, const int16 percent, const int32 ticks, const int16 fromColor, const int16 toColor) |
int16 | getVaryPercent () const |
void | setVaryPercent (const int16 percent, const int32 time) |
void | setVaryTime (const int32 ticks) |
void | setVaryTime (const int16 percent, const int32 ticks) |
void | varyOff () |
void | varyPause () |
void | varyOn () |
void | setTarget (const Palette &palette) |
void | setStart (const Palette &palette) |
void | mergeStart (const Palette &palette) |
void | mergeTarget (const Palette &palette) |
void | applyVary () |
void | kernelPalVarySet (const GuiResourceId paletteId, const int16 percent, const int32 ticks, const int16 fromColor, const int16 toColor) |
void | kernelPalVaryMergeTarget (const GuiResourceId paletteId) |
void | kernelPalVarySetTarget (const GuiResourceId paletteId) |
void | kernelPalVarySetStart (const GuiResourceId paletteId) |
void | kernelPalVaryMergeStart (const GuiResourceId paletteId) |
void | kernelPalVaryPause (const bool pause) |
const bool * | getCycleMap () const |
void | setCycle (const uint8 fromColor, const uint8 toColor, const int16 direction, const int16 delay) |
void | doCycle (const uint8 fromColor, const int16 speed) |
void | cycleOn (const uint8 fromColor) |
void | cyclePause (const uint8 fromColor) |
void | cycleAllOn () |
void | cycleAllPause () |
void | cycleOff (const uint8 fromColor) |
void | cycleAllOff () |
void | setFade (const uint16 percent, const uint8 fromColor, const uint16 toColor) |
void | fadeOff () |
void | applyFade () |
void | setGamma (const int16 level) |
|
inline |
Gets the palette that will be use for the next frame.
|
inline |
Gets the palette that is used for the current frame.
bool Sci::GfxPalette32::loadPalette | ( | const GuiResourceId | resourceId | ) |
Loads a palette into GfxPalette32 with the given resource ID.
int16 Sci::GfxPalette32::matchColor | ( | const uint8 | r, |
const uint8 | g, | ||
const uint8 | b | ||
) |
Finds the nearest color in the current palette matching the given RGB value.
uint8 Sci::GfxPalette32::getPlatformBlack | ( | ) | const |
Gets the palette index for black based on the platform
uint8 Sci::GfxPalette32::getPlatformWhite | ( | ) | const |
Gets the palette index for white based on the platform
void Sci::GfxPalette32::submit | ( | const Palette & | palette | ) |
Submits a palette to display. Entries marked as "used" in the submitted palette are merged into _sourcePalette
.
bool Sci::GfxPalette32::updateForFrame | ( | ) |
Applies all fades, cycles, remaps, and varies for the current frame to nextPalette
.
void Sci::GfxPalette32::updateFFrame | ( | ) |
Copies all palette entries from sourcePalette
to nextPalette
and applies remaps. Unlike updateForFrame
, this call does not apply fades, cycles, or varies.
void Sci::GfxPalette32::updateHardware | ( | ) |
Copies all entries from nextPalette
to currentPalette
and updates the backend's raw palette.
void Sci::GfxPalette32::setVary | ( | const Palette & | target, |
const int16 | percent, | ||
const int32 | ticks, | ||
const int16 | fromColor, | ||
const int16 | toColor | ||
) |
Blends the target
palette into the current palette over time
ticks.
target | The target palette. |
percent | The amount that the target palette should be blended into the source palette by the end of the vary. |
ticks | The number of ticks that it should take for the blend to be completed. |
fromColor | The first palette entry that should be blended. |
toColor | The last palette entry that should be blended. |
|
inline |
Gets the current vary blend amount.
void Sci::GfxPalette32::setVaryPercent | ( | const int16 | percent, |
const int32 | time | ||
) |
Changes the percentage of the current vary to percent
, to be completed over time
ticks, if there is a currently active vary target palette.
void Sci::GfxPalette32::setVaryTime | ( | const int32 | ticks | ) |
Changes the amount of time, in ticks, an in-progress palette vary should take to finish.
void Sci::GfxPalette32::setVaryTime | ( | const int16 | percent, |
const int32 | ticks | ||
) |
Changes the vary percent and time to perform the vary.
void Sci::GfxPalette32::varyOff | ( | ) |
Removes the active palette vary.
void Sci::GfxPalette32::varyPause | ( | ) |
Pauses any active palette vary.
void Sci::GfxPalette32::varyOn | ( | ) |
Unpauses any paused palette vary.
void Sci::GfxPalette32::setTarget | ( | const Palette & | palette | ) |
Sets the target palette for the blend.
void Sci::GfxPalette32::setStart | ( | const Palette & | palette | ) |
Sets the start palette for the blend.
void Sci::GfxPalette32::mergeStart | ( | const Palette & | palette | ) |
Merges a new start palette into the existing start palette.
void Sci::GfxPalette32::mergeTarget | ( | const Palette & | palette | ) |
Merges a new target palette into the existing target palette.
void Sci::GfxPalette32::applyVary | ( | ) |
Applies any active palette vary to _nextPalette
.
void Sci::GfxPalette32::setCycle | ( | const uint8 | fromColor, |
const uint8 | toColor, | ||
const int16 | direction, | ||
const int16 | delay | ||
) |
Cycle palette entries between fromColor
and toColor
, inclusive. Palette cyclers may not overlap. fromColor
is used in other methods as the key for looking up a cycler.
fromColor | The first color in the cycle. |
toColor | The last color in the cycle. |
delay | The number of ticks that should elapse between cycles. |
direction | A negative direction will cycle backwards instead of forwards. The numeric value of this argument is ignored; only its sign is used to determine direction. |
void Sci::GfxPalette32::doCycle | ( | const uint8 | fromColor, |
const int16 | speed | ||
) |
Performs a round of palette cycling.
fromColor | The color key for the cycler. |
speed | The number of entries that should be cycled this round. |
void Sci::GfxPalette32::cycleOn | ( | const uint8 | fromColor | ) |
Unpauses the cycler starting at fromColor
.
void Sci::GfxPalette32::cyclePause | ( | const uint8 | fromColor | ) |
Pauses the cycler starting at fromColor
.
void Sci::GfxPalette32::cycleAllOn | ( | ) |
Unpauses all cyclers.
void Sci::GfxPalette32::cycleAllPause | ( | ) |
Pauses all cyclers.
void Sci::GfxPalette32::cycleOff | ( | const uint8 | fromColor | ) |
Removes the cycler starting at fromColor
.
void Sci::GfxPalette32::cycleAllOff | ( | ) |
Removes all cyclers.
void Sci::GfxPalette32::setFade | ( | const uint16 | percent, |
const uint8 | fromColor, | ||
const uint16 | toColor | ||
) |
Sets the intensity level for a range of palette entries. An intensity of zero indicates total darkness. Intensity may also be set above 100 percent to increase the intensity of a palette entry.
void Sci::GfxPalette32::fadeOff | ( | ) |
Resets the intensity of all palette entries to 100%.
void Sci::GfxPalette32::applyFade | ( | ) |
Applies intensity values to the palette entries in _nextPalette
.
|
inline |
Sets the gamma correction level, from 0 (off) to numGammaTables
, inclusive.