aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/driver_vga.cpp
diff options
context:
space:
mode:
authorSven Hesse2009-04-29 19:58:43 +0000
committerSven Hesse2009-04-29 19:58:43 +0000
commitd0c88ca6a096e1c3bfcd28b65d50544d5abc3132 (patch)
treeb831385cafa731d36d6597ab38117e8f09b6f18a /engines/gob/driver_vga.cpp
parent3607c637587c6b9e2442bc668fc4c8c9459c0168 (diff)
downloadscummvm-rg350-d0c88ca6a096e1c3bfcd28b65d50544d5abc3132.tar.gz
scummvm-rg350-d0c88ca6a096e1c3bfcd28b65d50544d5abc3132.tar.bz2
scummvm-rg350-d0c88ca6a096e1c3bfcd28b65d50544d5abc3132.zip
Playing half-sized videos fullscreen in the demoplayer
svn-id: r40211
Diffstat (limited to 'engines/gob/driver_vga.cpp')
-rw-r--r--engines/gob/driver_vga.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/engines/gob/driver_vga.cpp b/engines/gob/driver_vga.cpp
index b182700dba..24c2d8e37b 100644
--- a/engines/gob/driver_vga.cpp
+++ b/engines/gob/driver_vga.cpp
@@ -163,6 +163,43 @@ void VGAVideoDriver::drawSprite(SurfaceDesc *source, SurfaceDesc *dest,
}
}
+void VGAVideoDriver::drawSpriteDouble(SurfaceDesc *source, SurfaceDesc *dest,
+ int16 left, int16 top, int16 right, int16 bottom,
+ int16 x, int16 y, int16 transp) {
+
+ if ((x >= dest->getWidth()) || (x < 0) ||
+ (y >= dest->getHeight()) || (y < 0))
+ return;
+
+ int16 width = MIN<int>((right - left) + 1, dest->getWidth() / 2);
+ int16 height = MIN<int>((bottom - top) + 1, dest->getHeight() / 2);
+
+ if ((width < 1) || (height < 1))
+ return;
+
+ const byte *srcPos = source->getVidMem() + (top * source->getWidth()) + left;
+ byte *destPos = dest->getVidMem() + ((y * 2) * dest->getWidth()) + (x * 2);
+
+ while (height--) {
+ const byte *srcBak = srcPos;
+
+ for (int i = 0; i < 2; i++) {
+ srcPos = srcBak;
+
+ for (int16 j = 0; j < width; j++) {
+ if (!transp || srcPos[i]) {
+ destPos[2 * j + 0] = srcPos[j];
+ destPos[2 * j + 1] = srcPos[j];
+ }
+ }
+
+ destPos += dest->getWidth();
+ }
+
+ srcPos = srcBak + source->getWidth();
+ }
+}
+
void VGAVideoDriver::drawPackedSprite(byte *sprBuf, int16 width, int16 height,
int16 x, int16 y, byte transp, SurfaceDesc *dest) {
int destRight = x + width;