diff options
author | Eugene Sandulenko | 2016-09-04 14:30:42 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-09-04 14:30:42 +0200 |
commit | 7395647518750506b96a157a7530d7d20d41f791 (patch) | |
tree | 0160bee7739eef7aeaeb70285fdf7e1f803ecaba /engines/fullpipe | |
parent | 827ed99bcb0e9109a9dfe08c795876eeb5917b78 (diff) | |
download | scummvm-rg350-7395647518750506b96a157a7530d7d20d41f791.tar.gz scummvm-rg350-7395647518750506b96a157a7530d7d20d41f791.tar.bz2 scummvm-rg350-7395647518750506b96a157a7530d7d20d41f791.zip |
FULLPIPE: Implement FullpipeEngine::sceneFade()
Diffstat (limited to 'engines/fullpipe')
-rw-r--r-- | engines/fullpipe/gfx.cpp | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp index 59c2e41fce..76d29f7aad 100644 --- a/engines/fullpipe/gfx.cpp +++ b/engines/fullpipe/gfx.cpp @@ -1269,22 +1269,32 @@ void FullpipeEngine::drawAlphaRectangle(int x1, int y1, int x2, int y2, int alph } void FullpipeEngine::sceneFade(Scene *sc, bool direction) { - warning("STUB: FullpipeEngine::sceneFade()"); - -#if 0 for (int dim = 0; dim < 255; dim += 20) { - v5 = GetTickCount(); - vrtSetAlphaBlendMode(*(_DWORD *)virt, 0, 255); + int ticks = g_fp->_system->getMillis(); sc->draw(); - drawAlphaRectangle(0, 0, 800, 600, direction ? 255 - dim : dim); - vrtFlush(*(_DWORD *)virt); - v7 = GetTickCount(); - if ( v7 - v5 < 42 ) - Sleep(v5 - v7 + 42); - } - vrtSetAlphaBlendMode(*(_DWORD *)virt, 0, 255); -#endif + for (int y = 0; y < g_fp->_backgroundSurface.h; y++) { + uint32 *ptr = (uint32 *)g_fp->_backgroundSurface.getBasePtr(0, y); + + for (int x = 0; x < g_fp->_backgroundSurface.w; x++) { + uint32 color = *ptr; + color = (((color >> 24) & 0xff) * dim / 0xff) << 24 | + (((color >> 16) & 0xff) * dim / 0xff) << 16 | + (((color >> 8) & 0xff) * dim / 0xff) << 8 | + (color & 0xff); + *ptr = color; + ptr++; + } + } + + g_fp->_system->copyRectToScreen(g_fp->_backgroundSurface.getBasePtr(0, 0), g_fp->_backgroundSurface.pitch, 0, 0, 800, 600); + + g_fp->_system->updateScreen(); + ticks = g_fp->_system->getMillis() - ticks; + + if (ticks < 42) + g_fp->_system->delayMillis(42 - ticks); + } } } // End of namespace Fullpipe |