aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTorbjörn Andersson2006-06-03 09:43:10 +0000
committerTorbjörn Andersson2006-06-03 09:43:10 +0000
commit3114f19d9461037ecea9ef3fd42f65dd4f8357df (patch)
treeaac454f0c6e6e043e648556e31d49eb7558156d8 /engines
parent4b706aca434ac7c2753c3d73bcf4022be0b2cde6 (diff)
downloadscummvm-rg350-3114f19d9461037ecea9ef3fd42f65dd4f8357df.tar.gz
scummvm-rg350-3114f19d9461037ecea9ef3fd42f65dd4f8357df.tar.bz2
scummvm-rg350-3114f19d9461037ecea9ef3fd42f65dd4f8357df.zip
MPEG player fixes:
* Initialise _frameWidth and _frameHeight to prevent them from being undefined. * Fix BS2 subtitle positioning. (Fixes bug #1499916) * In BS2, copy the frame to the backend in 8-bit mode. * Fix compilation in 8-bit mode. BS2 subtitles aren't quite right in 8-bit mode, but I expect we want to re-design things a bit if we ever add DXA cutscenes. We can fix minor details then. svn-id: r22859
Diffstat (limited to 'engines')
-rw-r--r--engines/sword2/animation.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/engines/sword2/animation.cpp b/engines/sword2/animation.cpp
index c7b102a26b..50adeef69b 100644
--- a/engines/sword2/animation.cpp
+++ b/engines/sword2/animation.cpp
@@ -53,7 +53,11 @@ void AnimationState::setPalette(byte *pal) {
#else
void AnimationState::drawTextObject(SpriteInfo *s, byte *src) {
- OverlayColor *dst = _overlay + _movieScale * _movieWidth * _movieScale * s->y + _movieScale * s->x;
+ int moviePitch = _movieScale * _movieWidth;
+ int textX = _movieScale * s->x;
+ int textY = _movieScale * (_frameHeight - s->h - 12);
+
+ OverlayColor *dst = _overlay + textY * moviePitch + textX;
OverlayColor pen = _sys->RGBToColor(255, 255, 255);
OverlayColor border = _sys->RGBToColor(0, 0, 0);
@@ -88,12 +92,12 @@ void AnimationState::drawTextObject(SpriteInfo *s, byte *src) {
}
if (_movieScale > 1) {
- memcpy(dst + _movieScale * _movieWidth, dst, _movieScale * s->w * sizeof(OverlayColor));
+ memcpy(dst + moviePitch, dst, _movieScale * s->w * sizeof(OverlayColor));
if (_movieScale > 2)
- memcpy(dst + 2 * _movieScale * _movieWidth, dst, _movieScale * s->w * sizeof(OverlayColor));
+ memcpy(dst + 2 * moviePitch, dst, _movieScale * s->w * sizeof(OverlayColor));
}
- dst += _movieScale * _movieScale * _movieWidth;
+ dst += _movieScale * moviePitch;
src += s->w;
}
}
@@ -101,9 +105,6 @@ void AnimationState::drawTextObject(SpriteInfo *s, byte *src) {
#endif
void AnimationState::clearScreen() {
- _frameWidth = _movieWidth;
- _frameHeight = _movieHeight;
-
#ifdef BACKEND_8BIT
memset(_vm->_screen->getScreen(), 0, _movieWidth * _movieHeight);
#else
@@ -273,6 +274,7 @@ void MoviePlayer::playMPEG(const char *filename, MovieTextObject *text[], byte *
if (!anim->init(filename)) {
delete anim;
+ anim = NULL;
// Missing Files? Use the old 'Narration Only' hack
playDummy(filename, text, leadOut, leadOutLen);
return;
@@ -318,6 +320,10 @@ void MoviePlayer::playMPEG(const char *filename, MovieTextObject *text[], byte *
drawTextObject(anim, text[textCounter]);
}
+#ifdef BACKEND_8BIT
+ _sys->copyRectToScreen(_vm->_screen->getScreen(), 640, 0, 0, 640, 480);
+#endif
+
anim->updateScreen();
frameCounter++;
@@ -390,6 +396,7 @@ void MoviePlayer::playMPEG(const char *filename, MovieTextObject *text[], byte *
_vm->_screen->setPalette(0, 256, oldPal, RDPAL_INSTANT);
delete anim;
+ anim = NULL;
}
/**