aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorD G Turner2012-12-26 02:39:54 +0000
committerD G Turner2012-12-26 02:41:31 +0000
commitb65b196e565b0a22a6ba0fbbabfa3349f98cf051 (patch)
tree4d2454747e0c1fd7da20783d0477b5b0a4189de6
parent5fecf5bcb53e253980cb82b4dac7d2c2e0d86eab (diff)
downloadscummvm-rg350-b65b196e565b0a22a6ba0fbbabfa3349f98cf051.tar.gz
scummvm-rg350-b65b196e565b0a22a6ba0fbbabfa3349f98cf051.tar.bz2
scummvm-rg350-b65b196e565b0a22a6ba0fbbabfa3349f98cf051.zip
VIDEO: Add support for missing copyFrame type in FLIC decoder.
Thanks to Tomaz^ for this patch.
-rw-r--r--video/flic_decoder.cpp12
-rw-r--r--video/flic_decoder.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/video/flic_decoder.cpp b/video/flic_decoder.cpp
index 1a0627615b..de545366b1 100644
--- a/video/flic_decoder.cpp
+++ b/video/flic_decoder.cpp
@@ -152,6 +152,7 @@ Graphics::PixelFormat FlicDecoder::FlicVideoTrack::getPixelFormat() const {
#define FLI_SETPAL 4
#define FLI_SS2 7
#define FLI_BRUN 15
+#define FLI_COPY 16
#define PSTAMP 18
#define FRAME_TYPE 0xF1FA
@@ -212,6 +213,9 @@ const Graphics::Surface *FlicDecoder::FlicVideoTrack::decodeNextFrame() {
case FLI_BRUN:
decodeByteRun(data);
break;
+ case FLI_COPY:
+ copyFrame(data);
+ break;
case PSTAMP:
/* PSTAMP - skip for now */
break;
@@ -247,6 +251,14 @@ void FlicDecoder::FlicVideoTrack::copyDirtyRectsToBuffer(uint8 *dst, uint pitch)
clearDirtyRects();
}
+void FlicDecoder::FlicVideoTrack::copyFrame(uint8 *data) {
+ memcpy((byte *)_surface->pixels, data, getWidth() * getHeight());
+
+ // Redraw
+ _dirtyRects.clear();
+ _dirtyRects.push_back(Common::Rect(0, 0, getWidth(), getHeight()));
+}
+
void FlicDecoder::FlicVideoTrack::decodeByteRun(uint8 *data) {
byte *ptr = (byte *)_surface->pixels;
while ((int32)(ptr - (byte *)_surface->pixels) < (getWidth() * getHeight())) {
diff --git a/video/flic_decoder.h b/video/flic_decoder.h
index 9037af05d6..c20a092a32 100644
--- a/video/flic_decoder.h
+++ b/video/flic_decoder.h
@@ -97,6 +97,7 @@ private:
Common::List<Common::Rect> _dirtyRects;
+ void copyFrame(uint8 *data);
void decodeByteRun(uint8 *data);
void decodeDeltaFLC(uint8 *data);
void unpackPalette(uint8 *mem);