ScummVM API documentation
Titanic::CVideoSurface Class Referenceabstract
Inheritance diagram for Titanic::CVideoSurface:
Titanic::ListItem Titanic::CSaveableObject Titanic::OSVideoSurface

Public Member Functions

 CVideoSurface (CScreenManager *screenManager)
 
void setSurface (CScreenManager *screenManager, DirectDrawSurface *surface)
 
void load (SimpleFile *file) override
 
virtual void loadResource (const CResourceKey &key)=0
 
virtual void loadTarga (const CResourceKey &key)=0
 
virtual void loadJPEG (const CResourceKey &key)=0
 
virtual void loadTarga (const CString &name)=0
 
virtual void loadMovie (const CResourceKey &key, bool destroyFlag=false)=0
 
virtual bool lock ()=0
 
virtual void unlock ()=0
 
virtual bool hasSurface ()=0
 
virtual int getWidth ()=0
 
virtual int getHeight ()=0
 
virtual int getPitch ()=0
 
virtual int getBpp ()=0
 
virtual void recreate (int width, int height, int bpp=16)=0
 
virtual void resize (int width, int height, int bpp=16)=0
 
virtual void detachSurface ()=0
 
virtual int getPixelDepth ()=0
 
virtual uint16 getPixel (const Common::Point &pt)=0
 
virtual void setPixel (const Point &pt, uint pixel)=0
 
virtual void shiftColors ()=0
 
virtual void clear ()=0
 
virtual void playMovie (uint flags, CGameObject *obj)=0
 
virtual void playMovie (uint startFrame, uint endFrame, uint flags, CGameObject *obj)=0
 
virtual void playMovie (uint startFrame, uint endFrame, uint initialFrame, uint flags, CGameObject *obj)=0
 
virtual void stopMovie ()=0
 
virtual void setMovieFrame (uint frameNumber)=0
 
virtual void addMovieEvent (int eventId, CGameObject *obj)=0
 
virtual void setMovieFrameRate (double rate)=0
 
virtual const CMovieRangeInfoListgetMovieRangeInfo () const =0
 
virtual void flipVertically (bool needsLock=true)=0
 
virtual bool loadIfReady ()=0
 
virtual bool load ()=0
 
virtual void transPixelate ()=0
 
virtual bool hasFrame ()
 
virtual Graphics::ManagedSurfacedupMovieTransparency () const =0
 
virtual int freeSurface ()
 
virtual uint16 * getBasePtr (int x, int y)=0
 
void blitFrom (const Point &destPos, CVideoSurface *src, const Rect *srcRect=nullptr)
 
void blitFrom (const Point &destPos, const Graphics::Surface *src)
 
void setTransparencySurface (Graphics::ManagedSurface *surface)
 
const Graphics::SurfacegetTransparencySurface () const
 
uint16 * getPixels ()
 
Graphics::ManagedSurfacegetRawSurface ()
 
uint getTransparencyColor ()
 
void copyPixel (uint16 *destP, const uint16 *srcP, byte alpha, const Graphics::PixelFormat &srcFormat, bool isAlpha)
 
- Public Member Functions inherited from Titanic::ListItem
void save (SimpleFile *file, int indent) override
 
- Public Member Functions inherited from Titanic::CSaveableObject
virtual ClassDefgetType () const
 
bool isInstanceOf (const ClassDef *classDef) const
 
virtual void saveHeader (SimpleFile *file, int indent)
 
virtual void saveFooter (SimpleFile *file, int indent)
 

Static Public Member Functions

static void setup ()
 
- Static Public Member Functions inherited from Titanic::CSaveableObject
static void initClassList ()
 
static void freeClassList ()
 
static CSaveableObjectcreateInstance (const Common::String &name)
 

Public Attributes

CMovie_movie
 
DirectDrawSurface_ddSurface
 
bool _fastBlitFlag
 
bool _flipVertically
 
CResourceKey _resourceKey
 
TransparencyMode _transparencyMode
 
- Public Attributes inherited from Titanic::ListItem
 CLASSDEF
 

Protected Attributes

CScreenManager_screenManager
 
Graphics::ManagedSurface_rawSurface
 
bool _pendingLoad
 
Graphics::ManagedSurface_transparencySurface
 
DisposeAfterUse::Flag _freeTransparencySurface
 
int _videoSurfaceNum
 
bool _hasFrame
 
int _lockCount
 

Static Protected Attributes

static int _videoSurfaceCounter
 

Additional Inherited Members

- Static Public Attributes inherited from Titanic::CSaveableObject
static ClassDef_type
 

Member Function Documentation

◆ setup()

static void Titanic::CVideoSurface::setup ( )
inlinestatic

Setup statics

◆ setSurface()

void Titanic::CVideoSurface::setSurface ( CScreenManager screenManager,
DirectDrawSurface surface 
)

