ScummVM API documentation
Sci::GfxPalette32 Class Reference

Public Types

enum  { numGammaTables = 6 }
 

Public Member Functions

 GfxPalette32 (ResourceManager *resMan)
 
void saveLoadWithSerializer (Common::Serializer &s)
 
const PalettegetNextPalette () const
 
const PalettegetCurrentPalette () 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)
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
numGammaTables 

The number of available gamma corrections.

Member Function Documentation

◆ getNextPalette()

const Palette& Sci::GfxPalette32::getNextPalette ( ) const
inline

Gets the palette that will be use for the next frame.

◆ getCurrentPalette()

const Palette& Sci::GfxPalette32::getCurrentPalette ( ) const
inline

Gets the palette that is used for the current frame.

◆ loadPalette()

bool Sci::GfxPalette32::loadPalette ( const GuiResourceId  resourceId)

Loads a palette into GfxPalette32 with the given resource ID.

◆ matchColor()

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.

◆ getPlatformBlack()

uint8 Sci::GfxPalette32::getPlatformBlack ( ) const

Gets the palette index for black based on the platform

◆ getPlatformWhite()

uint8 Sci::GfxPalette32::getPlatformWhite ( ) const

Gets the palette index for white based on the platform

◆ submit()

void Sci::GfxPalette32::submit ( const Palette palette)

Submits a palette to display. Entries marked as "used" in the submitted palette are merged into _sourcePalette.

◆ updateForFrame()

bool Sci::GfxPalette32::updateForFrame ( )

Applies all fades, cycles, remaps, and varies for the current frame to nextPalette.

◆ updateFFrame()

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.

◆ updateHardware()

void Sci::GfxPalette32::updateHardware ( )

Copies all entries from nextPalette to currentPalette and updates the backend's raw palette.

◆ setVary()

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.

Parameters
targetThe target palette.
percentThe amount that the target palette should be blended into the source palette by the end of the vary.
ticksThe number of ticks that it should take for the blend to be completed.
fromColorThe first palette entry that should be blended.
toColorThe last palette entry that should be blended.

◆ getVaryPercent()

int16 Sci::GfxPalette32::getVaryPercent ( ) const
inline

Gets the current vary blend amount.

◆ setVaryPercent()

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.

◆ setVaryTime() [1/2]

void Sci::GfxPalette32::setVaryTime ( const int32  ticks)

Changes the amount of time, in ticks, an in-progress palette vary should take to finish.

◆ setVaryTime() [2/2]

void Sci::GfxPalette32::setVaryTime ( const int16  percent,
const int32  ticks 
)

Changes the vary percent and time to perform the vary.

◆ varyOff()

void Sci::GfxPalette32::varyOff ( )

Removes the active palette vary.

◆ varyPause()

void Sci::GfxPalette32::varyPause ( )

Pauses any active palette vary.

◆ varyOn()

void Sci::GfxPalette32::varyOn ( )

Unpauses any paused palette vary.

◆ setTarget()

void Sci::GfxPalette32::setTarget ( const Palette palette)

Sets the target palette for the blend.

◆ setStart()

void Sci::GfxPalette32::setStart ( const Palette palette)

Sets the start palette for the blend.

◆ mergeStart()

void Sci::GfxPalette32::mergeStart ( const Palette palette)

Merges a new start palette into the existing start palette.

◆ mergeTarget()

void Sci::GfxPalette32::mergeTarget ( const Palette palette)

Merges a new target palette into the existing target palette.

◆ applyVary()

void Sci::GfxPalette32::applyVary ( )

Applies any active palette vary to _nextPalette.

◆ setCycle()

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.

Parameters
fromColorThe first color in the cycle.
toColorThe last color in the cycle.
delayThe number of ticks that should elapse between cycles.
directionA negative direction will cycle backwards instead of forwards. The numeric value of this argument is ignored; only its sign is used to determine direction.

◆ doCycle()

void Sci::GfxPalette32::doCycle ( const uint8  fromColor,
const int16  speed 
)

Performs a round of palette cycling.

Parameters
fromColorThe color key for the cycler.
speedThe number of entries that should be cycled this round.

◆ cycleOn()

void Sci::GfxPalette32::cycleOn ( const uint8  fromColor)

Unpauses the cycler starting at fromColor.

◆ cyclePause()

void Sci::GfxPalette32::cyclePause ( const uint8  fromColor)

Pauses the cycler starting at fromColor.

◆ cycleAllOn()

void Sci::GfxPalette32::cycleAllOn ( )

Unpauses all cyclers.

◆ cycleAllPause()

void Sci::GfxPalette32::cycleAllPause ( )

Pauses all cyclers.

◆ cycleOff()

void Sci::GfxPalette32::cycleOff ( const uint8  fromColor)

Removes the cycler starting at fromColor.

◆ cycleAllOff()

void Sci::GfxPalette32::cycleAllOff ( )

Removes all cyclers.

◆ setFade()

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.

◆ fadeOff()

void Sci::GfxPalette32::fadeOff ( )

Resets the intensity of all palette entries to 100%.

◆ applyFade()

void Sci::GfxPalette32::applyFade ( )

Applies intensity values to the palette entries in _nextPalette.

◆ setGamma()

void Sci::GfxPalette32::setGamma ( const int16  level)
inline

Sets the gamma correction level, from 0 (off) to numGammaTables, inclusive.


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