[Scummvm-cvs-logs] CVS: scummvm/scumm gfx.cpp,2.266,2.266.2.1 gfx.h,1.59,1.59.2.1
Eugene Sandulenko
sev at users.sourceforge.net
Sun Jun 20 14:23:04 CEST 2004
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24793/scumm
Modified Files:
Tag: branch-0-6-0
gfx.cpp gfx.h
Log Message:
Backpord HE 3DO gfx decoders.
Mention it in NEWS.
It would be good if you mention your backported changes in NEWS file.
Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.266
retrieving revision 2.266.2.1
diff -u -d -r2.266 -r2.266.2.1
--- gfx.cpp 14 Feb 2004 10:43:55 -0000 2.266
+++ gfx.cpp 20 Jun 2004 21:22:17 -0000 2.266.2.1
@@ -1485,11 +1485,16 @@
case 7:
unkDecode11(bgbak_ptr, src, numLinesToProcess); /* Ender - Zak256/Indy256 */
break;
- // FIXME implement these codecs...
// 8/9 used in 3do version of puttputt joins the parade maybe others
case 8:
+ useOrDecompress = true;
+ decodeStrip3DO(bgbak_ptr, src, numLinesToProcess, true);
+ break;
+
case 9:
- error("decompressBitmap: Graphics codec %d not yet supported\n", code);
+ decodeStrip3DO(bgbak_ptr, src, numLinesToProcess, false);
+ break;
+
// used in amiga version of Monkey Island
case 10:
decodeStripEGA(bgbak_ptr, src, numLinesToProcess);
@@ -2125,6 +2130,74 @@
} while (--x);
}
+void Gdi::decodeStrip3DO(byte *dst, const byte *src, int height, byte transpCheck) {
+ int destbytes, olddestbytes2, olddestbytes1;
+ byte color;
+ int data;
+
+ olddestbytes1 = 0;
+
+ destbytes = height << 3;
+
+ if (!height)
+ return;
+
+ do {
+ data = *src;
+ src++;
+
+ if (!(data & 1)) {
+ data >>= 1;
+ data++;
+ destbytes -= data;
+ if (destbytes < 0)
+ data += destbytes;
+
+ olddestbytes2 = destbytes;
+ destbytes = olddestbytes1;
+
+ for (; data > 0; data--, src++, dst++) {
+ if (*src != _transparentColor || !transpCheck)
+ *dst = *src;
+
+ destbytes++;
+ if (!(destbytes & 7))
+ dst += 312;
+ }
+
+ olddestbytes1 = destbytes;
+ if (olddestbytes2 > 0) {
+ destbytes = olddestbytes2;
+ }
+ } else {
+ data >>= 1;
+ color = *src;
+ src++;
+
+ data++;
+ destbytes -= data;
+ if (destbytes < 0)
+ data += destbytes;
+
+ olddestbytes2 = destbytes;
+ destbytes = olddestbytes1;
+
+ for (; data > 0; data--, dst++) {
+ if (color != _transparentColor || !transpCheck)
+ *dst = color;
+ destbytes++;
+ if (!(destbytes & 7))
+ dst += 312;
+ }
+ olddestbytes1 = destbytes;
+ if (olddestbytes2 > 0) {
+ destbytes = olddestbytes2;
+ }
+ }
+ } while (olddestbytes2 > 0);
+}
+
+
#undef NEXT_ROW
#undef READ_256BIT
Index: gfx.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.h,v
retrieving revision 1.59
retrieving revision 1.59.2.1
diff -u -d -r1.59 -r1.59.2.1
--- gfx.h 8 Jan 2004 21:21:40 -0000 1.59
+++ gfx.h 20 Jun 2004 21:22:17 -0000 1.59.2.1
@@ -248,6 +248,7 @@
void unkDecode9(byte *dst, const byte *src, int height);
void unkDecode10(byte *dst, const byte *src, int height);
void unkDecode11(byte *dst, const byte *src, int height);
+ void decodeStrip3DO(byte *dst, const byte *src, int height, byte transpCheck);
void draw8ColWithMasking(byte *dst, const byte *src, int height, byte *mask);
void draw8Col(byte *dst, const byte *src, int height);
More information about the Scummvm-git-logs
mailing list