Set the underlying surface for this video surface

◆ load() [1/2]

void Titanic::CVideoSurface::load ( SimpleFile file)
inlineoverridevirtual

Load the data for the class from file

Reimplemented from Titanic::ListItem.

◆ loadResource()

virtual void Titanic::CVideoSurface::loadResource ( const CResourceKey key)
pure virtual

Load the surface with the passed resource

Implemented in Titanic::OSVideoSurface.

◆ loadTarga() [1/2]

virtual void Titanic::CVideoSurface::loadTarga ( const CResourceKey key)
pure virtual

Loads a Targa image file specified by the resource key

Implemented in Titanic::OSVideoSurface.

◆ loadJPEG()

virtual void Titanic::CVideoSurface::loadJPEG ( const CResourceKey key)
pure virtual

Loads a JPEG image file specified by the resource key

Implemented in Titanic::OSVideoSurface.

◆ loadTarga() [2/2]

virtual void Titanic::CVideoSurface::loadTarga ( const CString name)
pure virtual

Loads a Targa image file specified by the given name

Implemented in Titanic::OSVideoSurface.

◆ loadMovie()

virtual void Titanic::CVideoSurface::loadMovie ( const CResourceKey key,
bool  destroyFlag = false 
)
pure virtual

Loads a movie file specified by the resource key.

Parameters
keyResource key for movie to load
destroyFlagImmediately destroy movie after decoding first frame

Implemented in Titanic::OSVideoSurface.

◆ lock()

virtual bool Titanic::CVideoSurface::lock ( )
pure virtual

Lock the surface for direct access to the pixels

Implemented in Titanic::OSVideoSurface.

◆ unlock()

virtual void Titanic::CVideoSurface::unlock ( )
pure virtual

Unlocks the surface after prior calls to lock()

Implemented in Titanic::OSVideoSurface.

◆ hasSurface()

virtual bool Titanic::CVideoSurface::hasSurface ( )
pure virtual

Returns true if an underlying raw surface has been set

Implemented in Titanic::OSVideoSurface.

◆ getWidth()

virtual int Titanic::CVideoSurface::getWidth ( )
pure virtual

Returns the width of the surface

Implemented in Titanic::OSVideoSurface.

◆ getHeight()

virtual int Titanic::CVideoSurface::getHeight ( )
pure virtual

Returns the height of the surface

Implemented in Titanic::OSVideoSurface.

◆ getPitch()

virtual int Titanic::CVideoSurface::getPitch ( )
pure virtual

Returns the pitch of the surface in bytes

Implemented in Titanic::OSVideoSurface.

◆ getBpp()

virtual int Titanic::CVideoSurface::getBpp ( )
pure virtual

Returns the bytes per pixel of the surface

Implemented in Titanic::OSVideoSurface.

◆ recreate()

virtual void Titanic::CVideoSurface::recreate ( int  width,
int  height,
int  bpp = 16 
)
pure virtual

Recreates the surface

Implemented in Titanic::OSVideoSurface.

◆ resize()

virtual void Titanic::CVideoSurface::resize ( int  width,
int  height,
int  bpp = 16 
)
pure virtual

Resizes the surface

Implemented in Titanic::OSVideoSurface.

◆ detachSurface()

virtual void Titanic::CVideoSurface::detachSurface ( )
pure virtual

Detachs the underlying raw surface

Implemented in Titanic::OSVideoSurface.

◆ getPixelDepth()

virtual int Titanic::CVideoSurface::getPixelDepth ( )
pure virtual

Returns the number of bytes per pixel in the surface

Implemented in Titanic::OSVideoSurface.

◆ getPixel()

virtual uint16 Titanic::CVideoSurface::getPixel ( const Common::Point pt)
pure virtual

Gets the pixel at the specified position within the surface

Implemented in Titanic::OSVideoSurface.

◆ setPixel()

virtual void Titanic::CVideoSurface::setPixel ( const Point pt,
uint  pixel 
)
pure virtual

Sets a pixel at a specified position within the surface

Implemented in Titanic::OSVideoSurface.

◆ shiftColors()

virtual void Titanic::CVideoSurface::shiftColors ( )
pure virtual

Shifts the colors of the surface.. maybe greys it out?

Implemented in Titanic::OSVideoSurface.

◆ clear()

virtual void Titanic::CVideoSurface::clear ( )
pure virtual

Clears the entire surface to black

Implemented in Titanic::OSVideoSurface.

◆ playMovie() [1/3]

virtual void Titanic::CVideoSurface::playMovie ( uint  flags,
CGameObject obj 
)
pure virtual

Plays a movie, loading it from the specified _resource if not already loaded

Implemented in Titanic::OSVideoSurface.

◆ playMovie() [2/3]

virtual void Titanic::CVideoSurface::playMovie ( uint  startFrame,
uint  endFrame,
uint  flags,
CGameObject obj 
)
pure virtual

