[Scummvm-git-logs] scummvm master -> 9ca4dcceb7f0245148c646ad69bf71cbf20d3c02

AndywinXp noreply at scummvm.org
Mon Mar 16 21:09:05 UTC 2026


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

Summary:
f5b2376ad2 SCUMM: Implement UI and functionality for loading original playback files for FoA, MI1 and MI2.
9ca4dcceb7 SCUMM: Playback - Remove code duplication inside showBannerAndPauseForTextInput


Commit: f5b2376ad2b7854fc72a7bce413e96b0e5107628
    https://github.com/scummvm/scummvm/commit/f5b2376ad2b7854fc72a7bce413e96b0e5107628
Author: Robert Megone (robert.megone at gmail.com)
Date: 2026-03-16T22:08:59+01:00

Commit Message:
SCUMM: Implement UI and functionality for loading original playback files for FoA, MI1 and MI2.

Changed paths:
    engines/scumm/gfx_gui.cpp
    engines/scumm/input.cpp
    engines/scumm/playback.cpp
    engines/scumm/scumm.cpp
    engines/scumm/scumm.h


diff --git a/engines/scumm/gfx_gui.cpp b/engines/scumm/gfx_gui.cpp
index d6a68b61497..e013bb9561c 100644
--- a/engines/scumm/gfx_gui.cpp
+++ b/engines/scumm/gfx_gui.cpp
@@ -331,6 +331,227 @@ Common::KeyState ScummEngine::showBannerAndPause(int bannerId, int32 waitTime, c
 	return ks;
 }
 
