aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/support
diff options
context:
space:
mode:
authorPaul Gilbert2016-09-28 20:24:27 -0400
committerPaul Gilbert2016-09-28 20:24:27 -0400
commitaba58e6042a1247f36379e69b3338eae1d58c999 (patch)
tree12e0207fb8c605c8f5bda808b4b70b10543cad9c /engines/titanic/support
parent0da273fc8c843a6248e11f006d51a4817e3d8e37 (diff)
downloadscummvm-rg350-aba58e6042a1247f36379e69b3338eae1d58c999.tar.gz
scummvm-rg350-aba58e6042a1247f36379e69b3338eae1d58c999.tar.bz2
scummvm-rg350-aba58e6042a1247f36379e69b3338eae1d58c999.zip
TITANIC: Clarify movie secondary video tracks as a transparency mask
Diffstat (limited to 'engines/titanic/support')
-rw-r--r--engines/titanic/support/avi_surface.cpp9
-rw-r--r--engines/titanic/support/avi_surface.h4
-rw-r--r--engines/titanic/support/mouse_cursor.cpp2
-rw-r--r--engines/titanic/support/movie.cpp6
-rw-r--r--engines/titanic/support/video_surface.cpp18
-rw-r--r--engines/titanic/support/video_surface.h14
6 files changed, 27 insertions, 26 deletions
diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp
index d4ebd5cef1..2cc32971ae 100644
--- a/engines/titanic/support/avi_surface.cpp
+++ b/engines/titanic/support/avi_surface.cpp
@@ -39,15 +39,16 @@ Video::AVIDecoder::AVIVideoTrack &AVIDecoder::getVideoTrack() {
}
/**
- * Track filter for AVIDecoder that filters out any secondary video track
+ * Track filter for AVIDecoder that filters out any secondary
+ * video track some videos have to hold transparency masks
*/
static bool primaryTrackSelect(bool isVideo, int trackCounter) {
return !isVideo || trackCounter == 0;
}
/**
- * Track filter for AVIDecoder that only accepts the secondary video track
- * for a video, if present
+ * Track filter for AVIDecoder that only accepts the secondary
+ * transparency msak video track for a video, if present
*/
static bool secondaryTrackSelect(bool isVideo, int trackCounter) {
return isVideo && trackCounter > 0;
@@ -348,7 +349,7 @@ Graphics::ManagedSurface *AVISurface::getSecondarySurface() {
return _streamCount <= 1 ? nullptr : _movieFrameSurface[1];
}
-Graphics::ManagedSurface *AVISurface::duplicateSecondaryFrame() const {
+Graphics::ManagedSurface *AVISurface::duplicateTransparency() const {
if (_streamCount <= 1) {
return nullptr;
} else {
diff --git a/engines/titanic/support/avi_surface.h b/engines/titanic/support/avi_surface.h
index 54b0155bdd..0acf7ab23b 100644
--- a/engines/titanic/support/avi_surface.h
+++ b/engines/titanic/support/avi_surface.h
@@ -168,9 +168,9 @@ public:
}
/**
- * Duplicates the secondary frame, if the movie has a second video track
+ * Duplicates the transparency mask for the frame, if the movie includes it
*/
- Graphics::ManagedSurface *duplicateSecondaryFrame() const;
+ Graphics::ManagedSurface *duplicateTransparency() const;
/**
* Returns true if it's time for the next
diff --git a/engines/titanic/support/mouse_cursor.cpp b/engines/titanic/support/mouse_cursor.cpp
index d342e6cccb..0cefc368fa 100644
--- a/engines/titanic/support/mouse_cursor.cpp
+++ b/engines/titanic/support/mouse_cursor.cpp
@@ -84,7 +84,7 @@ void CMouseCursor::loadCursorImages() {
Graphics::ManagedSurface *frameSurface = movie.duplicateFrame();
_cursors[idx]._frameSurface = frameSurface;
- surface->setMovieFrameSurface(frameSurface);
+ surface->setTransparencySurface(frameSurface);
}
}
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index e863185f84..a605cc3465 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -157,7 +157,7 @@ void OSMovie::addEvent(int frameNumber, CGameObject *obj) {
void OSMovie::setFrame(uint frameNumber) {
_aviSurface.setFrame(frameNumber);
- _videoSurface->setMovieFrameSurface(_aviSurface.getSecondarySurface());
+ _videoSurface->setTransparencySurface(_aviSurface.getSecondarySurface());
}
bool OSMovie::handleEvents(CMovieEventList &events) {
@@ -169,7 +169,7 @@ bool OSMovie::handleEvents(CMovieEventList &events) {
// Handle updating the frame
while (_aviSurface.isPlaying() && _aviSurface.isNextFrame()) {
_aviSurface.handleEvents(events);
- _videoSurface->setMovieFrameSurface(_aviSurface.getSecondarySurface());
+ _videoSurface->setTransparencySurface(_aviSurface.getSecondarySurface());
}
// Flag there's a video frame
@@ -204,7 +204,7 @@ void OSMovie::setFrameRate(double rate) {
}
Graphics::ManagedSurface *OSMovie::duplicateFrame() const {
- return _aviSurface.duplicateSecondaryFrame();
+ return _aviSurface.duplicateTransparency();
}
} // End of namespace Titanic
diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index b5f668793a..50a5ca5f16 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -32,8 +32,8 @@ int CVideoSurface::_videoSurfaceCounter = 0;
CVideoSurface::CVideoSurface(CScreenManager *screenManager) :
_screenManager(screenManager), _rawSurface(nullptr), _movie(nullptr),
_pendingLoad(false), _transBlitFlag(false), _fastBlitFlag(false),
- _movieFrameSurface(nullptr), _transparencyMode(TRANS_DEFAULT),
- _freeMovieSurface(DisposeAfterUse::NO), _hasFrame(true), _lockCount(0) {
+ _transparencySurface(nullptr), _transparencyMode(TRANS_DEFAULT),
+ _freeTransparencySurface(DisposeAfterUse::NO), _hasFrame(true), _lockCount(0) {
_videoSurfaceNum = _videoSurfaceCounter++;
}
@@ -42,8 +42,8 @@ CVideoSurface::~CVideoSurface() {
_videoSurfaceCounter -= freeSurface();
--_videoSurfaceCounter;
- if (_freeMovieSurface == DisposeAfterUse::YES)
- delete _movieFrameSurface;
+ if (_freeTransparencySurface == DisposeAfterUse::YES)
+ delete _transparencySurface;
}
void CVideoSurface::setSurface(CScreenManager *screenManager, DirectDrawSurface *surface) {
@@ -138,8 +138,8 @@ void CVideoSurface::blitRect1(const Rect &srcRect, const Rect &destRect, CVideoS
if (src->_fastBlitFlag) {
_rawSurface->blitFrom(*src->_rawSurface, srcRect, Point(destRect.left, destRect.top));
- } else if (getMovieFrameSurface()) {
- movieBlitRect(srcRect, destRect, src);
+ } else if (getTransparencySurface()) {
+ transBlitRect(srcRect, destRect, src);
} else {
_rawSurface->transBlitFrom(*src->_rawSurface, srcRect, destRect, src->getTransparencyColor());
}
@@ -149,8 +149,8 @@ void CVideoSurface::blitRect1(const Rect &srcRect, const Rect &destRect, CVideoS
}
void CVideoSurface::blitRect2(const Rect &srcRect, const Rect &destRect, CVideoSurface *src) {
- if (getMovieFrameSurface()) {
- movieBlitRect(srcRect, destRect, src);
+ if (getTransparencySurface()) {
+ transBlitRect(srcRect, destRect, src);
} else {
src->lock();
lock();
@@ -162,7 +162,7 @@ void CVideoSurface::blitRect2(const Rect &srcRect, const Rect &destRect, CVideoS
}
}
-void CVideoSurface::movieBlitRect(const Rect &srcRect, const Rect &destRect, CVideoSurface *src) {
+void CVideoSurface::transBlitRect(const Rect &srcRect, const Rect &destRect, CVideoSurface *src) {
if (lock()) {
if (src->lock()) {
Graphics::ManagedSurface *srcSurface = src->_rawSurface;
diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h
index 053eabb0f9..c21149333d 100644
--- a/engines/titanic/support/video_surface.h
+++ b/engines/titanic/support/video_surface.h
@@ -57,15 +57,15 @@ private:
void blitRect1(const Rect &srcRect, const Rect &destRect, CVideoSurface *src);
void blitRect2(const Rect &srcRect, const Rect &destRect, CVideoSurface *src);
- void movieBlitRect(const Rect &srcRect, const Rect &destRect, CVideoSurface *src);
+ void transBlitRect(const Rect &srcRect, const Rect &destRect, CVideoSurface *src);
protected:
static int _videoSurfaceCounter;
protected:
CScreenManager *_screenManager;
Graphics::ManagedSurface *_rawSurface;
bool _pendingLoad;
- Graphics::ManagedSurface *_movieFrameSurface;
- DisposeAfterUse::Flag _freeMovieSurface;
+ Graphics::ManagedSurface *_transparencySurface;
+ DisposeAfterUse::Flag _freeTransparencySurface;
int _videoSurfaceNum;
bool _hasFrame;
int _lockCount;
@@ -295,14 +295,14 @@ public:
void blitFrom(const Point &destPos, const Graphics::Surface *src);
/**
- * Sets the movie frame surface containing frame data from an active movie
+ * Sets a raw surface to use as a transparency mask for the surface
*/
- void setMovieFrameSurface(Graphics::ManagedSurface *frameSurface) { _movieFrameSurface = frameSurface; }
+ void setTransparencySurface(Graphics::ManagedSurface *surface) { _transparencySurface = surface; }
/**
- * Get the previously set movie frame surface
+ * Get the previously set transparency mask surface
*/
- Graphics::ManagedSurface *getMovieFrameSurface() const { return _movieFrameSurface; }
+ Graphics::ManagedSurface *getTransparencySurface() const { return _transparencySurface; }
/**
* Get the pixels associated with the surface. Only valid when the