Plays a movie, loading it from the specified _resource if not already loaded

Implemented in Titanic::OSVideoSurface.

◆ playMovie() [3/3]

virtual void Titanic::CVideoSurface::playMovie ( uint  startFrame,
uint  endFrame,
uint  initialFrame,
uint  flags,
CGameObject obj 
)
pure virtual

Plays a movie, loading it from the specified _resource if not already loaded

Implemented in Titanic::OSVideoSurface.

◆ stopMovie()

virtual void Titanic::CVideoSurface::stopMovie ( )
pure virtual

Stops any movie currently attached to the surface

Implemented in Titanic::OSVideoSurface.

◆ setMovieFrame()

virtual void Titanic::CVideoSurface::setMovieFrame ( uint  frameNumber)
pure virtual

Set the current movie frame number

Implemented in Titanic::OSVideoSurface.

◆ addMovieEvent()

virtual void Titanic::CVideoSurface::addMovieEvent ( int  eventId,
CGameObject obj 
)
pure virtual

Adds a movie playback event

Implemented in Titanic::OSVideoSurface.

◆ setMovieFrameRate()

virtual void Titanic::CVideoSurface::setMovieFrameRate ( double  rate)
pure virtual

Set the movie frame rate

Implemented in Titanic::OSVideoSurface.

◆ getMovieRangeInfo()

virtual const CMovieRangeInfoList* Titanic::CVideoSurface::getMovieRangeInfo ( ) const
pure virtual

Return any movie range info associated with the surface's movie

Implemented in Titanic::OSVideoSurface.

◆ loadIfReady()

virtual bool Titanic::CVideoSurface::loadIfReady ( )
pure virtual

Loads the surface's resource if there's one pending

Implemented in Titanic::OSVideoSurface.

◆ load() [2/2]

virtual bool Titanic::CVideoSurface::load ( )
pure virtual

Loads the surface data based on the currently set resource key

Implemented in Titanic::OSVideoSurface.

◆ transPixelate()

virtual void Titanic::CVideoSurface::transPixelate ( )
pure virtual

Does a replacement of transparent pixels on certain lines at regular intervals. This is totally weird

Implemented in Titanic::OSVideoSurface.

◆ hasFrame()

virtual bool Titanic::CVideoSurface::hasFrame ( )
virtual

Returns true if there's a frame to display on the video surface

◆ dupMovieTransparency()

virtual Graphics::ManagedSurface* Titanic::CVideoSurface::dupMovieTransparency ( ) const
pure virtual

Duplicates movie transparency surface

Implemented in Titanic::OSVideoSurface.

◆ freeSurface()

virtual int Titanic::CVideoSurface::freeSurface ( )
inlinevirtual

Frees the underlying surface

Reimplemented in Titanic::OSVideoSurface.

◆ getBasePtr()

virtual uint16* Titanic::CVideoSurface::getBasePtr ( int  x,
int  y 
)
pure virtual

Get a pointer into the underlying surface

Implemented in Titanic::OSVideoSurface.

◆ blitFrom() [1/2]

void Titanic::CVideoSurface::blitFrom ( const Point destPos,
CVideoSurface src,
const Rect srcRect = nullptr 
)

Blit from another surface

◆ blitFrom() [2/2]

void Titanic::CVideoSurface::blitFrom ( const Point destPos,
const Graphics::Surface src 
)

Blit from another surface

◆ setTransparencySurface()

void Titanic::CVideoSurface::setTransparencySurface ( Graphics::ManagedSurface surface)
inline

Sets a raw surface to use as a transparency mask for the surface

◆ getTransparencySurface()

const Graphics::Surface* Titanic::CVideoSurface::getTransparencySurface ( ) const
inline

Get the previously set transparency mask surface

◆ getPixels()

uint16* Titanic::CVideoSurface::getPixels ( )
inline

Get the pixels associated with the surface. Only valid when the surface has been locked for access

◆ getRawSurface()

Graphics::ManagedSurface* Titanic::CVideoSurface::getRawSurface ( )
inline

Get a reference to the underlying surface. Only valid when the surface has been locked for access

◆ getTransparencyColor()

uint Titanic::CVideoSurface::getTransparencyColor ( )

Returns the transparent color

◆ copyPixel()

void Titanic::CVideoSurface::copyPixel ( uint16 *  destP,
const uint16 *  srcP,
byte  alpha,
const Graphics::PixelFormat srcFormat,
bool  isAlpha 
)

Copies a pixel, handling transparency

Parameters
destPDest pointer to 16-bit pixel
srcPSource pointer to 16-bit pixel
alphaAlpha (0-31). At 0, it's completely opaque, and overwrites the dest pixel. Through to 31, which is completely transparent, and ignores the source pixel.
srcFormatThe source surface format
isAlphaIf true, has alpha channel

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