diff options
author | James Brown | 2004-01-12 11:11:19 +0000 |
---|---|---|
committer | James Brown | 2004-01-12 11:11:19 +0000 |
commit | a685422a138c99af7f95f8deaf787425af356f9b (patch) | |
tree | 21b0edaab5647e9f5889648d982099e995f06455 /sword2/driver/render.cpp | |
parent | bbf32c0076ec53a3df9416419b901c9ef3659884 (diff) | |
download | scummvm-rg350-a685422a138c99af7f95f8deaf787425af356f9b.tar.gz scummvm-rg350-a685422a138c99af7f95f8deaf787425af356f9b.tar.bz2 scummvm-rg350-a685422a138c99af7f95f8deaf787425af356f9b.zip |
Initial libmpeg2 cutscene support based on patch #874510.
Pre-converted cutscenes w/ palette files available - ask LeChuck about Cutscenes :)
svn-id: r12338
Diffstat (limited to 'sword2/driver/render.cpp')
-rw-r--r-- | sword2/driver/render.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sword2/driver/render.cpp b/sword2/driver/render.cpp index 5e7d2961f0..7e05fa9919 100644 --- a/sword2/driver/render.cpp +++ b/sword2/driver/render.cpp @@ -820,4 +820,31 @@ void Graphics::closeBackgroundLayer(void) { _layer = 0; } + +void Graphics::plotYUV(unsigned char * lut, int width, int height, uint8_t * const * dat) +{ + uint8 *buf = _buffer + (40+(400-height)/2) * RENDERWIDE + (640-width)/2; + + int x, y; + + int ypos = 0; + int cpos = 0; + int linepos = 0; + + for (y = 0; y < height; y+=2) { + for (x = 0; x < width; x+=2) { + int i = ((((dat[2][cpos]+ROUNDADD)>>SHIFT) * BITDEPTH) + ((dat[1][cpos]+ROUNDADD)>>SHIFT)) * BITDEPTH; + cpos++; + + buf[linepos ] = lut[i+((dat[0][ ypos ]+ROUNDADD)>>SHIFT)]; + buf[RENDERWIDE + linepos++] = lut[i+((dat[0][width+ypos++]+ROUNDADD)>>SHIFT)]; + buf[linepos ] = lut[i+((dat[0][ ypos ]+ROUNDADD)>>SHIFT)]; + buf[RENDERWIDE + linepos++] = lut[i+((dat[0][width+ypos++]+ROUNDADD)>>SHIFT)]; + } + linepos += (2*RENDERWIDE-width); + ypos += width; + } +} + + } // End of namespace Sword2 |