ScummVM API documentation
Sherlock::Screen Class Reference
Inheritance diagram for Sherlock::Screen:
Sherlock::BaseSurface Graphics::Screen Sherlock::Fonts Graphics::ManagedSurface Sherlock::Scalpel::ScalpelScreen Sherlock::Tattoo::TattooScreen Sherlock::Scalpel::Scalpel3DOScreen

Public Member Functions

 Screen (SherlockEngine *vm)
 
SurfacegetBackBuffer ()
 
void activateBackBuffer1 ()
 
void activateBackBuffer2 ()
 
int equalizePalette (const byte palette[PALETTE_SIZE])
 
void fadeToBlack (int speed=2)
 
void fadeIn (const byte palette[PALETTE_SIZE], int speed=2)
 
void randomTransition ()
 
void verticalTransition ()
 
void print (const Common::Point &pt, uint color, MSVC_PRINTF const char *formatStr,...) GCC_PRINTF(4
 
void void gPrint (const Common::Point &pt, uint color, MSVC_PRINTF const char *formatStr,...) GCC_PRINTF(4
 
void void void restoreBackground (const Common::Rect &r)
 
void slamArea (int16 xp, int16 yp, int16 width, int16 height)
 
void slamRect (const Common::Rect &r)
 
void flushImage (ImageFrame *frame, const Common::Point &pt, int16 *xp, int16 *yp, int16 *width, int16 *height)
 
void flushScaleImage (ImageFrame *frame, const Common::Point &pt, int16 *xp, int16 *yp, int16 *width, int16 *height, int scaleVal)
 
void flushImage (ImageFrame *frame, const Common::Point &pt, Common::Rect &newBounds, int scaleVal)
 
void blockMove (const Common::Rect &r)
 
void blockMove ()
 
void vgaBar (const Common::Rect &r, int color)
 
void setDisplayBounds (const Common::Rect &r)
 
void resetDisplayBounds ()
 
Common::Rect getDisplayBounds ()
 
void synchronize (Serializer &s)
 
void writeString (const Common::String &str, const Common::Point &pt, uint overrideColor)
 
void initPaletteFade (int bytesToRead)
 
int fadeRead (Common::SeekableReadStream &stream, byte *buf, int totalSize)
 
- Public Member Functions inherited from Sherlock::BaseSurface
 BaseSurface ()
 
 BaseSurface (int width, int height)
 
 BaseSurface (int width_, int height_, const Graphics::PixelFormat &pf)
 
virtual void SHblitFrom (const Graphics::Surface &src)
 
virtual void SHblitFrom (const Graphics::Surface &src, const Common::Point &destPos)
 
virtual void SHblitFrom (const Graphics::Surface &src, const Common::Point &destPos, const Common::Rect &srcBounds)
 
virtual void SHbitmapBlitFrom (const byte *src, int width, int height, int pitchSrc, const Common::Point &pt, int overrideColor=0)
 
virtual void SHtransBlitFrom (const ImageFrame &src, const Common::Point &pt, bool flipped=false, int overrideColor=0, int scaleVal=0x100)
 
virtual void SHtransBlitFrom (const Graphics::Surface &src, const Common::Point &pt, bool flipped=false, int overrideColor=0, int scaleVal=0x100)
 
virtual void SHfillRect (const Common::Rect &r, uint color)
 
virtual uint16 width () const
 
virtual uint16 height () const
 
void writeString (const Common::String &str, const Common::Point &pt, uint overrideColor)
 
void writeFancyString (const Common::String &str, const Common::Point &pt, uint overrideColor1, uint overrideColor2)
 
- Public Member Functions inherited from Graphics::Screen
 Screen (int width, int height)
 
 Screen (int width, int height, PixelFormat pixelFormat)
 
bool isDirty () const
 
void makeAllDirty ()
 
virtual void clearDirtyRects ()
 
virtual void addDirtyRect (const Common::Rect &r)
 
virtual void update ()
 
virtual void updateScreen ()
 
void getPalette (byte palette[(256 *3)])
 
void getPalette (byte *palette, uint start, uint num)
 
void setPalette (const byte palette[(256 *3)])
 
void setPalette (const byte *palette, uint start, uint num)
 
void clearPalette ()
 
- Public Member Functions inherited from Graphics::ManagedSurface
bool clip (Common::Rect &srcBounds, Common::Rect &destBounds) const
 
 ManagedSurface ()
 
 ManagedSurface (const ManagedSurface &surf)
 
 ManagedSurface (int width, int height)
 
 ManagedSurface (int width, int height, const Graphics::PixelFormat &pixelFormat)
 
 ManagedSurface (ManagedSurface &surf, const Common::Rect &bounds)
 
 ManagedSurface (Surface *surf, DisposeAfterUse::Flag disposeAfterUse=DisposeAfterUse::YES)
 
 ManagedSurface (const Surface *surf)
 
virtual ~ManagedSurface ()
 
 operator const Surface & () const
 
const SurfacerawSurface () const
 
SurfacesurfacePtr ()
 
ManagedSurfaceoperator= (const ManagedSurface &surf)
 
bool empty () const
 
DisposeAfterUse::Flag disposeAfterUse () const
 
uint32 getPixel (int x, int y) const
 
void setPixel (int x, int y, uint32 pixel)
 
const void * getBasePtr (int x, int y) const
 
void * getBasePtr (int x, int y)
 
void * getPixels ()
 
const void * getPixels () const
 
virtual void setPixels (void *newPixels)
 
virtual void create (int16 width, int16 height)
 
virtual void create (int16 width, int16 height, const PixelFormat &pixelFormat)
 
virtual void create (ManagedSurface &surf, const Common::Rect &bounds)
 
virtual void free ()
 
const Common::Point getOffsetFromOwner () const
 
const Common::Rect getBounds () const
 
void blitFrom (const Surface &src, const Palette *srcPalette=nullptr)
 
void blitFrom (const Surface &src, const Common::Point &destPos, const Palette *srcPalette=nullptr)
 
void blitFrom (const Surface &src, const Common::Rect &srcRect, const Common::Point &destPos, const Palette *srcPalette=nullptr)
 
void blitFrom (const Surface &src, const Common::Rect &srcRect, const Common::Rect &destRect, const Palette *srcPalette=nullptr)
 
void blitFrom (const ManagedSurface &src, const Common::Rect &srcRect, const Common::Rect &destRect)
 
void blitFrom (const ManagedSurface &src)
 
void blitFrom (const ManagedSurface &src, const Common::Point &destPos)
 
void blitFrom (const ManagedSurface &src, const Common::Rect &srcRect, const Common::Point &destPos)
 
void transBlitFrom (const Surface &src, uint32 transColor=0, bool flipped=false, uint32 overrideColor=0, uint32 srcAlpha=0xff, const Palette *srcPalette=nullptr)
 
void transBlitFrom (const Surface &src, const Common::Point &destPos, uint32 transColor=0, bool flipped=false, uint32 overrideColor=0, uint32 srcAlpha=0xff, const Palette *srcPalette=nullptr)
 
void transBlitFrom (const Surface &src, const Common::Point &destPos, const ManagedSurface &mask, const Palette *srcPalette=nullptr)
 
void transBlitFrom (const Surface &src, const Common::Point &destPos, const Surface &mask, const Palette *srcPalette=nullptr)
 
void transBlitFrom (const Surface &src, const Common::Rect &srcRect, const Common::Point &destPos, uint32 transColor=0, bool flipped=false, uint32 overrideColor=0, uint32 srcAlpha=0xff, const Palette *srcPalette=nullptr)
 
void transBlitFrom (const Surface &src, const Common::Rect &srcRect, const Common::Rect &destRect, const Palette *srcPalette)
 
void transBlitFrom (const Surface &src, const Common::Rect &srcRect, const Common::Rect &destRect, uint32 transColor=0, bool flipped=false, uint32 overrideColor=0, uint32 srcAlpha=0xff, const Surface *mask=nullptr, bool maskOnly=false, const Palette *srcPalette=nullptr)
 
void transBlitFrom (const ManagedSurface &src, uint32 transColor=0, bool flipped=false, uint32 overrideColor=0, uint32 srcAlpha=0xff)
 
void transBlitFrom (const ManagedSurface &src, const Common::Point &destPos, uint32 transColor=0, bool flipped=false, uint32 overrideColor=0, uint32 srcAlpha=0xff)
 
void transBlitFrom (const ManagedSurface &src, const Common::Point &destPos, const ManagedSurface &mask)
 
void transBlitFrom (const ManagedSurface &src, const Common::Rect &srcRect, const Common::Point &destPos, uint32 transColor=0, bool flipped=false, uint32 overrideColor=0, uint32 srcAlpha=0xff)
 
void transBlitFrom (const ManagedSurface &src, const Common::Rect &srcRect, const Common::Rect &destRect, uint32 transColor=0, bool flipped=false, uint32 overrideColor=0, uint32 srcAlpha=0xff, const Surface *mask=nullptr, bool maskOnly=false)
 
void rawBlitFrom (const ManagedSurface &src, const Common::Rect &srcRect, const Common::Point &destPos)
 
Common::Rect blendBlitTo (ManagedSurface &target, const int posX=0, const int posY=0, const int flipping=FLIP_NONE, const Common::Rect *srcRect=nullptr, const uint colorMod=(uint32)(((255)<< 24)|((255)<< 16)|((255)<< 8)|(255)), const int width=-1, const int height=-1, const TSpriteBlendMode blend=BLEND_NORMAL, const AlphaType alphaType=ALPHA_FULL)
 Renders this surface onto target. More...
 
Common::Rect blendBlitTo (Surface &target, const int posX=0, const int posY=0, const int flipping=FLIP_NONE, const Common::Rect *srcRect=nullptr, const uint colorMod=(uint32)(((255)<< 24)|((255)<< 16)|((255)<< 8)|(255)), const int width=-1, const int height=-1, const TSpriteBlendMode blend=BLEND_NORMAL, const AlphaType alphaType=ALPHA_FULL)
 
void clear (uint32 color=0)
 
void markAllDirty ()
 
void copyRectToSurface (const void *buffer, int srcPitch, int destX, int destY, int width, int height)
 
void copyRectToSurface (const Graphics::Surface &srcSurface, int destX, int destY, const Common::Rect subRect)
 
void copyRectToSurfaceWithKey (const void *buffer, int srcPitch, int destX, int destY, int width, int height, uint32 key)
 
void copyRectToSurfaceWithKey (const Graphics::Surface &srcSurface, int destX, int destY, const Common::Rect subRect, uint32 key)
 
void copyFrom (const ManagedSurface &surf)
 
void copyFrom (const Surface &surf)
 
void drawLine (int x0, int y0, int x1, int y1, uint32 color)
 
void drawThickLine (int x0, int y0, int x1, int y1, int penX, int penY, uint32 color)
 
void hLine (int x, int y, int x2, uint32 color)
 
void vLine (int x, int y, int y2, uint32 color)
 
void fillRect (Common::Rect r, uint32 color)
 
void frameRect (const Common::Rect &r, uint32 color)
 
Surface getSubArea (const Common::Rect &area)
 
void convertToInPlace (const PixelFormat &dstFormat)
 
void convertToInPlace (const PixelFormat &dstFormat, const byte *palette, uint16 paletteCount)
 
uint getTransparentColor () const
 
void setTransparentColor (uint32 color)
 
void clearTransparentColor ()
 
bool hasTransparentColor () const
 
void clearPalette ()
 
bool hasPalette () const
 
void grabPalette (byte *colors, uint start, uint num) const
 
void setPalette (const byte *colors, uint start, uint num)
 
- Public Member Functions inherited from Sherlock::Fonts
void setFont (int fontNum)
 
int stringWidth (const Common::String &str)
 
int stringHeight (const Common::String &str)
 
int charWidth (const char *str, int &idx)
 
int charWidth (char ch)
 
int charHeight (unsigned char c)
 
int fontHeight () const
 
int widestChar () const
 
int fontNumber () const
 
Common::Array< Common::StringwordWrap (const Common::String &str, uint maxWidth, Common::String &rem, uint maxChars=Common::String::npos, uint maxLines=Common::String::npos, bool skipHeadAt=false)
 
Common::Array< Common::StringwordWrap (const Common::String &str, uint maxWidth, uint maxChars=Common::String::npos, uint maxLines=Common::String::npos, bool skipHeadAt=false)
 

Static Public Member Functions

static Screeninit (SherlockEngine *vm)
 
static void translatePalette (byte palette[PALETTE_SIZE])
 
- Static Public Member Functions inherited from Graphics::ManagedSurface
static bool isBlendBlitPixelFormatSupported (const PixelFormat &src, const PixelFormat &dst)
 
- Static Public Member Functions inherited from Sherlock::Fonts
static void setVm (SherlockEngine *vm)
 
static void freeFont ()
 
static bool isModifiedEucCn ()
 
static bool isBig5 ()
 
static Common::String unescape (const Common::String &in)
 

Public Attributes

Surface _backBuffer1
 
Surface _backBuffer2
 
bool _fadeStyle
 
byte _cMap [PALETTE_SIZE]
 
byte _sMap [PALETTE_SIZE]
 
byte _tMap [PALETTE_SIZE]
 
bool _flushScreen
 
Common::Point _currentScroll
 
- Public Attributes inherited from Graphics::ManagedSurface
int16 & w
 
int16 & h
 
int32 & pitch
 
PixelFormatformat
 

Protected Attributes

SherlockEngine_vm
 
Surface _backBuffer
 
- Protected Attributes inherited from Graphics::Screen
Common::List< Common::Rect_dirtyRects
 

Additional Inherited Members

- Static Public Attributes inherited from Sherlock::Fonts
static const int kChineseWidth = 16
 
static const int kChineseHeight = 16
 
- Protected Member Functions inherited from Graphics::Screen
void mergeDirtyRects ()
 
bool unionRectangle (Common::Rect &destRect, const Common::Rect &src1, const Common::Rect &src2)
 
- Protected Member Functions inherited from Graphics::ManagedSurface
void blitFromInner (const Surface &src, const Common::Rect &srcRect, const Common::Rect &destRect, const Palette *srcPalette)
 
void transBlitFromInner (const Surface &src, const Common::Rect &srcRect, const Common::Rect &destRect, uint32 transColor, bool flipped, uint32 overrideColor, uint32 srcAlpha, const Palette *srcPalette, const Palette *dstPalette, const Surface *mask, bool maskOnly)
 
- Static Protected Member Functions inherited from Sherlock::Fonts
static void writeString (BaseSurface *surface, const Common::String &str, const Common::Point &pt, int overrideColor=0)
 
- Static Protected Attributes inherited from Sherlock::Fonts
static SherlockEngine_vm
 

Member Function Documentation

◆ getBackBuffer()

Surface* Sherlock::Screen::getBackBuffer ( )
inline

Obtain the currently active back buffer.

◆ activateBackBuffer1()

void Sherlock::Screen::activateBackBuffer1 ( )

Makes first back buffer active.

◆ activateBackBuffer2()

void Sherlock::Screen::activateBackBuffer2 ( )

Makes second back buffer active.

◆ equalizePalette()

int Sherlock::Screen::equalizePalette ( const byte  palette[PALETTE_SIZE])

Fades from the currently active palette to the passed palette

◆ fadeToBlack()

void Sherlock::Screen::fadeToBlack ( int  speed = 2)

Fade out the palette to black

◆ fadeIn()

void Sherlock::Screen::fadeIn ( const byte  palette[PALETTE_SIZE],
int  speed = 2 
)

Fade in a given palette

◆ randomTransition()

void Sherlock::Screen::randomTransition ( )

Do a random pixel transition in from _backBuffer surface to the screen

◆ verticalTransition()

void Sherlock::Screen::verticalTransition ( )

Transition to the surface from _backBuffer using a vertical transition

◆ print()

void Sherlock::Screen::print ( const Common::Point pt,
uint  color,
MSVC_PRINTF const char *  formatStr,
  ... 
)

Prints the text passed onto the back buffer at the given position and color. The string is then blitted to the screen

◆ gPrint()

void void Sherlock::Screen::gPrint ( const Common::Point pt,
uint  color,
MSVC_PRINTF const char *  formatStr,
  ... 
)

Print a strings onto the back buffer without blitting it to the screen

◆ restoreBackground()

void void void Sherlock::Screen::restoreBackground ( const Common::Rect r)

Copies a section of the second back buffer into the main back buffer

◆ slamArea()

void Sherlock::Screen::slamArea ( int16  xp,
int16  yp,
int16  width,
int16  height 
)

Copies a given area to the screen

◆ slamRect()

void Sherlock::Screen::slamRect ( const Common::Rect r)

Copies a given area to the screen

◆ flushImage() [1/2]

void Sherlock::Screen::flushImage ( ImageFrame frame,
const Common::Point pt,
int16 *  xp,
int16 *  yp,
int16 *  width,
int16 *  height 
)

Copy an image from the back buffer to the screen, taking care of both the new area covered by the shape as well as the old area, which must be restored

◆ flushScaleImage()

void Sherlock::Screen::flushScaleImage ( ImageFrame frame,
const Common::Point pt,
int16 *  xp,
int16 *  yp,
int16 *  width,
int16 *  height,
int  scaleVal 
)

Similar to flushImage, this method takes in an extra parameter for the scale proporation, which affects the calculated bounds accordingly

◆ flushImage() [2/2]

void Sherlock::Screen::flushImage ( ImageFrame frame,
const Common::Point pt,
Common::Rect newBounds,
int  scaleVal 
)

Variation of flushImage/flushScaleImage that takes in and updates a rect

◆ blockMove() [1/2]

void Sherlock::Screen::blockMove ( const Common::Rect r)

Copies data from the back buffer to the screen

◆ blockMove() [2/2]

void Sherlock::Screen::blockMove ( )

Copies the entire screen from the back buffer

◆ vgaBar()

void Sherlock::Screen::vgaBar ( const Common::Rect r,
int  color 
)

Fills an area on the back buffer, and then copies it to the screen

◆ setDisplayBounds()

void Sherlock::Screen::setDisplayBounds ( const Common::Rect r)

Sets the active back buffer pointer to a restricted sub-area of the first back buffer

◆ resetDisplayBounds()

void Sherlock::Screen::resetDisplayBounds ( )

Resets the active buffer pointer to point back to the full first back buffer

◆ getDisplayBounds()

Common::Rect Sherlock::Screen::getDisplayBounds ( )

Return the size of the current display window

◆ synchronize()

void Sherlock::Screen::synchronize ( Serializer s)

Synchronize the data for a savegame

◆ writeString()

void Sherlock::Screen::writeString ( const Common::String str,
const Common::Point pt,
uint  overrideColor 
)

Draws the given string into the back buffer using the images stored in _font

◆ translatePalette()

static void Sherlock::Screen::translatePalette ( byte  palette[PALETTE_SIZE])
static

Translate a palette from 6-bit RGB values to full 8-bit values suitable for passing to the underlying palette manager


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