[Scummvm-git-logs] scummvm master -> aba58e6042a1247f36379e69b3338eae1d58c999

dreammaster dreammaster at scummvm.org
Thu Sep 29 02:24:36 CEST 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
aba58e6042 TITANIC: Clarify movie secondary video tracks as a transparency mask


Commit: aba58e6042a1247f36379e69b3338eae1d58c999
    https://github.com/scummvm/scummvm/commit/aba58e6042a1247f36379e69b3338eae1d58c999
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-09-28T20:24:27-04:00

Commit Message:
TITANIC: Clarify movie secondary video tracks as a transparency mask

Changed paths:
    engines/titanic/support/avi_surface.cpp
    engines/titanic/support/avi_surface.h
    engines/titanic/support/mouse_cursor.cpp
    engines/titanic/support/movie.cpp
    engines/titanic/support/video_surface.cpp
    engines/titanic/support/video_surface.h



diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp
index d4ebd5c..2cc3297 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 54b0155..0acf7ab 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 d342e6c..0cefc36 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 e863185..a605cc3 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 b5f6687..50a5ca5 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 053eabb..c211493 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





More information about the Scummvm-git-logs mailing list