aboutsummaryrefslogtreecommitdiff
path: root/graphics/video
diff options
context:
space:
mode:
authorGregory Montoir2009-01-25 12:10:06 +0000
committerGregory Montoir2009-01-25 12:10:06 +0000
commit7f594fa21d820520f6e19559e5934bd495c96deb (patch)
tree7685ded12113a9703407623907a95f043f3365a1 /graphics/video
parent0a7b4fd14640fad30a94f165e749cf7c2967987b (diff)
downloadscummvm-rg350-7f594fa21d820520f6e19559e5934bd495c96deb.tar.gz
scummvm-rg350-7f594fa21d820520f6e19559e5934bd495c96deb.tar.bz2
scummvm-rg350-7f594fa21d820520f6e19559e5934bd495c96deb.zip
TUCKER: modified flic playback to make use of dirtyrects
svn-id: r36060
Diffstat (limited to 'graphics/video')
-rw-r--r--graphics/video/flic_player.cpp13
-rw-r--r--graphics/video/flic_player.h2
2 files changed, 15 insertions, 0 deletions
diff --git a/graphics/video/flic_player.cpp b/graphics/video/flic_player.cpp
index f1c051d480..f5a4fd4e63 100644
--- a/graphics/video/flic_player.cpp
+++ b/graphics/video/flic_player.cpp
@@ -77,6 +77,7 @@ bool FlicPlayer::loadFile(const char *fileName) {
if (_flicInfo.type != 0xAF12) {
warning("FlicPlayer::FlicPlayer(): attempted to load non-FLC data (type = 0x%04X)", _flicInfo.type);
delete _fileStream;
+ _fileStream = 0;
return false;
}
@@ -109,6 +110,8 @@ void FlicPlayer::closeFile() {
delete[] _offscreen;
_offscreen = 0;
+
+ _dirtyRects.clear();
}
void FlicPlayer::redraw() {
@@ -307,6 +310,16 @@ void FlicPlayer::setPalette(uint8 *mem) {
}
}
+void FlicPlayer::copyDirtyRectsToBuffer(uint8 *dst, uint pitch) {
+ for (Common::List<Common::Rect>::const_iterator it = _dirtyRects.begin(); it != _dirtyRects.end(); ++it) {
+ for (int y = (*it).top; y < (*it).bottom; ++y) {
+ const int x = (*it).left;
+ memcpy(dst + y * pitch + x, _offscreen + y * _flicInfo.width + x, (*it).right - x);
+ }
+ }
+ _dirtyRects.clear();
+}
+
void FlicPlayer::copyFrameToBuffer(byte *dst, uint x, uint y, uint pitch) {
uint h = _flicInfo.height;
uint w = _flicInfo.width;
diff --git a/graphics/video/flic_player.h b/graphics/video/flic_player.h
index 43f3775bdd..40aa0f4fdf 100644
--- a/graphics/video/flic_player.h
+++ b/graphics/video/flic_player.h
@@ -105,6 +105,8 @@ public:
void redraw();
void reset();
+ void copyDirtyRectsToBuffer(uint8 *dst, uint pitch);
+
/**
* Copy current frame into the specified position of the destination
* buffer.