aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorPaweł Kołodziejski2002-12-21 20:05:40 +0000
committerPaweł Kołodziejski2002-12-21 20:05:40 +0000
commit0182836591273b19abbeafd9ad2760fc0738a5e8 (patch)
treef8eb518c17135d85ee2701aca423573fb5830142 /scumm
parent060562c2773cdfc28b78d1c08977070d94673ec2 (diff)
downloadscummvm-rg350-0182836591273b19abbeafd9ad2760fc0738a5e8.tar.gz
scummvm-rg350-0182836591273b19abbeafd9ad2760fc0738a5e8.tar.bz2
scummvm-rg350-0182836591273b19abbeafd9ad2760fc0738a5e8.zip
fix smush for compatible with dig demo
svn-id: r6043
Diffstat (limited to 'scumm')
-rw-r--r--scumm/script_v6.cpp7
-rw-r--r--scumm/smush/codec37.cpp49
-rw-r--r--scumm/smush/codec37.h3
3 files changed, 53 insertions, 6 deletions
diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp
index c70c9faa45..59c4fe84bf 100644
--- a/scumm/script_v6.cpp
+++ b/scumm/script_v6.cpp
@@ -2444,9 +2444,12 @@ void Scumm_v6::o6_miscOps()
uint32 speed;
if (strcmp((char*)getStringAddressVar(VAR_VIDEONAME), "sq3.san") == 0)
speed = 71;
- else
+ else {
+ if (_insaneFlag == 0)
+ _insaneFlag = 13;
speed = 1000 / _insaneFlag;
-
+ }
+
debug(1, "INSANE Arg: %d", args[1]);
ScummRenderer * sr = new ScummRenderer(this, speed);
diff --git a/scumm/smush/codec37.cpp b/scumm/smush/codec37.cpp
index cc796ef48e..c0e1b7c771 100644
--- a/scumm/smush/codec37.cpp
+++ b/scumm/smush/codec37.cpp
@@ -318,7 +318,7 @@ void Codec37Decoder::proc3WithoutFDFE(Blitter & dst, Chunk & src, int32 next_off
} while (--bh);
}
-void Codec37Decoder::proc4(Blitter & dst, Chunk & src, int32 next_offs, int32 bw, int32 bh) {
+void Codec37Decoder::proc4WithFDFE(Blitter & dst, Chunk & src, int32 next_offs, int32 bw, int32 bh) {
do {
int32 i = bw;
do {
@@ -370,6 +370,46 @@ void Codec37Decoder::proc4(Blitter & dst, Chunk & src, int32 next_offs, int32 bw
} while (--bh);
}
+void Codec37Decoder::proc4WithoutFDFE(Blitter & dst, Chunk & src, int32 next_offs, int32 bw, int32 bh) {
+ do {
+ int32 i = bw;
+ do {
+ int32 code = src.getByte();
+ if (code == 0xFF) {
+#ifdef USE_COLOR_CODE_FOR_BLOCK
+ dst.putBlock(expand(9));
+#else
+ dst.putBlock(src);
+#endif
+ } else if (code == 0x00) {
+ int32 length = src.getByte() + 1;
+ for (int32 l = 0; l < length; l++) {
+#ifdef USE_COLOR_CODE_FOR_BLOCK
+ dst.putBlock(expand(10));
+#else
+ dst.blockCopy(next_offs);
+#endif
+ i--;
+ if (i == 0) {
+ dst.advance(0, 3); // advance 3 lines
+ bh--;
+ i = bw;
+ }
+ }
+ if(bh == 0) return;
+ i++;
+ } else {
+#ifdef USE_COLOR_CODE_FOR_BLOCK
+ dst.putBlock(expand(11));
+#else
+ dst.blockCopy(_offsetTable[code] + next_offs); // copy from an offset !
+#endif
+ }
+ } while (--i);
+ dst.advance(0, 3); // advance 3 lines
+ } while (--bh);
+}
+
bool Codec37Decoder::decode(Blitter & dst, Chunk & src) {
int32 width = getRect().width();
int32 height = getRect().height();
@@ -414,13 +454,16 @@ bool Codec37Decoder::decode(Blitter & dst, Chunk & src) {
proc2(blit, src, decoded_size);
break;
case 3:
- if(mask_flag & 1)
+ if(mask_flag & 4)
proc3WithFDFE(blit, src, _deltaBufs[_curtable ^ 1] - _deltaBufs[_curtable], bw, bh);
else
proc3WithoutFDFE(blit, src, _deltaBufs[_curtable ^ 1] - _deltaBufs[_curtable], bw, bh);
break;
case 4:
- proc4(blit, src, _deltaBufs[_curtable ^ 1] - _deltaBufs[_curtable], bw, bh);
+ if(mask_flag & 4)
+ proc4WithFDFE(blit, src, _deltaBufs[_curtable ^ 1] - _deltaBufs[_curtable], bw, bh);
+ else
+ proc4WithoutFDFE(blit, src, _deltaBufs[_curtable ^ 1] - _deltaBufs[_curtable], bw, bh);
break;
default:
#ifdef DEBUG_CODEC37
diff --git a/scumm/smush/codec37.h b/scumm/smush/codec37.h
index 548615b80e..14908d3cb0 100644
--- a/scumm/smush/codec37.h
+++ b/scumm/smush/codec37.h
@@ -78,7 +78,8 @@ protected:
void proc2(Blitter &, Chunk &, int32);
void proc3WithFDFE(Blitter &, Chunk &, int32, int32, int32);
void proc3WithoutFDFE(Blitter &, Chunk &, int32, int32, int32);
- void proc4(Blitter &, Chunk &, int32, int32, int32);
+ void proc4WithFDFE(Blitter &, Chunk &, int32, int32, int32);
+ void proc4WithoutFDFE(Blitter &, Chunk &, int32, int32, int32);
public:
bool decode(Blitter &, Chunk &);
};