#include <video32.h>
Public Types | |
enum | OpenFlags { kOpenFlagNone = 0, kOpenFlagMute = 1 } |
enum | IOStatus { kIOSuccess = 0, kIOError = 0xFFFF } |
enum | PlayFlags { kPlayFlagNone = 0, kPlayFlagDoublePixels = 1, kPlayFlagBlackLines = 4, kPlayFlagBoost = 0x10, kPlayFlagLeaveScreenBlack = 0x20, kPlayFlagLeaveLastFrame = 0x40, kPlayFlagBlackPalette = 0x80, kPlayFlagStretchVertical = 0x100 } |
enum | VMDStatus { kVMDNotOpen = 0, kVMDOpen = 1, kVMDPlaying = 2, kVMDPaused = 3, kVMDStopped = 4, kVMDFinished = 5 } |
Public Types inherited from Sci::VideoPlayer | |
enum | EventFlags { kEventFlagNone = 0, kEventFlagEnd = 1, kEventFlagEscapeKey = 2, kEventFlagMouseDown = 4, kEventFlagHotRectangle = 8, kEventFlagToFrame = 0x10, kEventFlagYieldToVM = 0x20, kEventFlagReverse = 0x80 } |
Public Member Functions | |
VMDPlayer (EventManager *eventMan, SegManager *segMan) | |
IOStatus | open (const Common::Path &fileName, const OpenFlags flags) |
void | init (int16 x, int16 y, const PlayFlags flags, const int16 boostPercent, const int16 boostStartColor, const int16 boostEndColor) |
IOStatus | close () |
VMDStatus | getStatus () const |
EventFlags | kernelPlayUntilEvent (const EventFlags flags, const int16 lastFrameNo, const int16 yieldInterval) |
void | ignorePalettes () |
void | setPlane (const int16 priority, const reg_t planeId) |
void | setBlackoutArea (const Common::Rect &rect) |
void | restrictPalette (const uint8 startColor, const int16 endColor) |
void | setShowCursor (const bool shouldShow) |
int16 | addBlob (int16 blockSize, int16 top, int16 left, int16 bottom, int16 right) |
void | deleteBlobs () |
void | deleteBlob (int16 blobNumber) |
Public Member Functions inherited from Sci::VideoPlayer | |
VideoPlayer (EventManager *eventMan, Video::VideoDecoder *decoder=nullptr) | |
Protected Member Functions | |
void | renderFrame (const Graphics::Surface &nextFrame) const override |
void | submitPalette (const uint8 palette[256 *3]) const override |
Protected Member Functions inherited from Sci::VideoPlayer | |
bool | open (const Common::Path &fileName) |
bool | startHQVideo () |
virtual bool | shouldStartHQVideo () const |
bool | endHQVideo () |
template<typename PixelType > | |
void | renderLQToSurface (Graphics::Surface &out, const Graphics::Surface &nextFrame, const bool doublePixels, const bool blackLines) const |
void | setDrawRect (const int16 x, const int16 y, const int16 width, const int16 height) |
void | setSubtitlePosition () const |
Additional Inherited Members | |
Protected Attributes inherited from Sci::VideoPlayer | |
EventManager * | _eventMan |
Common::ScopedPtr< Video::VideoDecoder > | _decoder |
Common::Rect | _drawRect |
bool | _needsUpdate |
const Graphics::Surface * | _currentFrame |
Video::Subtitles | _subtitles |
VMDPlayer is used to play VMD videos. Used by LSL7, Phant1, GK2, PQ:SWAT, Shivers, SQ6, Rama, Torin, and Lighthouse.
IOStatus Sci::VMDPlayer::open | ( | const Common::Path & | fileName, |
const OpenFlags | flags | ||
) |
Opens a stream to a VMD resource.
void Sci::VMDPlayer::init | ( | int16 | x, |
int16 | y, | ||
const PlayFlags | flags, | ||
const int16 | boostPercent, | ||
const int16 | boostStartColor, | ||
const int16 | boostEndColor | ||
) |
Initializes the VMD rendering parameters for the current VMD. This must be called after open
.
IOStatus Sci::VMDPlayer::close | ( | ) |
Stops playback and closes the currently open VMD stream.
VMDStatus Sci::VMDPlayer::getStatus | ( | ) | const |
Gets the playback status of the VMD player.
|
inline |
Causes the VMD player to ignore all palettes in the currently playing video.
void Sci::VMDPlayer::setPlane | ( | const int16 | priority, |
const reg_t | planeId | ||
) |
Sets the plane and plane priority used to render video.
|
overrideprotectedvirtual |
Renders a frame of video to the output bitmap.
Reimplemented from Sci::VideoPlayer.
|
overrideprotectedvirtual |
Updates the system with palette data from the video.
Reimplemented from Sci::VideoPlayer.
|
inline |
Sets the area of the screen that should be blacked out during VMD playback.
void Sci::VMDPlayer::restrictPalette | ( | const uint8 | startColor, |
const int16 | endColor | ||
) |
Restricts use of the system palette by VMD playback to the given range of palette indexes.
|
inline |
Sets whether or not the mouse cursor should be drawn. This does not have any effect during playback, but can be used to prevent the mouse cursor from being shown again after the video has finished.
int16 Sci::VMDPlayer::addBlob | ( | int16 | blockSize, |
int16 | top, | ||
int16 | left, | ||
int16 | bottom, | ||
int16 | right | ||
) |
Censorship blobs are pixelated rectangles which are added and removed by game scripts. Phant1 is the only game known to use this and always sets a blockSize of 10. Each block's color comes from the pixel in the upper left corner of the block's location.