aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/he
diff options
context:
space:
mode:
Diffstat (limited to 'engines/scumm/he')
-rw-r--r--engines/scumm/he/animation_he.cpp27
-rw-r--r--engines/scumm/he/animation_he.h3
-rw-r--r--engines/scumm/he/script_v100he.cpp2
-rw-r--r--engines/scumm/he/script_v90he.cpp2
4 files changed, 13 insertions, 21 deletions
diff --git a/engines/scumm/he/animation_he.cpp b/engines/scumm/he/animation_he.cpp
index 5bd60d32e3..9f1bf22c38 100644
--- a/engines/scumm/he/animation_he.cpp
+++ b/engines/scumm/he/animation_he.cpp
@@ -46,23 +46,21 @@ int MoviePlayer::getImageNum() {
}
int MoviePlayer::load(const char *filename, int flags, int image) {
- if (isVideoLoaded()) {
- closeFile();
- }
+ if (isVideoLoaded())
+ close();
if (!loadFile(filename)) {
warning("Failed to load video file %s", filename);
return -1;
}
+
debug(1, "Playing video %s", filename);
- if (flags & 2) {
+ if (flags & 2)
_vm->_wiz->createWizEmptyImage(image, 0, 0, getWidth(), getHeight());
- }
_flags = flags;
_wizResNum = image;
-
return 0;
}
@@ -70,7 +68,11 @@ void MoviePlayer::copyFrameToBuffer(byte *dst, int dstType, uint x, uint y, uint
uint h = getHeight();
uint w = getWidth();
- byte *src = _videoFrameBuffer;
+ Graphics::Surface *surface = decodeNextFrame();
+ byte *src = (byte *)surface->pixels;
+
+ if (hasDirtyPalette())
+ _vm->setPaletteFromPtr(getPalette(), 256);
if (_vm->_game.features & GF_16BIT_COLOR) {
dst += y * pitch + x * 2;
@@ -102,14 +104,11 @@ void MoviePlayer::copyFrameToBuffer(byte *dst, int dstType, uint x, uint y, uint
}
void MoviePlayer::handleNextFrame() {
- if (!isVideoLoaded()) {
+ if (!isVideoLoaded())
return;
- }
VirtScreen *pvs = &_vm->_virtscr[kMainVirtScreen];
- decodeNextFrame();
-
if (_flags & 2) {
uint8 *dstPtr = _vm->getResourceAddress(rtImage, _wizResNum);
assert(dstPtr);
@@ -129,11 +128,7 @@ void MoviePlayer::handleNextFrame() {
}
if (endOfVideo())
- closeFile();
-}
-
-void MoviePlayer::setPalette(byte *pal) {
- _vm->setPaletteFromPtr(pal, 256);
+ close();
}
} // End of namespace Scumm
diff --git a/engines/scumm/he/animation_he.h b/engines/scumm/he/animation_he.h
index 86ded31940..34794b35ac 100644
--- a/engines/scumm/he/animation_he.h
+++ b/engines/scumm/he/animation_he.h
@@ -56,9 +56,6 @@ public:
void copyFrameToBuffer(byte *dst, int dstType, uint x, uint y, uint pitch);
void handleNextFrame();
-
-protected:
- virtual void setPalette(byte *pal);
};
} // End of namespace Scumm
diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp
index e32409fe85..3555f55d95 100644
--- a/engines/scumm/he/script_v100he.cpp
+++ b/engines/scumm/he/script_v100he.cpp
@@ -2254,7 +2254,7 @@ void ScummEngine_v100he::o100_videoOps() {
}
} else if (_videoParams.status == 19) {
// Stop video
- _moviePlay->closeFile();
+ _moviePlay->close();
}
break;
default:
diff --git a/engines/scumm/he/script_v90he.cpp b/engines/scumm/he/script_v90he.cpp
index 091bf5027b..6acc16a804 100644
--- a/engines/scumm/he/script_v90he.cpp
+++ b/engines/scumm/he/script_v90he.cpp
@@ -1437,7 +1437,7 @@ void ScummEngine_v90he::o90_videoOps() {
}
} else if (_videoParams.status == 165) {
// Stop video
- _moviePlay->closeFile();
+ _moviePlay->close();
}
break;
default: