ScummVM
Kyra::Screen_v2 Class Reference

#include <screen_v2.h>

Inheritance diagram for Kyra::Screen_v2:
Collaboration diagram for Kyra::Screen_v2:

Public Member Functions

 Screen_v2 (KyraEngine_v1 *vm, OSystem *system, const ScreenDim *dimTable, const int dimTableSize)
 
 ~Screen_v2 ()
 
void checkedPageUpdate (int srcPage, int dstPage)
 
uint8generateOverlay (const Palette &pal, uint8 *buffer, int color, uint weight, int maxColor=-1)
 
void applyOverlay (int x, int y, int w, int h, int pageNum, const uint8 *overlay)
 
int findLeastDifferentColor (const uint8 *paletteEntry, const Palette &pal, uint8 firstColor, uint16 numColors, bool skipSpecialColors=false)
 
virtual void getFadeParams (const Palette &pal, int delay, int &delayInc, int &diff)
 
bool timedPaletteFadeStep (uint8 *pal1, uint8 *pal2, uint32 elapsedTime, uint32 totalTime)
 
uint8getPtrToShape (uint8 *shpFile, int shape)
 
const uint8getPtrToShape (const uint8 *shpFile, int shape)
 
int getShapeScaledWidth (const uint8 *shpFile, int scale)
 
int getShapeScaledHeight (const uint8 *shpFile, int scale)
 
uint16 getShapeSize (const uint8 *shp)
 
uint8makeShapeCopy (const uint8 *src, int index)
 
int getRectSize (int w, int h)
 
bool calcBounds (int w0, int h0, int &x1, int &y1, int &w1, int &h1, int &x2, int &y2, int &w2)
 
void setTextColorMap (const uint8 *cmap)
 
virtual int getLayer (int x, int y)
 
void wsaFrameAnimationStep (int x1, int y1, int x2, int y2, int w1, int h1, int w2, int h2, int srcPage, int dstPage, int dim)
 
void copyPageMemory (int srcPage, int srcPos, int dstPage, int dstPos, int numBytes)
 
void copyRegionEx (int srcPage, int srcW, int srcH, int dstPage, int dstX, int dstY, int dstW, int dstH, const ScreenDim *d, bool flag=false)
 
- Public Member Functions inherited from Kyra::Screen
 Screen (KyraEngine_v1 *vm, OSystem *system, const ScreenDim *dimTable, const int dimTableSize)
 
virtual ~Screen ()
 
virtual bool init ()
 
virtual void setResolution ()
 
virtual void enableHiColorMode (bool enabled)
 
void updateScreen ()
 
bool queryScreenDebug () const
 
bool enableScreenDebug (bool enable)
 
int setCurPage (int pageNum)
 
void clearCurPage ()
 
void copyWsaRect (int x, int y, int w, int h, int dimState, int plotFunc, const uint8 *src, int unk1, const uint8 *unkPtr1, const uint8 *unkPtr2)
 
void copyToPage0 (int y, int h, uint8 page, uint8 *seqBuf)
 
void shakeScreen (int times)
 
void copyRegion (int x1, int y1, int x2, int y2, int w, int h, int srcPage, int dstPage, int flags=0)
 
void copyPage (uint8 srcPage, uint8 dstPage)
 
void copyRegionToBuffer (int pageNum, int x, int y, int w, int h, uint8 *dest)
 
void copyBlockToPage (int pageNum, int x, int y, int w, int h, const uint8 *src)
 
void shuffleScreen (int sx, int sy, int w, int h, int srcPage, int dstPage, int ticks, bool transparent)
 
void fillRect (int x1, int y1, int x2, int y2, uint8 color, int pageNum=-1, bool xored=false)
 
void clearPage (int pageNum)
 
int getPagePixel (int pageNum, int x, int y)
 
void setPagePixel (int pageNum, int x, int y, uint8 color)
 
const uint8getCPagePtr (int pageNum) const
 
uint8getPageRect (int pageNum, int x, int y, int w, int h)
 
void fadeFromBlack (int delay=0x54, const UpdateFunctor *upFunc=0)
 
void fadeToBlack (int delay=0x54, const UpdateFunctor *upFunc=0)
 
virtual void fadePalette (const Palette &pal, int delay, const UpdateFunctor *upFunc=0)
 
virtual int fadePalStep (const Palette &pal, int diff)
 
void setPaletteIndex (uint8 index, uint8 red, uint8 green, uint8 blue)
 
virtual void setScreenPalette (const Palette &pal)
 
