[Scummvm-git-logs] scummvm master -> 61ce70f6e8eb93a4425d9201cb2279894432ff98

whoozle vladimir.menshakov at gmail.com
Tue Sep 1 20:55:20 UTC 2020


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

Summary:
b1bee9b372 GRAPHICS: Remove unimplemented colorkey methods from TransparentSurface
04943476b1 COMMON: Add Rect::getBlitRect() that ensures you did not blit out of src or dst surface boundaries
9be832dad7 VIDEO: Fix playback of FLC files created with non-EGI encoders (no frame1/2 pointers, no ext_flags)
61ce70f6e8 VIDEO: skip FLC file header if present


Commit: b1bee9b372db2328a2f4762e5956c3b194d295ac
    https://github.com/scummvm/scummvm/commit/b1bee9b372db2328a2f4762e5956c3b194d295ac
Author: Vladimir Menshakov (vladimir.menshakov at gmail.com)
Date: 2020-09-01T21:52:38+01:00

Commit Message:
GRAPHICS: Remove unimplemented colorkey methods from TransparentSurface

Changed paths:
    graphics/transparent_surface.h


diff --git a/graphics/transparent_surface.h b/graphics/transparent_surface.h
index ae0de7d2e2..3741344708 100644
--- a/graphics/transparent_surface.h
+++ b/graphics/transparent_surface.h
@@ -92,9 +92,6 @@ struct TransparentSurface : public Graphics::Surface {
 		return PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0);
 	}
 
-	void setColorKey(char r, char g, char b);
-	void disableColorKey();
-
 	/**
 	 @brief renders the surface to another surface
 	 @param target a pointer to the target surface. In most cases this is the framebuffer.


Commit: 04943476b19d66689fe3ad45f48e1ec1bbea088e
    https://github.com/scummvm/scummvm/commit/04943476b19d66689fe3ad45f48e1ec1bbea088e
Author: Vladimir Menshakov (vladimir.menshakov at gmail.com)
Date: 2020-09-01T21:52:42+01:00

Commit Message:
COMMON: Add Rect::getBlitRect() that ensures you did not blit out of src or dst surface boundaries

Changed paths:
    common/rect.h


diff --git a/common/rect.h b/common/rect.h
index 135076bf1e..96fbe0cbf6 100644
--- a/common/rect.h
+++ b/common/rect.h
@@ -267,6 +267,34 @@ struct Rect {
 		int x = cx - w / 2, y = cy - h / 2;
 		return Rect(x, y, x + w, y + h);
 	}
+
+	/**
+	 * Given target surface with size clip, this function ensures that
+	 * blit arguments dst, rect are within clip rectangle.
+	 * @param dst blit destination coordinates
+	 * @param rect blit source rectangle
+	 * @param clip clip rectangle (size of destination surface)
+	 */
+	static bool getBlitRect(Point &dst, Rect &rect, const Rect &clip) {
+		if (dst.x < clip.left) {
+			rect.left += clip.left - dst.x;
+			dst.x = clip.left;
+		}
+
+		if (dst.y < clip.top) {
+			rect.top += clip.top - dst.y;
+			dst.y = clip.top;
+		}
+
+		int right = dst.x + rect.right;
+		if (right > clip.right)
+			rect.right -= right - clip.right;
+
+		int bottom = dst.y + rect.bottom;
+		if (bottom > clip.bottom)
+			rect.bottom -= bottom - clip.bottom;
+		return !rect.isEmpty();
+	}
 };
 
 } // End of namespace Common


Commit: 9be832dad7cce67955c02799ce6cc704e27fa444
    https://github.com/scummvm/scummvm/commit/9be832dad7cce67955c02799ce6cc704e27fa444
Author: Vladimir Menshakov (vladimir.menshakov at gmail.com)
Date: 2020-09-01T21:52:42+01:00

Commit Message:
VIDEO: Fix playback of FLC files created with non-EGI encoders (no frame1/2 pointers, no ext_flags)

Changed paths:
    video/flic_decoder.cpp


diff --git a/video/flic_decoder.cpp b/video/flic_decoder.cpp
index a3d8ff6bc7..b9d4d06e21 100644
--- a/video/flic_decoder.cpp
+++ b/video/flic_decoder.cpp
@@ -121,6 +121,9 @@ void FlicDecoder::FlicVideoTrack::readHeader() {
 	_offsetFrame1 = _fileStream->readUint32LE();
 	_offsetFrame2 = _fileStream->readUint32LE();
 
+	if (_offsetFrame1 == 0)
+		_offsetFrame1 = 0x80; //length of FLIC header
+
 	// Seek to the first frame
 	_fileStream->seek(_offsetFrame1);
 }


Commit: 61ce70f6e8eb93a4425d9201cb2279894432ff98
    https://github.com/scummvm/scummvm/commit/61ce70f6e8eb93a4425d9201cb2279894432ff98
Author: Vladimir Menshakov (vladimir.menshakov at gmail.com)
Date: 2020-09-01T21:54:22+01:00

Commit Message:
VIDEO: skip FLC file header if present

Changed paths:
    video/flic_decoder.cpp


diff --git a/video/flic_decoder.cpp b/video/flic_decoder.cpp
index b9d4d06e21..3d1bc0d83b 100644
--- a/video/flic_decoder.cpp
+++ b/video/flic_decoder.cpp
@@ -156,12 +156,14 @@ Graphics::PixelFormat FlicDecoder::FlicVideoTrack::getPixelFormat() const {
 	return _surface->format;
 }
 
-#define FLI_SETPAL 4
-#define FLI_SS2    7
-#define FLI_BRUN   15
-#define FLI_COPY   16
-#define PSTAMP     18
-#define FRAME_TYPE 0xF1FA
+#define FLI_SETPAL				4
+#define FLI_SS2					7
+#define FLI_BRUN				15
+#define FLI_COPY				16
+#define PSTAMP					18
+#define FRAME_TYPE				0xF1FA
+#define FLC_FILE_HEADER			0xAF12
+#define FLC_FILE_HEADER_SIZE	0x80
 
 const Graphics::Surface *FlicDecoder::FlicVideoTrack::decodeNextFrame() {
 	// Read chunk
@@ -172,6 +174,9 @@ const Graphics::Surface *FlicDecoder::FlicVideoTrack::decodeNextFrame() {
 	case FRAME_TYPE:
 		handleFrame();
 		break;
+	case FLC_FILE_HEADER:
+		_fileStream->skip(FLC_FILE_HEADER_SIZE - 6); //skip 0x80 file header subtracting 6 bytes of header
+		break;
 	default:
 		error("FlicDecoder::decodeFrame(): unknown main chunk type (type = 0x%02X)", frameType);
 		break;




More information about the Scummvm-git-logs mailing list