aboutsummaryrefslogtreecommitdiff
path: root/sword1/screen.cpp
diff options
context:
space:
mode:
authorJames Brown2004-01-18 05:52:04 +0000
committerJames Brown2004-01-18 05:52:04 +0000
commitad46828d1c8fb68c3c44c5c38c5ac9b2031a2fc9 (patch)
tree4253ac14e5934508d7a455cafdf1fec88d0af866 /sword1/screen.cpp
parenta95818d29a706095517ada079f316ad74f20a86d (diff)
downloadscummvm-rg350-ad46828d1c8fb68c3c44c5c38c5ac9b2031a2fc9.tar.gz
scummvm-rg350-ad46828d1c8fb68c3c44c5c38c5ac9b2031a2fc9.tar.bz2
scummvm-rg350-ad46828d1c8fb68c3c44c5c38c5ac9b2031a2fc9.zip
BS1 cutscene support. Also bugfixes (don't crash if cutscene ogg unavailable)
svn-id: r12465
Diffstat (limited to 'sword1/screen.cpp')
-rw-r--r--sword1/screen.cpp36
1 files changed, 36 insertions, 0 deletions
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