diff options
author | Paul Gilbert | 2016-07-10 11:36:04 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-15 19:27:40 -0400 |
commit | fd954a8e0b41370ae68f3b409295676de207313d (patch) | |
tree | 4a31e192231af9e4fa6eba44072e1e70ad7b98ab /engines/titanic/support/video_surface.cpp | |
parent | 6c56d5aa11db1401bc0a2277776ec43128174bc2 (diff) | |
download | scummvm-rg350-fd954a8e0b41370ae68f3b409295676de207313d.tar.gz scummvm-rg350-fd954a8e0b41370ae68f3b409295676de207313d.tar.bz2 scummvm-rg350-fd954a8e0b41370ae68f3b409295676de207313d.zip |
TITANIC: Added OSVideoSurface flipVertically
Diffstat (limited to 'engines/titanic/support/video_surface.cpp')
-rw-r--r-- | engines/titanic/support/video_surface.cpp | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp index fc7db30391..546c2c475b 100644 --- a/engines/titanic/support/video_surface.cpp +++ b/engines/titanic/support/video_surface.cpp @@ -461,14 +461,40 @@ void OSVideoSurface::addMovieEvent(int frameNumber, CGameObject *obj) { _movie->addEvent(frameNumber, obj); } -void OSVideoSurface::proc39(int v1, int v2) { - warning("OSVideoSurface::proc39"); +void OSVideoSurface::setMovieFrameRate(double rate) { + if (_movie) + _movie->setFrameRate(rate); } const CMovieRangeInfoList *OSVideoSurface::getMovieRangeInfo() const { return _movie ? _movie->getMovieRangeInfo() : nullptr; } +void OSVideoSurface::flipVertically(bool needsLock) { + if (!loadIfReady() || !_blitStyleFlag) + return; + + if (needsLock) + lock(); + + byte lineBuffer[SCREEN_WIDTH * 2]; + int pitch = getBpp() * getWidth(); + assert(pitch < (SCREEN_WIDTH * 2)); + + for (int yp = 0; yp < (_rawSurface->h / 2); ++yp) { + byte *line1P = (byte *)_rawSurface->getBasePtr(0, yp); + byte *line2P = (byte *)_rawSurface->getBasePtr(0, _rawSurface->h - yp - 1); + + Common::copy(line1P, line1P + pitch, lineBuffer); + Common::copy(line2P, line2P + pitch, line1P); + Common::copy(lineBuffer, lineBuffer + pitch, line1P); + } + + _blitStyleFlag = false; + if (needsLock) + unlock(); +} + bool OSVideoSurface::loadIfReady() { _videoSurfaceNum = _videoSurfaceCounter; @@ -511,6 +537,10 @@ void OSVideoSurface::transPixelate() { unlock(); } +void *OSVideoSurface::dupMovieFrameInfo() const { + return _movie ? _movie->duplicateFrameInfo() : nullptr; +} + int OSVideoSurface::freeSurface() { if (!_ddSurface) return 0; |