bool isInterfacePaletteEnabled () const
 
void enableInterfacePalette (bool e)
 
void setInterfacePalette (const Palette &pal, uint8 r, uint8 g, uint8 b)
 
virtual void getRealPalette (int num, uint8 *dst)
 
PalettegetPalette (int num)
 
void copyPalette (const int dst, const int src)
 
void drawLine (bool vertical, int x, int y, int length, int color)
 
void drawClippedLine (int x1, int y1, int x2, int y2, int color)
 
virtual void drawShadedBox (int x1, int y1, int x2, int y2, int color1, int color2)
 
void drawBox (int x1, int y1, int x2, int y2, int color)
 
virtual bool loadFont (FontId fontId, const char *filename)
 
FontId setFont (FontId fontId)
 
int getFontHeight () const
 
int getFontWidth () const
 
int getCharWidth (uint16 c) const
 
int getTextWidth (const char *str)
 
void printText (const char *str, int x, int y, uint8 color1, uint8 color2)
 
void setTextColor (const uint8 *cmap, int a, int b)
 
void setTextColor16bit (const uint16 *cmap16)
 
const ScreenDimgetScreenDim (int dim) const
 
void modifyScreenDim (int dim, int x, int y, int w, int h)
 
int screenDimTableCount () const
 
void setScreenDim (int dim)
 
int curDimIndex () const
 
uint8encodeShape (int x, int y, int w, int h, int flags)
 
int setNewShapeHeight (uint8 *shape, int height)
 
int resetShapeHeight (uint8 *shape)
 
virtual void drawShape (uint8 pageNum, const uint8 *shapeData, int x, int y, int sd, int flags,...)
 
void hideMouse ()
 
void showMouse ()
 
bool isMouseVisible () const
 
virtual void setMouseCursor (int x, int y, const byte *shape)
 
void rectClip (int &x, int &y, int w, int h)
 
virtual void loadBitmap (const char *filename, int tempPage, int dstPage, Palette *pal, bool skip=false)
 
virtual bool loadPalette (const char *filename, Palette &pal)
 
bool loadPaletteTable (const char *filename, int firstPalette)
 
virtual void loadPalette (const byte *data, Palette &pal, int bytes)
 
void setAnimBlockPtr (int size)
 
void setShapePages (int page1, int page2, int minY=-1, int maxY=201)
 
virtual byte getShapeFlag1 (int x, int y)
 
virtual byte getShapeFlag2 (int x, int y)
 
virtual int getDrawLayer (int x, int y)
 
virtual int getDrawLayer2 (int x, int y, int height)
 
void blockInRegion (int x, int y, int width, int height)
 
void blockOutRegion (int x, int y, int width, int height)
 
void crossFadeRegion (int x1, int y1, int x2, int y2, int w, int h, int srcPage, int dstPage)
 
uint16get16bitPalette ()
 
void set16bitShadingLevel (int lvl)
 

Protected Attributes

uint8_wsaFrameAnimBuffer
 
- Protected Attributes inherited from Kyra::Screen
uint8_pagePtrs [16]
 
uint8_sjisOverlayPtrs [SCREEN_OVLS_NUM]
 
uint8 _pageMapping [SCREEN_PAGE_NUM]
 
bool _useOverlays
 
bool _useSJIS
 
bool _use16ColorMode
 
bool _useHiResEGADithering
 
bool _useHiColorScreen
 
bool _isAmiga
 
bool _useAmigaExtraColors
 
Common::RenderMode _renderMode
 
int _bytesPerPixel
 
int _screenPageSize
 
uint8 _sjisInvisibleColor
 
bool _sjisMixedFontMode
 
Palette_screenPalette
 
Common::Array< Palette * > _palettes
 
Palette_internFadePalette
 
uint16_16bitPalette
 
uint16_16bitConversionPalette
 
uint8 _16bitShadingLevel
 
Font_fonts [FID_NUM]
 
uint8 _textColorsMap [16]
 
uint16 _textColorsMap16bit [2]
 
uint8_decodeShapeBuffer
 
int _decodeShapeBufferSize
 
uint8_animBlockPtr
 
int _animBlockSize
 
const ScreenDim *const _dimTable
 
ScreenDim ** _customDimTable
 
const int _dimTableCount
 
int _curDimIndex
 
int _mouseLockCount
 
const uint8 _cursorColorKey
 
bool _forceFullUpdate
 
bool _paletteChanged
 
Common::List< Common::Rect_dirtyRects
 
