ScummVM API documentation
TwinE::Screens Class Reference

Public Member Functions

 Screens (TwinEEngine *engine)
 
int32 mapLba2Palette (int32 palIndex)
 
bool adelineLogo ()
 
void convertPalToRGBA (const uint8 *in, uint32 *out)
 
void setDarkPal ()
 
void setNormalPal ()
 
void loadCustomPalette (const TwineResource &resource)
 
void loadMenuImage (bool fadeIn=true)
 
void loadImage (TwineImage image, bool fadeIn=true)
 
bool loadImageDelay (TwineImage image, int32 seconds)
 
bool loadBitmapDelay (const char *image, int32 seconds)
 
void fadeIn (const uint32 *palette)
 
void fadeOut (const uint32 *palette)
 
int32 lerp (int32 value, int32 start, int32 end, int32 t)
 
void adjustCrossPalette (const uint32 *pal1, const uint32 *pal2)
 
void fadeToBlack (const uint32 *palette)
 
void fadeToPal (const uint32 *palette)
 
void blackToWhite ()
 
void setBackPal ()
 
void fadePalRed (const uint32 *palette)
 
void fadeRedPal (const uint32 *palette)
 
void copyScreen (const Graphics::ManagedSurface &source, Graphics::ManagedSurface &destination)
 
void clearScreen ()
 
void initPalettes ()
 

Public Attributes

uint8 _palette [NUMOFCOLORS *3] {0}
 
uint32 _paletteRGBA [NUMOFCOLORS] {0}
 
uint32 _paletteRGBACustom [NUMOFCOLORS] {0}
 
bool _palResetted = false
 
bool _fadePalette = false
 
bool _useAlternatePalette = false
 
uint32 _mainPaletteRGBA [NUMOFCOLORS] {0}
 

Member Function Documentation

◆ adelineLogo()

bool TwinE::Screens::adelineLogo ( )

Load and display Adeline Logo

◆ setDarkPal()

void TwinE::Screens::setDarkPal ( )
See also
setNormalPal

◆ setNormalPal()

void TwinE::Screens::setNormalPal ( )
See also
setDarkPal() Reset the palette to the main palette after the script changed it via setDarkPal()

◆ loadCustomPalette()

void TwinE::Screens::loadCustomPalette ( const TwineResource resource)

Load a custom palette

Parameters
indexRESS.HQR entry index (starting from 0)

◆ loadMenuImage()

void TwinE::Screens::loadMenuImage ( bool  fadeIn = true)

Load and display Main Menu image

◆ loadImage()

void TwinE::Screens::loadImage ( TwineImage  image,
bool  fadeIn = true 
)

Load and display a particulary image on RESS.HQR file with cross fade effect

Parameters
indexRESS.HQR entry index (starting from 0)
paletteIndexRESS.HQR entry index of the palette for the given image. This is often the index + 1
fadeInif we fade in before using the palette

◆ loadImageDelay()

bool TwinE::Screens::loadImageDelay ( TwineImage  image,
int32  seconds 
)

Load and display a particulary image on RESS.HQR file with cross fade effect and delay

Parameters
indexRESS.HQR entry index (starting from 0)
paletteIndexRESS.HQR entry index of the palette for the given image. This is often the index + 1
secondsnumber of seconds to delay
Returns
true if aborted

◆ fadeIn()

void TwinE::Screens::fadeIn ( const uint32 *  palette)

Fade image in

Parameters
palettecurrent palette to fade in

◆ fadeOut()

void TwinE::Screens::fadeOut ( const uint32 *  palette)

Fade image out

Parameters
palettecurrent palette to fade out

◆ lerp()

int32 TwinE::Screens::lerp ( int32  value,
int32  start,
int32  end,
int32  t 
)

Linear interpolation of the given value between start and end

Parameters
valuecolor component
startlower range
endupper range
tthe location in given range
Returns
the lerped value
Note
Doesn't clamp

◆ adjustCrossPalette()

void TwinE::Screens::adjustCrossPalette ( const uint32 *  pal1,
const uint32 *  pal2 
)

Adjust between two palettes

Parameters
pal1palette from adjust
pal2palette to adjust

◆ fadeToBlack()

void TwinE::Screens::fadeToBlack ( const uint32 *  palette)

Fade image to black

Parameters
palettecurrent palette to fade

◆ fadeToPal()

void TwinE::Screens::fadeToPal ( const uint32 *  palette)

Fade image with another palette source

Parameters
palettecurrent palette to fade

◆ blackToWhite()

void TwinE::Screens::blackToWhite ( )

Fade black palette to white palette

◆ setBackPal()

void TwinE::Screens::setBackPal ( )

Resets both in-game and sdl palettes

◆ fadePalRed()

void TwinE::Screens::fadePalRed ( const uint32 *  palette)

Fade palette to red palette

Parameters
palettecurrent palette to fade

◆ fadeRedPal()

void TwinE::Screens::fadeRedPal ( const uint32 *  palette)

Fade red to palette

Parameters
palettecurrent palette to fade

◆ copyScreen()

void TwinE::Screens::copyScreen ( const Graphics::ManagedSurface source,
Graphics::ManagedSurface destination 
)

Copy a determinate screen buffer to another

Parameters
sourcescreen buffer
destinationscreen buffer

◆ clearScreen()

void TwinE::Screens::clearScreen ( )

Clear front buffer screen

◆ initPalettes()

void TwinE::Screens::initPalettes ( )

Init palettes

Member Data Documentation

◆ _palette

uint8 TwinE::Screens::_palette[NUMOFCOLORS *3] {0}

In-game palette (should not be used, except in special case. otherwise use other images functions instead)

◆ _paletteRGBA

uint32 TwinE::Screens::_paletteRGBA[NUMOFCOLORS] {0}

converted in-game palette

◆ _paletteRGBACustom

uint32 TwinE::Screens::_paletteRGBACustom[NUMOFCOLORS] {0}

converted custom palette

◆ _palResetted

bool TwinE::Screens::_palResetted = false

flag to check in the game palette was changed

◆ _fadePalette

bool TwinE::Screens::_fadePalette = false

flag to check if the main flag is locked

◆ _useAlternatePalette

bool TwinE::Screens::_useAlternatePalette = false

flag to check if we are using a different palette than the main one

◆ _mainPaletteRGBA

uint32 TwinE::Screens::_mainPaletteRGBA[NUMOFCOLORS] {0}

converted in-game palette


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