[Scummvm-git-logs] scummvm master -> 92454c2c0cdfafd91a48e15bc76e7090688a2541

AndywinXp noreply at scummvm.org
Wed Dec 21 18:58:23 UTC 2022


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
92454c2c0c SCUMM: SMUSH: Relabel codecs 1, 3 and 20


Commit: 92454c2c0cdfafd91a48e15bc76e7090688a2541
    https://github.com/scummvm/scummvm/commit/92454c2c0cdfafd91a48e15bc76e7090688a2541
Author: AndywinXp (andywinxp at gmail.com)
Date: 2022-12-21T19:58:17+01:00

Commit Message:
SCUMM: SMUSH: Relabel codecs 1, 3 and 20

Changed paths:
    engines/scumm/nut_renderer.cpp
    engines/scumm/smush/codec1.cpp
    engines/scumm/smush/codec20.cpp
    engines/scumm/smush/smush_player.cpp
    engines/scumm/smush/smush_player.h


diff --git a/engines/scumm/nut_renderer.cpp b/engines/scumm/nut_renderer.cpp
index 52d6b345e9e..9a0a7164f59 100644
--- a/engines/scumm/nut_renderer.cpp
+++ b/engines/scumm/nut_renderer.cpp
@@ -58,10 +58,10 @@ NutRenderer::~NutRenderer() {
 	delete[] _2byteColorTable;
 }
 
-void smush_decode_codec1(byte *dst, const byte *src, int left, int top, int width, int height, int pitch);
+void smushDecodeRLE(byte *dst, const byte *src, int left, int top, int width, int height, int pitch);
 
 void NutRenderer::codec1(byte *dst, const byte *src, int width, int height, int pitch) {
-	smush_decode_codec1(dst, src, 0, 0, width, height, pitch);
+	smushDecodeRLE(dst, src, 0, 0, width, height, pitch);
 	for (int i = 0; i < width * height; i++)
 		_paletteMap[dst[i]] = 1;
 }
diff --git a/engines/scumm/smush/codec1.cpp b/engines/scumm/smush/codec1.cpp
index f3f5a1cea7c..15dc7c0bcb7 100644
--- a/engines/scumm/smush/codec1.cpp
+++ b/engines/scumm/smush/codec1.cpp
@@ -24,28 +24,28 @@
 
 namespace Scumm {
 
-void smush_decode_codec1(byte *dst, const byte *src, int left, int top, int width, int height, int pitch) {
+void smushDecodeRLE(byte *dst, const byte *src, int left, int top, int width, int height, int pitch) {
 	byte val, code;
 	int32 length;
-	int h = height, size_line;
+	int h = height, lineSize;
 
 	dst += top * pitch;
 	for (h = 0; h < height; h++) {
-		size_line = READ_LE_UINT16(src);
+		lineSize = READ_LE_UINT16(src);
 		src += 2;
 		dst += left;
-		while (size_line > 0) {
+		while (lineSize > 0) {
 			code = *src++;
-			size_line--;
+			lineSize--;
 			length = (code >> 1) + 1;
 			if (code & 1) {
 				val = *src++;
-				size_line--;
+				lineSize--;
 				if (val)
 					memset(dst, val, length);
 				dst += length;
 			} else {
-				size_line -= length;
+				lineSize -= length;
 				while (length--) {
 					val = *src++;
 					if (val)
diff --git a/engines/scumm/smush/codec20.cpp b/engines/scumm/smush/codec20.cpp
index 92c3eb73a9f..38d5a090ff0 100644
--- a/engines/scumm/smush/codec20.cpp
+++ b/engines/scumm/smush/codec20.cpp
@@ -24,7 +24,7 @@
 
 namespace Scumm {
 
-void smush_decode_codec20(byte *dst, const byte *src, int left, int top, int width, int height, int pitch) {
+void smushDecodeUncompressed(byte *dst, const byte *src, int left, int top, int width, int height, int pitch) {
 	if (width == 0 || height == 0)
 		return;
 
diff --git a/engines/scumm/smush/smush_player.cpp b/engines/scumm/smush/smush_player.cpp
index 49f2595c82f..de2bdd4c421 100644
--- a/engines/scumm/smush/smush_player.cpp
+++ b/engines/scumm/smush/smush_player.cpp
@@ -742,8 +742,8 @@ byte *SmushPlayer::getVideoPalette() {
 	return _pal;
 }
 
-void smush_decode_codec1(byte *dst, const byte *src, int left, int top, int width, int height, int pitch);
-void smush_decode_codec20(byte *dst, const byte *src, int left, int top, int width, int height, int pitch);
+void smushDecodeRLE(byte *dst, const byte *src, int left, int top, int width, int height, int pitch);
+void smushDecodeUncompressed(byte *dst, const byte *src, int left, int top, int width, int height, int pitch);
 
 void SmushPlayer::decodeFrameObject(int codec, const uint8 *src, int left, int top, int width, int height) {
 	if ((height == 242) && (width == 384)) {
@@ -767,25 +767,25 @@ void SmushPlayer::decodeFrameObject(int codec, const uint8 *src, int left, int t
 	}
 
 	switch (codec) {
-	case 1:
-	case 3:
-		smush_decode_codec1(_dst, src, left, top, width, height, _vm->_screenWidth);
+	case SMUSH_CODEC_RLE:
+	case SMUSH_CODEC_RLE_ALT:
+		smushDecodeRLE(_dst, src, left, top, width, height, _vm->_screenWidth);
 		break;
-	case 37:
+	case SMUSH_CODEC_37:
 		if (!_codec37)
 			_codec37 = new Codec37Decoder(width, height);
 		if (_codec37)
 			_codec37->decode(_dst, src);
 		break;
-	case 47:
+	case SMUSH_CODEC_47:
 		if (!_codec47)
 			_codec47 = new Codec47Decoder(width, height);
 		if (_codec47)
 			_codec47->decode(_dst, src);
 		break;
-	case 20:
+	case SMUSH_CODEC_UNCOMPRESSED:
 		// Used by Full Throttle Classic (from Remastered)
-		smush_decode_codec20(_dst, src, left, top, width, height, _vm->_screenWidth);
+		smushDecodeUncompressed(_dst, src, left, top, width, height, _vm->_screenWidth);
 		break;
 	default:
 		error("Invalid codec for frame object : %d", codec);
diff --git a/engines/scumm/smush/smush_player.h b/engines/scumm/smush/smush_player.h
index a813c62a0d5..84b9500c260 100644
--- a/engines/scumm/smush/smush_player.h
+++ b/engines/scumm/smush/smush_player.h
@@ -54,6 +54,12 @@ namespace Scumm {
 
 #define TRK_TYPE_MASK 0xC0
 
+#define SMUSH_CODEC_RLE          1
+#define SMUSH_CODEC_RLE_ALT      3
+#define SMUSH_CODEC_UNCOMPRESSED 20
+#define SMUSH_CODEC_37           37 // TODO: Relabel!
+#define SMUSH_CODEC_47           47 // TODO: Relabel!
+
 class ScummEngine_v7;
 class SmushFont;
 class SmushMixer;




More information about the Scummvm-git-logs mailing list