OSystem_system
 
KyraEngine_v1_vm
 
DsMarginSkipFunc _dsProcessMargin
 
DsMarginSkipFunc _dsScaleSkip
 
DsLineFunc _dsProcessLine
 
DsPlotFunc _dsPlot
 
const uint8_dsShapeFadingTable
 
int _dsShapeFadingLevel
 
const uint8_dsColorTable
 
const uint8_dsTransparencyTable1
 
const uint8_dsTransparencyTable2
 
const uint8_dsBackgroundFadingTable
 
int _dsDrawLayer
 
uint8_dsDstPage
 
int _dsTmpWidth
 
int _dsOffscreenLeft
 
int _dsOffscreenRight
 
int _dsScaleW
 
int _dsScaleH
 
int _dsOffscreenScaleVal1
 
int _dsOffscreenScaleVal2
 
int _drawShapeVar1
 
int _drawShapeVar3
 
int _drawShapeVar4
 
int _drawShapeVar5
 
bool _interfacePaletteEnabled
 
bool _debugEnabled
 

Additional Inherited Members

- Public Types inherited from Kyra::Screen
enum  {
  SCREEN_W = 320, SCREEN_H = 200, SCREEN_PAGE_SIZE = 320 * 200 + 1024, SCREEN_OVL_SJIS_SIZE = 640 * 400,
  SCREEN_PAGE_NUM = 16, SCREEN_OVLS_NUM = 6
}
 
enum  CopyRegionFlags { CR_NO_P_CHECK = 0x01 }
 
enum  DrawShapeFlags {
  DSF_X_FLIPPED = 0x01, DSF_Y_FLIPPED = 0x02, DSF_SCALE = 0x04, DSF_WND_COORDS = 0x10,
  DSF_CENTER = 0x20, DSF_SHAPE_FADING = 0x100, DSF_TRANSPARENCY = 0x1000, DSF_BACKGROUND_FADING = 0x2000,
  DSF_CUSTOM_PALETTE = 0x8000
}
 
enum  FontId {
  FID_6_FNT = 0, FID_8_FNT, FID_9_FNT, FID_CRED6_FNT,
  FID_CRED8_FNT, FID_BOOKFONT_FNT, FID_GOLDFONT_FNT, FID_INTRO_FNT,
  FID_SJIS_FNT, FID_SJIS_LARGE_FNT, FID_SJIS_SMALL_FNT, FID_NUM
}
 
- Static Public Member Functions inherited from Kyra::Screen
static void decodeFrame1 (const uint8 *src, uint8 *dst, uint32 size)
 
static uint16 decodeEGAGetCode (const uint8 *&pos, uint8 &nib)
 
static void decodeFrame3 (const uint8 *src, uint8 *dst, uint32 size, bool isAmiga)
 
static uint decodeFrame4 (const uint8 *src, uint8 *dst, uint32 dstSize)
 
static void decodeFrameDelta (uint8 *dst, const uint8 *src, bool noXor=false)
 
static void decodeFrameDeltaPage (uint8 *dst, const uint8 *src, const int pitch, bool noXor)
 
static void convertAmigaGfx (uint8 *data, int w, int h, int depth=5, bool wsa=false, int bytesPerPlane=-1)
 
static void convertAmigaMsc (uint8 *data)
 
- Public Attributes inherited from Kyra::Screen
const ScreenDim_curDim
 
int _charWidth
 
int _charOffset
 
int _curPage
 
uint8_shapePages [2]
 
int _maskMinY
 
int _maskMaxY
 
FontId _currentFont
 
- Protected Types inherited from Kyra::Screen
enum  { kMaxDirtyRects = 50 }
 
typedef int(Screen::* DsMarginSkipFunc) (uint8 *&dst, const uint8 *&src, int &cnt)
 
typedef void(Screen::* DsLineFunc) (uint8 *&dst, const uint8 *&src, int &cnt, int16 scaleState)
 
typedef void(Screen::* DsPlotFunc) (uint8 *dst, uint8 cmd)
 
- Protected Member Functions inherited from Kyra::Screen
void resetPagePtrsAndBuffers (int pageSize)
 
uint8getPagePtr (int pageNum)
 
virtual void updateDirtyRects ()
 
void updateDirtyRectsAmiga ()
 
void updateDirtyRectsOvl ()
 
void scale2x (byte *dst, int dstPitch, const byte *src, int srcPitch, int w, int h)
 
virtual void mergeOverlay (int x, int y, int w, int h)
 
