aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/support/video_surface.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2016-07-12 08:38:26 -0400
committerPaul Gilbert2016-07-17 13:09:24 -0400
commit513723c82d5db078236421577924bd9cde29b99b (patch)
tree611f1a89a16ec26dfe04d7a5169549436f9d61f3 /engines/titanic/support/video_surface.cpp
parentc458c3c9b740602002cd0a130a99af8b10402806 (diff)
downloadscummvm-rg350-513723c82d5db078236421577924bd9cde29b99b.tar.gz
scummvm-rg350-513723c82d5db078236421577924bd9cde29b99b.tar.bz2
scummvm-rg350-513723c82d5db078236421577924bd9cde29b99b.zip
TITANIC: Making the AVISurface frameInfo a video surface
Diffstat (limited to 'engines/titanic/support/video_surface.cpp')
-rw-r--r--engines/titanic/support/video_surface.cpp34
1 files changed, 19 insertions, 15 deletions
diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index 546c2c475b..3e6e93abf1 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -31,8 +31,8 @@ int CVideoSurface::_videoSurfaceCounter = 0;
CVideoSurface::CVideoSurface(CScreenManager *screenManager) :
_screenManager(screenManager), _rawSurface(nullptr), _movie(nullptr),
- _pendingLoad(false), _blitStyleFlag(false), _blitFlag(false),
- _movieFrameInfo(nullptr), _transparencyMode(TRANS_DEFAULT), _field48(0), _field50(1) {
+ _pendingLoad(false), _transBlitFlag(false), _fastBlitFlag(false),
+ _movieFrameSurface(nullptr), _transparencyMode(TRANS_DEFAULT), _field48(0), _field50(1) {
_videoSurfaceNum = _videoSurfaceCounter++;
}
@@ -52,10 +52,10 @@ void CVideoSurface::blitFrom(const Point &destPos, CVideoSurface *src, const Rec
Rect srcBounds, destBounds;
clipBounds(srcBounds, destBounds, src, srcRect, &destPos);
- if (_blitStyleFlag)
- blitRect2(srcBounds, destBounds, src);
+ if (_transBlitFlag)
+ transBlitRect(srcBounds, destBounds, src);
else
- blitRect1(srcBounds, destBounds, src);
+ blitRect(srcBounds, destBounds, src);
}
}
@@ -128,21 +128,25 @@ void CVideoSurface::clipBounds(Rect &srcRect, Rect &destRect,
error("Invalid rect");
}
-void CVideoSurface::blitRect1(const Rect &srcRect, const Rect &destRect, CVideoSurface *src) {
+void CVideoSurface::blitRect(const Rect &srcRect, const Rect &destRect, CVideoSurface *src) {
src->lock();
lock();
- // TODO: Do it like the original does it
- _rawSurface->transBlitFrom(*src->_rawSurface, srcRect, destRect,
- getTransparencyColor());
+ if (_fastBlitFlag) {
+ _rawSurface->transBlitFrom(*src->_rawSurface, srcRect, destRect,
+ getTransparencyColor());
+ return;
+ }
+
+ // TODO
src->unlock();
unlock();
}
-void CVideoSurface::blitRect2(const Rect &srcRect, const Rect &destRect, CVideoSurface *src) {
+void CVideoSurface::transBlitRect(const Rect &srcRect, const Rect &destRect, CVideoSurface *src) {
// TODO: Do it like the original does it
- blitRect1(srcRect, destRect, src);
+ blitRect(srcRect, destRect, src);
}
uint CVideoSurface::getTransparencyColor() {
@@ -471,7 +475,7 @@ const CMovieRangeInfoList *OSVideoSurface::getMovieRangeInfo() const {
}
void OSVideoSurface::flipVertically(bool needsLock) {
- if (!loadIfReady() || !_blitStyleFlag)
+ if (!loadIfReady() || !_transBlitFlag)
return;
if (needsLock)
@@ -490,7 +494,7 @@ void OSVideoSurface::flipVertically(bool needsLock) {
Common::copy(lineBuffer, lineBuffer + pitch, line1P);
}
- _blitStyleFlag = false;
+ _transBlitFlag = false;
if (needsLock)
unlock();
}
@@ -537,8 +541,8 @@ void OSVideoSurface::transPixelate() {
unlock();
}
-void *OSVideoSurface::dupMovieFrameInfo() const {
- return _movie ? _movie->duplicateFrameInfo() : nullptr;
+CVideoSurface *OSVideoSurface::dupMovieFrame() const {
+ return _movie ? _movie->duplicateFrame() : nullptr;
}
int OSVideoSurface::freeSurface() {