[Scummvm-cvs-logs] scummvm master -> ea9599b763e0e8aef55282d621828ebfc7b1a9f6

dreammaster dreammaster at scummvm.org
Wed Oct 15 03:38:16 CEST 2014


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
ea9599b763 MADS: Implement subtitles for animation cutscenes


Commit: ea9599b763e0e8aef55282d621828ebfc7b1a9f6
    https://github.com/scummvm/scummvm/commit/ea9599b763e0e8aef55282d621828ebfc7b1a9f6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2014-10-14T21:37:00-04:00

Commit Message:
MADS: Implement subtitles for animation cutscenes

Changed paths:
    engines/mads/animation.cpp
    engines/mads/animation.h
    engines/mads/nebular/menu_nebular.cpp



diff --git a/engines/mads/animation.cpp b/engines/mads/animation.cpp
index bc3708b..9f0e0ad 100644
--- a/engines/mads/animation.cpp
+++ b/engines/mads/animation.cpp
@@ -537,49 +537,44 @@ void Animation::update() {
 		} else if ((_currentFrame >= _messages[idx]._startFrame) && (_currentFrame <= _messages[idx]._endFrame)) {
 			// Start displaying the message
 			AnimMessage &me = _messages[idx];
-			uint8 colIndex1, colIndex2;
 
 			if (_flags & ANIMFLAG_ANIMVIEW) {
 				_rgbResult = palette._paletteUsage.checkRGB(me._rgb1, -1, true, &_palIndex1);
 				_rgbResult = palette._paletteUsage.checkRGB(me._rgb2, _rgbResult, true, &_palIndex2);
 
 				// Update the palette with the two needed colors
-				int palCount = _palIndex2 - _palIndex1;
-				if (palCount < 0)
-					palCount = _palIndex1 - _palIndex2 + 1;
-				palette.setPalette(palette._mainPalette, MIN(_palIndex1, _palIndex2), palCount);
-
-				colIndex1 = _palIndex1;
-				colIndex2 = _palIndex2;
+				int palStart = MIN(_palIndex1, _palIndex2);
+				int palCount = ABS(_palIndex2 - _palIndex1) + 1;
+				palette.setPalette(&palette._mainPalette[palStart * 3], palStart, palCount);
 			} else {
 				// The color index to use is dependant on how many messages are currently on-screen
 				switch (_messageCtr) {
 				case 1:
-					colIndex1 = 252;
+					_palIndex1 = 252;
 					break;
 				case 2:
-					colIndex1 = 16;
+					_palIndex1 = 16;
 					break;
 				default:
-					colIndex1 = 250;
+					_palIndex1 = 250;
 					break;
 				}
-				colIndex2 = colIndex1 + 1;
+				_palIndex2 = _palIndex1 + 1;
 
-				_vm->_palette->setEntry(colIndex1, me._rgb1[0], me._rgb1[1], me._rgb1[2]);
-				_vm->_palette->setEntry(colIndex2, me._rgb2[0], me._rgb2[1], me._rgb2[2]);
+				_vm->_palette->setEntry(_palIndex1, me._rgb1[0], me._rgb1[1], me._rgb1[2]);
+				_vm->_palette->setEntry(_palIndex2, me._rgb2[0], me._rgb2[1], me._rgb2[2]);
 			}
 
 			// Add a kernel message to display the given text
 			me._kernelMsgIndex = scene._kernelMessages.add(me._pos,
-				colIndex1 | (colIndex2 << 8),
+				_palIndex1 | (_palIndex2 << 8),
 				0, 0, INDEFINITE_TIMEOUT, me._msg);
 			assert(me._kernelMsgIndex >= 0);
 			++_messageCtr;
 
 			// If there's an accompanying sound, also play it
 			if (me._soundId > 0)
-				_vm->_audio->playSound(me._soundId);
+				_vm->_audio->playSound(me._soundId - 1);
 		}
 	}
 
diff --git a/engines/mads/animation.h b/engines/mads/animation.h
index b7e98e7..8b85a53 100644
--- a/engines/mads/animation.h
+++ b/engines/mads/animation.h
@@ -38,7 +38,7 @@ enum AnimFlag {
 	ANIMFLAG_CUSTOM_FONT		= 0x2000,	// Load ccustom font
 	ANIMFLAG_LOAD_BACKGROUND	= 0x0100,	// Load background
 	ANIMFLAG_LOAD_BACKGROUND_ONLY = 0x0200,	// Load background only
-	ANIMFLAG_ANIMVIEW			= 0x8000	// Cutscene animation
+	ANIMFLAG_ANIMVIEW			= 0x4000	// Cutscene animation
 };
 
 enum AnimBgType {
diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp
index 0d7b11c..64c91d5 100644
--- a/engines/mads/nebular/menu_nebular.cpp
+++ b/engines/mads/nebular/menu_nebular.cpp
@@ -55,6 +55,8 @@ void MenuView::show() {
 
 	while (!_breakFlag && !_vm->shouldQuit()) {
 		if (_redrawFlag) {
+			scene._kernelMessages.update();
+
 			_vm->_game->_scene.drawElements(_vm->_game->_fx, _vm->_game->_fx);
 			_redrawFlag = false;
 		}






More information about the Scummvm-git-logs mailing list