+bool ScummEngine::showBannerAndPauseForTextInput(int bannerId, const char *prompt, Common::String &input, uint maxLength) {
+	const Common::String promptString(prompt);
+	Common::String shownText;
+	int rightLineColor, leftLineColor, bottomLineColor, topLineColor;
+	int normalTextColor, normalFillColor;
+	int oldScreenTop = _screenTop;
+	int oldId;
+
+	_messageBannerActive = true;
+
+	if (isSmushActive())
+		_screenTop = 0;
+
+	if (_game.version < 7 && !_mainMenuIsActive && _game.platform != Common::kPlatformFMTowns) {
+		saveSurfacesPreGUI();
+		if (_currentRoom != 0 && _charset->_textScreenID == kMainVirtScreen && !(_game.version == 4 && _game.id == GID_LOOM))
+			restoreCharsetBg();
+	}
+
+	_shakeTempSavedState = _shakeEnabled;
+	setShake(0);
+
+	PauseToken pt = pauseEngine();
+
+	if (_game.version == 4) {
+		normalFillColor = 7;
+		normalTextColor = 0;
+		topLineColor = 15;
+		bottomLineColor = 8;
+		leftLineColor = 15;
+		rightLineColor = 8;
+	} else if (_game.id == GID_MONKEY && _game.platform == Common::kPlatformSegaCD) {
+		normalFillColor = getBannerColor(4);
+		normalTextColor = getBannerColor(2);
+		topLineColor = getBannerColor(13);
+		bottomLineColor = getBannerColor(14);
+		leftLineColor = getBannerColor(15);
+		rightLineColor = getBannerColor(16);
+	} else {
+		int palOffset = (_game.version == 8) ? 0 : 11;
+		normalFillColor = getBannerColor(6 * bannerId + 15 + palOffset);
+		normalTextColor = getBannerColor(6 * bannerId + 14 + palOffset);
+
+		if (_game.version == 5 && _game.platform == Common::kPlatformMacintosh) {
+			topLineColor = getBannerColor(6 * bannerId + 16 + palOffset);
+			bottomLineColor = getBannerColor(6 * bannerId + 18 + palOffset);
+			leftLineColor = getBannerColor(6 * bannerId + 17 + palOffset);
+			rightLineColor = getBannerColor(6 * bannerId + 19 + palOffset);
+		} else {
+			topLineColor = getBannerColor(6 * bannerId + 16 + palOffset);
+			bottomLineColor = getBannerColor(6 * bannerId + 17 + palOffset);
+			leftLineColor = getBannerColor(6 * bannerId + 18 + palOffset);
+			rightLineColor = getBannerColor(6 * bannerId + 19 + palOffset);
+		}
+	}
+
+	oldId = _charset->getCurID();
+	_charset->setCurID(1);
+
+	input.clear();
+	clearClickedStatus();
+
+	while (true) {
+		const Common::String bannerText = promptString + input;
+
+		if (!shownText.empty() && bannerText.size() < shownText.size())
+			clearBanner();
+
+		if (shownText != bannerText) {
+			int bannerMsgWidth, bannerMsgHeight, roundedWidth;
+			int startingPointX, startingPointY;
+			int xPos, yPos;
+			bool isCOMIDemo = (_game.id == GID_CMI && (_game.features & GF_DEMO) != 0);
+
+			if (_isIndy4Jap)
+				_force2ByteCharHeight = true;
+
+			bannerMsgHeight = ((_game.id == GID_DIG || isCOMIDemo) ? getGUIStringHeight("ABC \x80\x78 \xb0\x78") : getGUIStringHeight(bannerText.c_str())) + 5;
+
+			if (_isIndy4Jap)
+				_force2ByteCharHeight = false;
+
+			bannerMsgWidth = getGUIStringWidth(bannerText.c_str());
+
+			if (_isIndy4Jap)
+				bannerMsgWidth += 32;
+
+			if (bannerMsgWidth < 100)
+				bannerMsgWidth = 100;
+
+			roundedWidth = (((bannerMsgWidth + 15) & 0xFFF0) + 8) / 2;
+			if (_game.version < 7)
+				roundedWidth = bannerMsgWidth / 2;
+
+			if (_game.version == 8) {
+				startingPointX = _screenWidth / 2 - roundedWidth - 4;
+				startingPointY = _screenHeight / 2 - 10;
+				xPos = _screenWidth / 2 + roundedWidth + 3;
+				yPos = 1 - bannerMsgHeight;
+				_bannerSaveYStart = startingPointY;
+			} else if (_isIndy4Jap) {
+				startingPointX = 156 - bannerMsgWidth / 2;
+				startingPointY = 80;
+				xPos = bannerMsgWidth / 2 + 164;
+				yPos = -18;
+				_bannerSaveYStart = startingPointY - 2;
+			} else if (_game.id == GID_MONKEY && _game.platform == Common::kPlatformFMTowns) {
+				bannerMsgWidth = getGUIStringWidth(bannerText.c_str()) / 2;
+				startingPointX = ((160 - bannerMsgWidth) - 8) & 0xFFF8;
+				startingPointY = (bannerMsgWidth + 168) | 0x7;
+				xPos = startingPointX + 1;
+				yPos = startingPointY + 1;
+				_bannerSaveYStart = 78;
+			} else {
+				startingPointX = 156 - roundedWidth;
+				startingPointY = ((_game.version < 7) ? 80 : _screenHeight / 2 - 10);
+				xPos = roundedWidth + 163 + ((_game.version < 7) ? 1 : 0);
+				yPos = 1 - bannerMsgHeight;
+				_bannerSaveYStart = startingPointY - ((_game.version < 7) ? 2 : 0);
+			}
+
+			if (!_bannerMem) {
+				int rowSize = _screenWidth + 8;
+				_bannerMemSize = bannerMsgHeight * (_screenWidth + 8);
+				_bannerMem = (byte *)malloc(_bannerMemSize * sizeof(byte));
+				if (_bannerMem) {
+#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
+					if (_game.platform == Common::kPlatformFMTowns && !_textSurfBannerMem) {
+						rowSize *= _textSurfaceMultiplier;
+						_bannerSaveYStart *= _textSurfaceMultiplier;
+						_textSurfBannerMemSize = bannerMsgHeight * rowSize * _textSurfaceMultiplier;
+						_textSurfBannerMem = (byte *)malloc(_textSurfBannerMemSize * sizeof(byte));
+						if (_textSurfBannerMem) {
+							memcpy(
+								_textSurfBannerMem,
+								&((byte *)_textSurface.getBasePtr(0, _screenTop * _textSurfaceMultiplier))[rowSize * _bannerSaveYStart],
+								_textSurfBannerMemSize);
+						}
+
+						rowSize /= _textSurfaceMultiplier;
+						_bannerSaveYStart /= _textSurfaceMultiplier;
+					}
+#endif
+					memcpy(
+						_bannerMem,
+						&_virtscr[kMainVirtScreen].getPixels(0, _screenTop)[rowSize * _bannerSaveYStart],
+						_bannerMemSize);
+				}
+			}
+
+			if (_game.id == GID_MONKEY && _game.platform == Common::kPlatformFMTowns) {
+				drawBox(startingPointX + 1, 81, startingPointY - 1, 90, normalFillColor);
+				drawLine(startingPointX + 1, 80, startingPointY - 1, 80, topLineColor);
+				drawLine(startingPointX + 1, 91, startingPointY - 1, 91, bottomLineColor);
+				drawLine(startingPointX, 81, startingPointX, 90, leftLineColor);
+				drawLine(startingPointY, 81, startingPointY, 90, rightLineColor);
+
+				int tmpRight = _string[5].right;
+				_string[5].right = _screenWidth - 1;
+				drawGUIText(bannerText.c_str(), nullptr, 160, 82, normalTextColor, true);
+				_string[5].right = tmpRight;
+			} else {
+				setUpInternalGUIControl(0, normalFillColor, normalTextColor,
+					topLineColor, bottomLineColor, leftLineColor, rightLineColor, 0, 0,
+					startingPointX, startingPointY, xPos, yPos, bannerText.c_str(), true, true);
+				drawInternalGUIControl(0, 0);
+			}
+
+			ScummEngine::drawDirtyScreenParts();
+			_system->updateScreen();
+		}
+
+		shownText = bannerText;
+
+		Common::KeyState ks = Common::KEYCODE_INVALID;
+		bool leftBtnPressed = false;
+		bool rightBtnPressed = false;
+		waitForBannerInput(-1, ks, leftBtnPressed, rightBtnPressed);
+		clearClickedStatus();
+
+		if (ks.keycode == Common::KEYCODE_ESCAPE || rightBtnPressed) {
+			clearBanner();
+			if (_game.version < 7 && !_mainMenuIsActive && _game.platform != Common::kPlatformFMTowns)
+				restoreSurfacesPostGUI();
+			pt.clear();
+			clearClickedStatus();
+			if (oldId)
+				_charset->setCurID(oldId);
+			_internalGUIControls[0].relativeCenterX = -1;
+			_messageBannerActive = false;
+			if (isSmushActive())
+				_screenTop = oldScreenTop;
+			return false;
+		}
+
+		if (ks.keycode == Common::KEYCODE_RETURN || leftBtnPressed) {
+			clearBanner();
+			if (_game.version < 7 && !_mainMenuIsActive && _game.platform != Common::kPlatformFMTowns)
+				restoreSurfacesPostGUI();
+			pt.clear();
+			clearClickedStatus();
+			if (oldId)
+				_charset->setCurID(oldId);
+			_internalGUIControls[0].relativeCenterX = -1;
+			_messageBannerActive = false;
+			if (isSmushActive())
+				_screenTop = oldScreenTop;
+			return !input.empty();
+		}
+
+		if (ks.keycode == Common::KEYCODE_BACKSPACE || ks.keycode == Common::KEYCODE_DELETE) {
+			if (!input.empty())
+				input.deleteLastChar();
+			continue;
+		}
+
+		if (ks.ascii >= 32 && ks.ascii < 127 && input.size() < maxLength)
+			input += (char)ks.ascii;
+	}
+}
+
 Common::KeyState ScummEngine::printMessageAndPause(const char *msg, int color, int32 waitTime, bool drawOnSentenceLine) {
 	Common::Rect sentenceline;
 	int pixelYOffset = (_game.platform == Common::kPlatformC64) ? 1 : 0;
diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp
index 3c9fe79e4e3..ecef09cf406 100644
--- a/engines/scumm/input.cpp
+++ b/engines/scumm/input.cpp
@@ -969,6 +969,32 @@ void ScummEngine::processKeyboard(Common::KeyState lastKeyHit) {
 	bool isNES = _game.platform == Common::kPlatformNES;
 	bool inSaveRoom = false;
 	bool canToggleSmoothing = _macScreen && _game.version > 3 && _game.heversion == 0;
+	const bool canOpenPlaybackPrompt =
+		_game.platform == Common::kPlatformDOS &&
+		(_game.id == GID_MONKEY || _game.id == GID_MONKEY2 || _game.id == GID_INDY4);
+
+	if (canOpenPlaybackPrompt && lastKeyHit.keycode == Common::KEYCODE_F10 && lastKeyHit.hasFlags(Common::KBD_SHIFT)) {
+		if (_playback._active) {
+			const Common::String playbackName = _playback._name;
+			_playback.reset();
+			clearClickedStatus();
+			showBannerAndPause(1, -1, "Done with record/playback of '%s'", playbackName.c_str());
+			return;
+		}
+
+		Common::String playbackFile;
+
+		if (showBannerAndPauseForTextInput(1, "Enter playback file name: ", playbackFile, 63)) {
+			_playback.reset();
+			if (_playback.tryLoadPlayback(this, Common::Path(playbackFile, Common::Path::kNoSeparator))) {
+				_playback.startPlayback(this);
+			} else {
+				clearClickedStatus();
+				showBannerAndPause(1, -1, "Can't open playback file '%s'", playbackFile.c_str());
+			}
+		}
+		return;
+	}
 
 	// The following check is used by v3 games which have writable savegame names
 	// and also support some key combinations which in our case are mapped to SHIFT-<letter>
diff --git a/engines/scumm/playback.cpp b/engines/scumm/playback.cpp
index 625be4e6793..998436abc94 100644
--- a/engines/scumm/playback.cpp
+++ b/engines/scumm/playback.cpp
@@ -26,6 +26,30 @@
 
 namespace Scumm {
 
+void ScummEngine::Playback::reset() {
+	_loaded = false;
+	_attempted = false;
+	_active = false;
+	_mi2DemoVarsApplied = false;
+	_events.clear();
+	_streamOff = 0;
+	_streamBytes = 0;
+	_nextIndex = 0;
+	_lastRoom = -1;
+	_hasPrevMbs = false;
+	_prevMbs = 0;
+	_firstInteractIndex = 0;
+	_firstInteractValid = false;
+	_curX = 0;
+	_curY = 0;
+	_pendingLUp = false;
+	_pendingRUp = false;
+	_sputmCmdActive = false;
+	_sputmCmdEnterCount = 0;
+	_sputmCmdBuf.clear();
+	_name.clear();
+}
+
 void ScummEngine::Playback::parseStream(const Common::Array<byte> &stream, Common::Array<FrameEvent> &outEvents) {
 	outEvents.clear();
 
@@ -81,7 +105,7 @@ bool ScummEngine::applyMi2NiDemoOverride() {
 }
 
 
-bool ScummEngine::Playback::tryLoadPlayback(ScummEngine *engine) {
+bool ScummEngine::Playback::tryLoadPlayback(ScummEngine *engine, const Common::Path &path) {
 	if (_loaded || _attempted)
 		return _loaded;
 
@@ -91,11 +115,13 @@ bool ScummEngine::Playback::tryLoadPlayback(ScummEngine *engine) {
 		return false;
 
 	Common::File f;
-	if (!f.open(Common::Path("demo.rec"))) {
-		warning("Playback: couldn't find demo.rec");
+	if (!f.open(path)) {
+		warning("Playback: couldn't open %s", path.toString(Common::Path::kNativeSeparator).c_str());
 		return false;
 	}
 
+	_name = path.toString(Common::Path::kNativeSeparator);
+
 	const uint32 fileSize = (uint32)f.size();
 	Common::Array<byte> buf;
 	buf.resize(fileSize);
@@ -171,6 +197,24 @@ bool ScummEngine::Playback::tryLoadPlayback(ScummEngine *engine) {
 	return _loaded;
 }
 
+bool ScummEngine::Playback::startPlayback(ScummEngine *engine) {
+	if (!engine || !_loaded || _events.empty())
+		return false;
+
+	_active = true;
+	_nextIndex = 0;
+	_hasPrevMbs = false;
+	_prevMbs = 0;
+	_pendingLUp = false;
+	_pendingRUp = false;
+	_sputmCmdActive = false;
+	_sputmCmdEnterCount = 0;
+	_sputmCmdBuf.clear();
+	_curX = engine->_mouse.x;
+	_curY = engine->_mouse.y;
+	return true;
+}
+
 void ScummEngine::Playback::mi2DemoArmPlaybackByRoom(ScummEngine *engine) {
 	if (!engine)
 		return;
@@ -190,7 +234,8 @@ void ScummEngine::Playback::mi2DemoArmPlaybackByRoom(ScummEngine *engine) {
 	}
 
 	if (room == 4) {
-		_active = true;
+		if (!_active)
+			startPlayback(engine);
 
 		if (!_mi2DemoVarsApplied) {
 			engine->applyMi2NiDemoOverride();
@@ -379,22 +424,12 @@ void ScummEngine::Playback::playbackPump(ScummEngine *engine) {
 	}
 
 	if (fev.key != 0) {
-		if (!handleMi2NIDemoSputmDebugKey(engine, fev.key)) {
-			Common::Event kev;
-			kev.type = Common::EVENT_KEYDOWN;
-			kev.kbd.flags = 0;
-			kev.kbd.ascii = (uint16)fev.key;
-			kev.kbd.keycode = (Common::KeyCode)((fev.key == 27) ? Common::KEYCODE_ESCAPE : (int)Common::KEYCODE_INVALID);
-			engine->parseEvent(kev);
-
-			Common::Event kup;
-			kup.type = Common::EVENT_KEYUP;
-			kup.kbd = kev.kbd;
-			engine->parseEvent(kup);
-		}
+		if (!handleMi2NIDemoSputmDebugKey(engine, fev.key))
+			engine->_mouseAndKeyboardStat = fev.key;
 	}
 
-	engine->_mouseAndKeyboardStat = (engine->_mouseAndKeyboardStat & ~MBS_MOUSE_MASK) | (cur & MBS_MOUSE_MASK);
+	if (fev.key == 0)
+		engine->_mouseAndKeyboardStat = (engine->_mouseAndKeyboardStat & ~MBS_MOUSE_MASK) | (cur & MBS_MOUSE_MASK);
 
 	_prevMbs = cur;
 	_hasPrevMbs = true;
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 859d02de8a8..1b65e51cf16 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -3234,9 +3234,9 @@ void ScummEngine::scummLoop_updateScummVars() {
 	// MI2 NI DOS Demo, start playback if demo.rec was loaded succesfully.
 	if ((_game.id == GID_MONKEY2) && (_game.features & GF_DEMO) && (_game.platform == Common::kPlatformDOS) && !ConfMan.getBool("disable_mi2_ni_demo")) {
 		_playback.mi2DemoArmPlaybackByRoom(this);
-		if (_playback._active)
-			_playback.playbackPump(this);
 	}
+	if (_playback._active)
+		_playback.playbackPump(this);
 	if (_game.version == 7) {
 		VAR(VAR_CAMERA_POS_X) = camera._cur.x;
 		VAR(VAR_CAMERA_POS_Y) = camera._cur.y;
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index 77fb62bf74c..847fd147ca5 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -747,6 +747,7 @@ protected:
 
 	void initBanners();
 	Common::KeyState showBannerAndPause(int bannerId, int32 waitTime, const char *msg, ...);
+	bool showBannerAndPauseForTextInput(int bannerId, const char *prompt, Common::String &input, uint maxLength = 255);
 	Common::KeyState showOldStyleBannerAndPause(const char *msg, int color, int32 waitTime);
 	Common::KeyState printMessageAndPause(const char *msg, int color, int32 waitTime, bool drawOnSentenceLine);
 
@@ -875,8 +876,11 @@ public:
 		bool _sputmCmdActive = false;
 		byte _sputmCmdEnterCount = 0;
 		Common::String _sputmCmdBuf;
+		Common::String _name;
 		
-		bool tryLoadPlayback(ScummEngine *engine);
+		void reset();
+		bool tryLoadPlayback(ScummEngine *engine, const Common::Path &path = Common::Path("demo.rec"));
+		bool startPlayback(ScummEngine *engine);
 		void playbackPump(ScummEngine *engine);
 		
 		//MI2 DOS NI Demo specific playback helpers


Commit: 9ca4dcceb7f0245148c646ad69bf71cbf20d3c02
    https://github.com/scummvm/scummvm/commit/9ca4dcceb7f0245148c646ad69bf71cbf20d3c02
Author: Robert Megone (robert.megone at gmail.com)
Date: 2026-03-16T22:08:59+01:00

Commit Message:
SCUMM: Playback - Remove code duplication inside showBannerAndPauseForTextInput

Changed paths:
    engines/scumm/gfx_gui.cpp


diff --git a/engines/scumm/gfx_gui.cpp b/engines/scumm/gfx_gui.cpp
index e013bb9561c..133f6ec0ad6 100644
--- a/engines/scumm/gfx_gui.cpp
+++ b/engines/scumm/gfx_gui.cpp
@@ -333,213 +333,18 @@ Common::KeyState ScummEngine::showBannerAndPause(int bannerId, int32 waitTime, c
 
 bool ScummEngine::showBannerAndPauseForTextInput(int bannerId, const char *prompt, Common::String &input, uint maxLength) {
 	const Common::String promptString(prompt);
-	Common::String shownText;
-	int rightLineColor, leftLineColor, bottomLineColor, topLineColor;
-	int normalTextColor, normalFillColor;
-	int oldScreenTop = _screenTop;
-	int oldId;
-
-	_messageBannerActive = true;
-
-	if (isSmushActive())
-		_screenTop = 0;
-
-	if (_game.version < 7 && !_mainMenuIsActive && _game.platform != Common::kPlatformFMTowns) {
-		saveSurfacesPreGUI();
-		if (_currentRoom != 0 && _charset->_textScreenID == kMainVirtScreen && !(_game.version == 4 && _game.id == GID_LOOM))
-			restoreCharsetBg();
-	}
-
-	_shakeTempSavedState = _shakeEnabled;
-	setShake(0);
-
-	PauseToken pt = pauseEngine();
-
-	if (_game.version == 4) {
-		normalFillColor = 7;
-		normalTextColor = 0;
-		topLineColor = 15;
-		bottomLineColor = 8;
-		leftLineColor = 15;
-		rightLineColor = 8;
-	} else if (_game.id == GID_MONKEY && _game.platform == Common::kPlatformSegaCD) {
-		normalFillColor = getBannerColor(4);
-		normalTextColor = getBannerColor(2);
-		topLineColor = getBannerColor(13);
-		bottomLineColor = getBannerColor(14);
-		leftLineColor = getBannerColor(15);
-		rightLineColor = getBannerColor(16);
-	} else {
-		int palOffset = (_game.version == 8) ? 0 : 11;
-		normalFillColor = getBannerColor(6 * bannerId + 15 + palOffset);
-		normalTextColor = getBannerColor(6 * bannerId + 14 + palOffset);
-
-		if (_game.version == 5 && _game.platform == Common::kPlatformMacintosh) {
-			topLineColor = getBannerColor(6 * bannerId + 16 + palOffset);
-			bottomLineColor = getBannerColor(6 * bannerId + 18 + palOffset);
-			leftLineColor = getBannerColor(6 * bannerId + 17 + palOffset);
-			rightLineColor = getBannerColor(6 * bannerId + 19 + palOffset);
-		} else {
-			topLineColor = getBannerColor(6 * bannerId + 16 + palOffset);
-			bottomLineColor = getBannerColor(6 * bannerId + 17 + palOffset);
-			leftLineColor = getBannerColor(6 * bannerId + 18 + palOffset);
-			rightLineColor = getBannerColor(6 * bannerId + 19 + palOffset);
-		}
-	}
-
-	oldId = _charset->getCurID();
-	_charset->setCurID(1);
 
 	input.clear();
-	clearClickedStatus();
 
 	while (true) {
 		const Common::String bannerText = promptString + input;
+		Common::KeyState ks = showBannerAndPause(bannerId, -1, "%s", bannerText.c_str());
 
-		if (!shownText.empty() && bannerText.size() < shownText.size())
-			clearBanner();
-
-		if (shownText != bannerText) {
-			int bannerMsgWidth, bannerMsgHeight, roundedWidth;
-			int startingPointX, startingPointY;
-			int xPos, yPos;
-			bool isCOMIDemo = (_game.id == GID_CMI && (_game.features & GF_DEMO) != 0);
-
-			if (_isIndy4Jap)
-				_force2ByteCharHeight = true;
-
-			bannerMsgHeight = ((_game.id == GID_DIG || isCOMIDemo) ? getGUIStringHeight("ABC \x80\x78 \xb0\x78") : getGUIStringHeight(bannerText.c_str())) + 5;
-
-			if (_isIndy4Jap)
-				_force2ByteCharHeight = false;
-
-			bannerMsgWidth = getGUIStringWidth(bannerText.c_str());
-
-			if (_isIndy4Jap)
-				bannerMsgWidth += 32;
-
-			if (bannerMsgWidth < 100)
-				bannerMsgWidth = 100;
-
-			roundedWidth = (((bannerMsgWidth + 15) & 0xFFF0) + 8) / 2;
-			if (_game.version < 7)
-				roundedWidth = bannerMsgWidth / 2;
-
-			if (_game.version == 8) {
-				startingPointX = _screenWidth / 2 - roundedWidth - 4;
-				startingPointY = _screenHeight / 2 - 10;
-				xPos = _screenWidth / 2 + roundedWidth + 3;
-				yPos = 1 - bannerMsgHeight;
-				_bannerSaveYStart = startingPointY;
-			} else if (_isIndy4Jap) {
-				startingPointX = 156 - bannerMsgWidth / 2;
-				startingPointY = 80;
-				xPos = bannerMsgWidth / 2 + 164;
-				yPos = -18;
-				_bannerSaveYStart = startingPointY - 2;
-			} else if (_game.id == GID_MONKEY && _game.platform == Common::kPlatformFMTowns) {
-				bannerMsgWidth = getGUIStringWidth(bannerText.c_str()) / 2;
-				startingPointX = ((160 - bannerMsgWidth) - 8) & 0xFFF8;
-				startingPointY = (bannerMsgWidth + 168) | 0x7;
-				xPos = startingPointX + 1;
-				yPos = startingPointY + 1;
-				_bannerSaveYStart = 78;
-			} else {
-				startingPointX = 156 - roundedWidth;
-				startingPointY = ((_game.version < 7) ? 80 : _screenHeight / 2 - 10);
-				xPos = roundedWidth + 163 + ((_game.version < 7) ? 1 : 0);
-				yPos = 1 - bannerMsgHeight;
-				_bannerSaveYStart = startingPointY - ((_game.version < 7) ? 2 : 0);
-			}
-
-			if (!_bannerMem) {
-				int rowSize = _screenWidth + 8;
-				_bannerMemSize = bannerMsgHeight * (_screenWidth + 8);
-				_bannerMem = (byte *)malloc(_bannerMemSize * sizeof(byte));
-				if (_bannerMem) {
-#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
-					if (_game.platform == Common::kPlatformFMTowns && !_textSurfBannerMem) {
-						rowSize *= _textSurfaceMultiplier;
-						_bannerSaveYStart *= _textSurfaceMultiplier;
-						_textSurfBannerMemSize = bannerMsgHeight * rowSize * _textSurfaceMultiplier;
-						_textSurfBannerMem = (byte *)malloc(_textSurfBannerMemSize * sizeof(byte));
-						if (_textSurfBannerMem) {
-							memcpy(
-								_textSurfBannerMem,
-								&((byte *)_textSurface.getBasePtr(0, _screenTop * _textSurfaceMultiplier))[rowSize * _bannerSaveYStart],
-								_textSurfBannerMemSize);
-						}
-
-						rowSize /= _textSurfaceMultiplier;
-						_bannerSaveYStart /= _textSurfaceMultiplier;
-					}
-#endif
-					memcpy(
-						_bannerMem,
-						&_virtscr[kMainVirtScreen].getPixels(0, _screenTop)[rowSize * _bannerSaveYStart],
-						_bannerMemSize);
-				}
-			}
-
-			if (_game.id == GID_MONKEY && _game.platform == Common::kPlatformFMTowns) {
-				drawBox(startingPointX + 1, 81, startingPointY - 1, 90, normalFillColor);
-				drawLine(startingPointX + 1, 80, startingPointY - 1, 80, topLineColor);
-				drawLine(startingPointX + 1, 91, startingPointY - 1, 91, bottomLineColor);
-				drawLine(startingPointX, 81, startingPointX, 90, leftLineColor);
-				drawLine(startingPointY, 81, startingPointY, 90, rightLineColor);
-
-				int tmpRight = _string[5].right;
-				_string[5].right = _screenWidth - 1;
-				drawGUIText(bannerText.c_str(), nullptr, 160, 82, normalTextColor, true);
-				_string[5].right = tmpRight;
-			} else {
-				setUpInternalGUIControl(0, normalFillColor, normalTextColor,
-					topLineColor, bottomLineColor, leftLineColor, rightLineColor, 0, 0,
-					startingPointX, startingPointY, xPos, yPos, bannerText.c_str(), true, true);
-				drawInternalGUIControl(0, 0);
-			}
-
-			ScummEngine::drawDirtyScreenParts();
-			_system->updateScreen();
-		}
-
-		shownText = bannerText;
-
-		Common::KeyState ks = Common::KEYCODE_INVALID;
-		bool leftBtnPressed = false;
-		bool rightBtnPressed = false;
-		waitForBannerInput(-1, ks, leftBtnPressed, rightBtnPressed);
-		clearClickedStatus();
-
-		if (ks.keycode == Common::KEYCODE_ESCAPE || rightBtnPressed) {
-			clearBanner();
-			if (_game.version < 7 && !_mainMenuIsActive && _game.platform != Common::kPlatformFMTowns)
-				restoreSurfacesPostGUI();
-			pt.clear();
-			clearClickedStatus();
-			if (oldId)
-				_charset->setCurID(oldId);
-			_internalGUIControls[0].relativeCenterX = -1;
-			_messageBannerActive = false;
-			if (isSmushActive())
-				_screenTop = oldScreenTop;
+		if (ks.keycode == Common::KEYCODE_ESCAPE)
 			return false;
-		}
 
-		if (ks.keycode == Common::KEYCODE_RETURN || leftBtnPressed) {
-			clearBanner();
-			if (_game.version < 7 && !_mainMenuIsActive && _game.platform != Common::kPlatformFMTowns)
-				restoreSurfacesPostGUI();
-			pt.clear();
-			clearClickedStatus();
-			if (oldId)
-				_charset->setCurID(oldId);
-			_internalGUIControls[0].relativeCenterX = -1;
-			_messageBannerActive = false;
-			if (isSmushActive())
-				_screenTop = oldScreenTop;
+		if (ks.keycode == Common::KEYCODE_RETURN)
 			return !input.empty();
-		}
 
 		if (ks.keycode == Common::KEYCODE_BACKSPACE || ks.keycode == Common::KEYCODE_DELETE) {
 			if (!input.empty())




More information about the Scummvm-git-logs mailing list