bytegetOverlayPtr (int pageNum)
 
void clearOverlayPage (int pageNum)
 
void clearOverlayRect (int pageNum, int x, int y, int w, int h)
 
void copyOverlayRegion (int x, int y, int x2, int y2, int w, int h, int srcPage, int dstPage)
 
uint16 fetchChar (const char *&s) const
 
void drawChar (uint16 c, int x, int y)
 
int16 encodeShapeAndCalculateSize (uint8 *from, uint8 *to, int size)
 
uint16 shade16bitColor (uint16 col)
 
virtual void postProcessCursor (uint8 *data, int w, int h, int pitch)
 
void addDirtyRect (int x, int y, int w, int h)
 
int drawShapeMarginNoScaleUpwind (uint8 *&dst, const uint8 *&src, int &cnt)
 
int drawShapeMarginNoScaleDownwind (uint8 *&dst, const uint8 *&src, int &cnt)
 
int drawShapeMarginScaleUpwind (uint8 *&dst, const uint8 *&src, int &cnt)
 
int drawShapeMarginScaleDownwind (uint8 *&dst, const uint8 *&src, int &cnt)
 
int drawShapeSkipScaleUpwind (uint8 *&dst, const uint8 *&src, int &cnt)
 
int drawShapeSkipScaleDownwind (uint8 *&dst, const uint8 *&src, int &cnt)
 
void drawShapeProcessLineNoScaleUpwind (uint8 *&dst, const uint8 *&src, int &cnt, int16 scaleState)
 
void drawShapeProcessLineNoScaleDownwind (uint8 *&dst, const uint8 *&src, int &cnt, int16 scaleState)
 
void drawShapeProcessLineScaleUpwind (uint8 *&dst, const uint8 *&src, int &cnt, int16 scaleState)
 
void drawShapeProcessLineScaleDownwind (uint8 *&dst, const uint8 *&src, int &cnt, int16 scaleState)
 
void drawShapePlotType0 (uint8 *dst, uint8 cmd)
 
void drawShapePlotType1 (uint8 *dst, uint8 cmd)
 
void drawShapePlotType3_7 (uint8 *dst, uint8 cmd)
 
void drawShapePlotType4 (uint8 *dst, uint8 cmd)
 
void drawShapePlotType5 (uint8 *dst, uint8 cmd)
 
void drawShapePlotType6 (uint8 *dst, uint8 cmd)
 
void drawShapePlotType8 (uint8 *dst, uint8 cmd)
 
void drawShapePlotType9 (uint8 *dst, uint8 cmd)
 
void drawShapePlotType11_15 (uint8 *dst, uint8 cmd)
 
void drawShapePlotType12 (uint8 *dst, uint8 cmd)
 
void drawShapePlotType13 (uint8 *dst, uint8 cmd)
 
void drawShapePlotType14 (uint8 *dst, uint8 cmd)
 
void drawShapePlotType16 (uint8 *dst, uint8 cmd)
 
void drawShapePlotType20 (uint8 *dst, uint8 cmd)
 
void drawShapePlotType21 (uint8 *dst, uint8 cmd)
 
void drawShapePlotType33 (uint8 *dst, uint8 cmd)
 
void drawShapePlotType37 (uint8 *dst, uint8 cmd)
 
void drawShapePlotType48 (uint8 *dst, uint8 cmd)
 
void drawShapePlotType52 (uint8 *dst, uint8 cmd)
 
- Static Protected Member Functions inherited from Kyra::Screen
template<bool noXor>
static void wrapped_decodeFrameDelta (uint8 *dst, const uint8 *src)
 
template<bool noXor>
static void wrapped_decodeFrameDeltaPage (uint8 *dst, const uint8 *src, const int pitch)
 

Detailed Description

Definition at line 31 of file screen_v2.h.

Constructor & Destructor Documentation

◆ Screen_v2()

Kyra::Screen_v2::Screen_v2 ( KyraEngine_v1 vm,
OSystem system,
const ScreenDim dimTable,
const int  dimTableSize 
)

Definition at line 29 of file screen_v2.cpp.

◆ ~Screen_v2()

Kyra::Screen_v2::~Screen_v2 ( )

Definition at line 35 of file screen_v2.cpp.

Member Function Documentation

◆ applyOverlay()

void Kyra::Screen_v2::applyOverlay ( int  x,
int  y,
int  w,
int  h,
int  pageNum,
const uint8 overlay 
)

