From 70ab22e9f2d37e8bdc2d64743676668bb87c8f9f Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 5 Jan 2009 17:05:50 +0000 Subject: [PATCH] Added a copyFrameToBuffer() method to the FLIC player too, like in the other players svn-id: r35742 --- graphics/video/flic_player.cpp | 14 ++++++++++++++ graphics/video/flic_player.h | 11 +++++++++++ 2 files changed, 25 insertions(+) diff --git a/graphics/video/flic_player.cpp b/graphics/video/flic_player.cpp index e07c8153904..42d063f9ffd 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 c453bf91c5f..73d086cbec3 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);