aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorFilippos Karapetis2009-01-05 17:05:50 +0000
committerFilippos Karapetis2009-01-05 17:05:50 +0000
commit70ab22e9f2d37e8bdc2d64743676668bb87c8f9f (patch)
tree288ae4ef4ba43ac10e8e90c4a86ad8bb5481e706 /graphics
parent7f9ea7e35c907d44ce84e990b1b3258e214fac91 (diff)
downloadscummvm-rg350-70ab22e9f2d37e8bdc2d64743676668bb87c8f9f.tar.gz
scummvm-rg350-70ab22e9f2d37e8bdc2d64743676668bb87c8f9f.tar.bz2
scummvm-rg350-70ab22e9f2d37e8bdc2d64743676668bb87c8f9f.zip
Added a copyFrameToBuffer() method to the FLIC player too, like in the other players
svn-id: r35742
Diffstat (limited to 'graphics')
-rw-r--r--graphics/video/flic_player.cpp14
-rw-r--r--graphics/video/flic_player.h11
2 files changed, 25 insertions, 0 deletions
diff --git a/graphics/video/flic_player.cpp b/graphics/video/flic_player.cpp
index e07c815390..42d063f9ff 100644
--- a/graphics/video/flic_player.cpp
+++ b/graphics/video/flic_player.cpp
@@ -273,4 +273,18 @@ void FlicPlayer::setPalette(uint8 *mem) {
}
}
+void FlicPlayer::copyFrameToBuffer(byte *dst, uint x, uint y, uint pitch) {
+ uint h = _flicInfo.height;
+ uint w = _flicInfo.width;
+
+ byte *src = (byte *)_offscreen;
+ dst += y * pitch + x;
+
+ do {
+ memcpy(dst, src, w);
+ dst += pitch;
+ src += w;
+ } while (--h);
+}
+
} // End of namespace Graphics
diff --git a/graphics/video/flic_player.h b/graphics/video/flic_player.h
index c453bf91c5..73d086cbec 100644
--- a/graphics/video/flic_player.h
+++ b/graphics/video/flic_player.h
@@ -113,7 +113,18 @@ public:
void redraw();
void reset();
+ /**
+ * Copy current frame into the specified position of the destination
+ * buffer.
+ * @param dst the buffer
+ * @param x the x position of the buffer
+ * @param y the y position of the buffer
+ * @param pitch the pitch of buffer
+ */
+ void copyFrameToBuffer(byte *dst, uint x, uint y, uint pitch);
+
protected:
+
ChunkHeader readChunkHeader();
FrameTypeChunkHeader readFrameTypeChunkHeader(ChunkHeader chunkHead);
void decodeByteRun(uint8 *data);