Definition at line 105 of file screen_v2.cpp.

◆ calcBounds()

bool Kyra::Screen_v2::calcBounds ( int  w0,
int  h0,
int x1,
int y1,
int w1,
int h1,
int x2,
int y2,
int w2 
)

Definition at line 395 of file screen_v2.cpp.

◆ checkedPageUpdate()

void Kyra::Screen_v2::checkedPageUpdate ( int  srcPage,
int  dstPage 
)

Definition at line 441 of file screen_v2.cpp.

◆ copyPageMemory()

void Kyra::Screen_v2::copyPageMemory ( int  srcPage,
int  srcPos,
int  dstPage,
int  dstPos,
int  numBytes 
)

Definition at line 353 of file screen_v2.cpp.

◆ copyRegionEx()

void Kyra::Screen_v2::copyRegionEx ( int  srcPage,
int  srcW,
int  srcH,
int  dstPage,
int  dstX,
int  dstY,
int  dstW,
int  dstH,
const ScreenDim d,
bool  flag = false 
)

Definition at line 359 of file screen_v2.cpp.

◆ findLeastDifferentColor()

int Kyra::Screen_v2::findLeastDifferentColor ( const uint8 paletteEntry,
const Palette pal,
uint8  firstColor,
uint16  numColors,
bool  skipSpecialColors = false 
)

Definition at line 119 of file screen_v2.cpp.

◆ generateOverlay()

uint8 * Kyra::Screen_v2::generateOverlay ( const Palette pal,
uint8 buffer,
int  color,
uint  weight,
int  maxColor = -1 
)

Definition at line 39 of file screen_v2.cpp.

◆ getFadeParams()

void Kyra::Screen_v2::getFadeParams ( const Palette pal,
int  delay,
int delayInc,
int diff 
)
virtual

Reimplemented from Kyra::Screen.

Definition at line 143 of file screen_v2.cpp.

◆ getLayer()

int Kyra::Screen_v2::getLayer ( int  x,
int  y 
)
virtual

Reimplemented in Kyra::Screen_MR.

Definition at line 249 of file screen_v2.cpp.

◆ getPtrToShape() [1/2]

uint8 * Kyra::Screen_v2::getPtrToShape ( uint8 shpFile,
int  shape 
)

Definition at line 204 of file screen_v2.cpp.

◆ getPtrToShape() [2/2]

const uint8 * Kyra::Screen_v2::getPtrToShape ( const uint8 shpFile,
int  shape 
)

Definition at line 193 of file screen_v2.cpp.

◆ getRectSize()

int Kyra::Screen_v2::getRectSize ( int  w,
int  h 
)
virtual

Implements Kyra::Screen.

Definition at line 270 of file screen_v2.cpp.

◆ getShapeScaledHeight()

int Kyra::Screen_v2::getShapeScaledHeight ( const uint8 shpFile,
int  scale 
)

Definition at line 222 of file screen_v2.cpp.

◆ getShapeScaledWidth()

int Kyra::Screen_v2::getShapeScaledWidth ( const uint8 shpFile,
int  scale 
)

Definition at line 215 of file screen_v2.cpp.

◆ getShapeSize()

uint16 Kyra::Screen_v2::getShapeSize ( const uint8 shp)

Definition at line 229 of file screen_v2.cpp.

◆ makeShapeCopy()

uint8 * Kyra::Screen_v2::makeShapeCopy ( const uint8 src,
int  index 
)

Definition at line 235 of file screen_v2.cpp.

◆ setTextColorMap()

void Kyra::Screen_v2::setTextColorMap ( const uint8 cmap)
virtual

Implements Kyra::Screen.

Definition at line 276 of file screen_v2.cpp.

◆ timedPaletteFadeStep()

bool Kyra::Screen_v2::timedPaletteFadeStep ( uint8 pal1,
uint8 pal2,
uint32  elapsedTime,
uint32  totalTime 
)

Definition at line 165 of file screen_v2.cpp.

◆ wsaFrameAnimationStep()

void Kyra::Screen_v2::wsaFrameAnimationStep ( int  x1,
int  y1,
int  x2,
int  y2,
int  w1,
int  h1,
int  w2,
int  h2,
int  srcPage,
int  dstPage,
int  dim 
)

Definition at line 280 of file screen_v2.cpp.

Member Data Documentation

◆ _wsaFrameAnimBuffer

uint8* Kyra::Screen_v2::_wsaFrameAnimBuffer
protected

Definition at line 76 of file screen_v2.h.


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