[Scummvm-git-logs] scummvm master -> eb2e7ff5f555a9693dc28f901244a14ea5258bb5

mgerhardy martin.gerhardy at gmail.com
Wed Dec 30 22:33:12 UTC 2020


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:
eb2e7ff5f5 TWINE: fixed fading of last chars on a dialog page


Commit: eb2e7ff5f555a9693dc28f901244a14ea5258bb5
    https://github.com/scummvm/scummvm/commit/eb2e7ff5f555a9693dc28f901244a14ea5258bb5
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2020-12-30T23:32:51+01:00

Commit Message:
TWINE: fixed fading of last chars on a dialog page

see https://bugs.scummvm.org/ticket/11982

Changed paths:
    engines/twine/menu/menu.cpp
    engines/twine/scene/gamestate.cpp
    engines/twine/text.cpp
    engines/twine/text.h


diff --git a/engines/twine/menu/menu.cpp b/engines/twine/menu/menu.cpp
index 65acf73106..5e93a652a1 100644
--- a/engines/twine/menu/menu.cpp
+++ b/engines/twine/menu/menu.cpp
@@ -1192,6 +1192,8 @@ void Menu::processInventoryMenu() {
 
 		if (textState == ProgressiveTextState::ContinueRunning) {
 			textState = _engine->_text->updateProgressiveText();
+		} else {
+			_engine->_text->fadeInRemainingChars();
 		}
 
 		if (_engine->_input->toggleActionIfActive(TwinEActionType::UINextPage)) {
diff --git a/engines/twine/scene/gamestate.cpp b/engines/twine/scene/gamestate.cpp
index fbe4e2be46..9a91594ca7 100644
--- a/engines/twine/scene/gamestate.cpp
+++ b/engines/twine/scene/gamestate.cpp
@@ -364,6 +364,8 @@ void GameState::processFoundItem(int32 item) {
 		if (textState == ProgressiveTextState::ContinueRunning) {
 			_engine->_interface->resetClip();
 			textState = _engine->_text->updateProgressiveText();
+		} else {
+			_engine->_text->fadeInRemainingChars();
 		}
 
 		_engine->_redraw->flipRedrawAreas();
diff --git a/engines/twine/text.cpp b/engines/twine/text.cpp
index deb98b836d..3fbe375b62 100644
--- a/engines/twine/text.cpp
+++ b/engines/twine/text.cpp
@@ -520,6 +520,14 @@ int32 Text::getCharHeight(uint8 chr) const {
 	return stream.readByte();
 }
 
+void Text::fadeInRemainingChars() {
+	if (_fadeInCharactersPos <= 0) {
+		return;
+	}
+	fadeInCharacters(_fadeInCharactersPos, _dialTextStopColor);
+	--_fadeInCharactersPos;
+}
+
 ProgressiveTextState Text::updateProgressiveText() {
 	if (!_hasValidTextHandle) {
 		return ProgressiveTextState::End;
@@ -595,6 +603,8 @@ bool Text::displayText(int32 index, bool showText, bool playVox) {
 			_engine->readKeys();
 			if (textState == ProgressiveTextState::ContinueRunning) {
 				textState = updateProgressiveText();
+			} else {
+				fadeInRemainingChars();
 			}
 			if (_engine->_input->toggleActionIfActive(TwinEActionType::UINextPage)) {
 				if (textState == ProgressiveTextState::End) {
diff --git a/engines/twine/text.h b/engines/twine/text.h
index 2b12e51e9e..fd0a44e019 100644
--- a/engines/twine/text.h
+++ b/engines/twine/text.h
@@ -114,6 +114,7 @@ enum class ProgressiveTextState {
 };
 
 class TwinEEngine;
+
 class Text {
 private:
 	TwinEEngine *_engine;
@@ -276,6 +277,7 @@ public:
 	void initText(int32 index);
 	void initInventoryText(int index);
 	void initItemFoundText(int index);
+	void fadeInRemainingChars();
 	ProgressiveTextState updateProgressiveText();
 
 	/**




More information about the Scummvm-git-logs mailing list