[Scummvm-cvs-logs] CVS: scummvm/gob driver_vga.cpp,1.6,1.7
Eugene Sandulenko
sev at users.sourceforge.net
Mon Apr 11 14:44:29 CEST 2005
Update of /cvsroot/scummvm/scummvm/gob
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16228
Modified Files:
driver_vga.cpp
Log Message:
Patch from wjp. Support for CD and EGA versions.
Index: driver_vga.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gob/driver_vga.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- driver_vga.cpp 10 Apr 2005 14:30:24 -0000 1.6
+++ driver_vga.cpp 11 Apr 2005 21:44:08 -0000 1.7
@@ -106,7 +106,42 @@
}
void VGAVideoDriver::drawPackedSprite(byte *sprBuf, int16 width, int16 height, int16 x, int16 y, byte transp, SurfaceDesc *dest) {
- STUB_FUNC;
+ int destRight = x + width;
+ int destBottom = y + height;
+
+ byte* dst = dest->vidPtr + x + dest->width * y;
+
+ int curx = x;
+ int cury = y;
+
+ while (1) {
+ uint8 val = *sprBuf++;
+ unsigned int repeat = val & 7;
+ val &= 0xF8;
+ if (!(val & 8)) {
+ repeat <<= 8;
+ repeat |= *sprBuf++;
+ }
+ repeat++;
+ val >>= 4;
+
+ for (unsigned int i = 0; i < repeat; ++i) {
+ if (curx < dest->width && cury < dest->height)
+ if (!transp || val)
+ *dst = val;
+
+ dst++;
+ curx++;
+ if (curx == destRight) {
+ dst += dest->width + x - curx;
+ curx = x;
+ cury++;
+ if (cury == destBottom)
+ return;
+ }
+ }
+ }
+
}
}
More information about the Scummvm-git-logs
mailing list