aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/lab/anim.cpp55
-rw-r--r--engines/lab/anim.h6
2 files changed, 13 insertions, 48 deletions
diff --git a/engines/lab/anim.cpp b/engines/lab/anim.cpp
index ee636604e8..bb5c5e9e88 100644
--- a/engines/lab/anim.cpp
+++ b/engines/lab/anim.cpp
@@ -162,25 +162,6 @@ void Anim::unDiffByteWord(uint16 *dest, uint16 *diff) {
}
}
-/*****************************************************************************/
-/* UnDiffs a coded DIFF string onto an already initialized piece of memory. */
-/*****************************************************************************/
-bool Anim::unDiffMemory(byte *dest, byte *diff, uint16 headerSize, uint16 copySize) {
- if (headerSize == 1) {
- if (copySize == 1)
- unDiffByteByte(dest, diff);
-
- else if (copySize == 2)
- unDiffByteWord((uint16 *)dest, (uint16 *)diff);
-
- else
- return false;
- } else
- error("unDIFFMemory: HeaderSize is %d", headerSize);
-
- return true;
-}
-
/*------------------------- unDiff Vertical Memory --------------------------*/
/*****************************************************************************/
@@ -305,25 +286,6 @@ void Anim::VUnDiffByteLong(uint32 *dest, uint32 *diff, uint16 bytesPerRow) {
}
/*****************************************************************************/
-/* UnDiffs a coded DIFF string onto an already initialized piece of memory. */
-/*****************************************************************************/
-bool Anim::VUnDiffMemory(byte *dest, byte *diff, uint16 headerSize, uint16 copySize, uint16 bytesPerRow) {
- if (headerSize == 1) {
- if (copySize == 1)
- VUnDiffByteByte(dest, diff, bytesPerRow);
- else if (copySize == 2)
- VUnDiffByteWord((uint16 *)dest, (uint16 *)diff, bytesPerRow);
- else if (copySize == 4)
- VUnDiffByteLong((uint32 *)dest, (uint32 *)diff, bytesPerRow);
- else
- return false;
- } else
- return (false);
-
- return true;
-}
-
-/*****************************************************************************/
/* Runlength decodes a chunk of memory. */
/*****************************************************************************/
void Anim::runLengthDecode(byte *dest, byte *source) {
@@ -403,10 +365,19 @@ void Anim::unDiff(byte *newBuf, byte *oldBuf, byte *diffData, uint16 bytesPerRow
byte bufType = *diffData;
diffData++;
- if (isV)
- VUnDiffMemory(newBuf, diffData, 1, bufType + 1, bytesPerRow);
- else
- unDiffMemory(newBuf, diffData, 1, bufType + 1);
+ if (isV) {
+ if (bufType == 0)
+ VUnDiffByteByte(newBuf, diffData, bytesPerRow);
+ else if (bufType == 1)
+ VUnDiffByteWord((uint16 *)newBuf, (uint16 *)diffData, bytesPerRow);
+ else if (bufType == 3)
+ VUnDiffByteLong((uint32 *)newBuf, (uint32 *)diffData, bytesPerRow);
+ } else {
+ if (bufType == 0)
+ unDiffByteByte(newBuf, diffData);
+ else if (bufType == 1)
+ unDiffByteWord((uint16 *)newBuf, (uint16 *)diffData);
+ }
}
void Anim::readBlock(void *Buffer, uint32 Size, byte **File) {
diff --git a/engines/lab/anim.h b/engines/lab/anim.h
index 54efa4fcfa..98413472ea 100644
--- a/engines/lab/anim.h
+++ b/engines/lab/anim.h
@@ -87,16 +87,10 @@ private:
BitMap bit2;
BitMap *DrawBitMap;
- bool unDiffMemory(byte *dest, /* Where to Un-DIFF */
- byte *diff, /* The DIFFed code. */
- uint16 headerSize, /* Size of header (1, 2 or 4 bytes) (only supports 1 currently */
- uint16 copySize); /* Size of minimum copy or skip. (1, 2 or 4 bytes) */
-
void runLengthDecode(byte *dest, byte *source);
void VRunLengthDecode(byte *dest, byte *source, uint16 bytesPerRow);
void unDiffByteByte(byte *dest, byte *diff);
void unDiffByteWord(uint16 *dest, uint16 *diff);
- bool VUnDiffMemory(byte *dest, byte *diff, uint16 headerSize, uint16 copySize, uint16 bytesPerRow);
void VUnDiffByteByte(byte *Dest, byte *diff, uint16 bytesperrow);
void VUnDiffByteWord(uint16 *Dest, uint16 *diff, uint16 bytesperrow);
void VUnDiffByteLong(uint32 *Dest, uint32 *diff, uint16 bytesperrow);