From ad46828d1c8fb68c3c44c5c38c5ac9b2031a2fc9 Mon Sep 17 00:00:00 2001 From: James Brown Date: Sun, 18 Jan 2004 05:52:04 +0000 Subject: BS1 cutscene support. Also bugfixes (don't crash if cutscene ogg unavailable) svn-id: r12465 --- sword1/screen.cpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'sword1/screen.cpp') diff --git a/sword1/screen.cpp b/sword1/screen.cpp index 400aa6a9c6..c5c1dd80ac 100644 --- a/sword1/screen.cpp +++ b/sword1/screen.cpp @@ -31,6 +31,7 @@ #include "system.h" #include "menu.h" #include "sword1.h" +#include "animation.h" namespace Sword1 { @@ -925,4 +926,39 @@ void Screen::drawLine(uint16 x1, uint16 y1, uint16 x2, uint16 y2) { } } +#ifdef BACKEND_8BIT +void Screen::plotYUV(byte *lut, int width, int height, byte *const *dat) { + + byte * buf = (uint8*)malloc(width * height); + + 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[width + linepos++] = lut[i + ((dat[0][width + ypos++] + ROUNDADD) >> SHIFT)]; + buf[linepos ] = lut[i + ((dat[0][ ypos ] + ROUNDADD) >> SHIFT)]; + buf[width + linepos++] = lut[i + ((dat[0][width + ypos++] + ROUNDADD) >> SHIFT)]; + } + linepos += (2 * width - width); + ypos += width; + } + + _system->copy_rect(buf, width, (640-width)/2, (480-height)/2, width, height); + _system->update_screen(); + + free(buf); + +} +#endif + + + } // End of namespace Sword1 -- cgit v1.2.3