[Scummvm-git-logs] scummvm master -> 16748885863a002c850d240371c1d09608b862d4

criezy noreply at scummvm.org
Wed Jun 4 21:51:53 UTC 2025


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

Summary:
2009bf5224 TEENAGENT: Add text-to-speech (TTS)
a100cbb0eb TEENAGENT: Add different voices for TTS
1674888586 TEENAGENT: Change TTS to English for Czech and Polish versions


Commit: 2009bf522449c35cb96d5ad796942f6d38b804b0
    https://github.com/scummvm/scummvm/commit/2009bf522449c35cb96d5ad796942f6d38b804b0
Author: ellm135 (ellm13531 at gmail.com)
Date: 2025-06-04T22:51:48+01:00

Commit Message:
TEENAGENT: Add text-to-speech (TTS)

Changed paths:
  A engines/teenagent/detection.h
    engines/teenagent/POTFILES
    engines/teenagent/detection.cpp
    engines/teenagent/inventory.cpp
    engines/teenagent/metaengine.cpp
    engines/teenagent/scene.cpp
    engines/teenagent/teenagent.cpp
    engines/teenagent/teenagent.h


diff --git a/engines/teenagent/POTFILES b/engines/teenagent/POTFILES
index 0c191e88321..06262d1a3de 100644
--- a/engines/teenagent/POTFILES
+++ b/engines/teenagent/POTFILES
@@ -1,2 +1,3 @@
 engines/teenagent/detection.cpp
 engines/teenagent/resources.cpp
+engines/teenagent/metaengine.cpp
diff --git a/engines/teenagent/detection.cpp b/engines/teenagent/detection.cpp
index 225fd5cf8b9..317588470cc 100644
--- a/engines/teenagent/detection.cpp
+++ b/engines/teenagent/detection.cpp
@@ -26,6 +26,7 @@
 
 #include "engines/advancedDetector.h"
 #include "teenagent/teenagent.h"
+#include "teenagent/detection.h"
 
 static const DebugChannelDef debugFlagList[] = {
 	{TeenAgent::kDebugActor, "Actor", "Enable Actor Debug"},
@@ -67,7 +68,7 @@ static const ADGameDescription teenAgentGameDescriptions[] = {
 		Common::EN_ANY,
 		Common::kPlatformDOS,
 		ADGF_NO_FLAGS,
-		GUIO2(GUIO_NOSPEECH, GUIO_NOMIDI)
+		GUIO3(GUIO_NOSPEECH, GUIO_NOMIDI, GAMEOPTION_TTS)
 	},
 	{
 		"teenagent",
@@ -88,7 +89,7 @@ static const ADGameDescription teenAgentGameDescriptions[] = {
 		Common::EN_ANY,
 		Common::kPlatformDOS,
 		ADGF_NO_FLAGS,
-		GUIO2(GUIO_NOSPEECH, GUIO_NOMIDI)
+		GUIO3(GUIO_NOSPEECH, GUIO_NOMIDI, GAMEOPTION_TTS)
 	},
 	{ // Russian fan translation
 		"teenagent",
@@ -110,7 +111,7 @@ static const ADGameDescription teenAgentGameDescriptions[] = {
 		Common::RU_RUS,
 		Common::kPlatformDOS,
 		ADGF_NO_FLAGS,
-		GUIO2(GUIO_NOSPEECH, GUIO_NOMIDI)
+		GUIO3(GUIO_NOSPEECH, GUIO_NOMIDI, GAMEOPTION_TTS)
 	},
 	{ // Czech Floppy
 		"teenagent",
@@ -131,7 +132,7 @@ static const ADGameDescription teenAgentGameDescriptions[] = {
 		Common::CS_CZE,
 		Common::kPlatformDOS,
 		ADGF_NO_FLAGS,
-		GUIO2(GUIO_NOSPEECH, GUIO_NOMIDI)
+		GUIO3(GUIO_NOSPEECH, GUIO_NOMIDI, GAMEOPTION_TTS)
 	},
 	{ // Polish CD
 		"teenagent",
@@ -173,7 +174,7 @@ static const ADGameDescription teenAgentGameDescriptions[] = {
 		Common::PL_POL,
 		Common::kPlatformDOS,
 		ADGF_NO_FLAGS,
-		GUIO1(GUIO_NOMIDI)
+		GUIO2(GUIO_NOMIDI, GAMEOPTION_TTS)
 	},
 	{ // Demo
 		"teenagent",
@@ -194,7 +195,7 @@ static const ADGameDescription teenAgentGameDescriptions[] = {
 		Common::EN_ANY,
 		Common::kPlatformDOS,
 		ADGF_DEMO,
-		GUIO2(GUIO_NOSPEECH, GUIO_NOMIDI)
+		GUIO3(GUIO_NOSPEECH, GUIO_NOMIDI, GAMEOPTION_TTS)
 	},
 	{ // Demo alt
 		"teenagent",
@@ -215,7 +216,7 @@ static const ADGameDescription teenAgentGameDescriptions[] = {
 		Common::EN_ANY,
 		Common::kPlatformDOS,
 		ADGF_DEMO,
-		GUIO2(GUIO_NOSPEECH, GUIO_NOMIDI)
+		GUIO3(GUIO_NOSPEECH, GUIO_NOMIDI, GAMEOPTION_TTS)
 	},
 
 	AD_TABLE_END_MARKER,
diff --git a/engines/teenagent/detection.h b/engines/teenagent/detection.h
new file mode 100644
index 00000000000..80704802544
--- /dev/null
+++ b/engines/teenagent/detection.h
@@ -0,0 +1,27 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef TEENAGENT_DETECTION_H
+#define TEENAGENT_DETECTION_H
+
+#define GAMEOPTION_TTS      	    GUIO_GAMEOPTIONS1
+
+#endif // TEENAGENT_DETECTION_H
diff --git a/engines/teenagent/inventory.cpp b/engines/teenagent/inventory.cpp
index aedde1ccfbb..be6c82ca617 100644
--- a/engines/teenagent/inventory.cpp
+++ b/engines/teenagent/inventory.cpp
@@ -339,6 +339,10 @@ void Inventory::Item::render(Inventory *inventory, uint itemId, Graphics::Surfac
 	if (_hovered && inventory->_vm->scene->getMessage().empty()) {
 		int w = inventory->_vm->res->font7.render(NULL, 0, 0, name, textColorMark, true);
 		inventory->_vm->res->font7.render(dst, (kScreenWidth - w) / 2, 180, name, textColorMark, true);
+
+		inventory->_vm->sayText(name);
+	} else if (!inventory->_hoveredObj && inventory->_vm->scene->getMessage().empty()) {
+		inventory->_vm->_previousSaid.clear();
 	}
 }
 
diff --git a/engines/teenagent/metaengine.cpp b/engines/teenagent/metaengine.cpp
index 4581e5ed555..9f90bbe33d6 100644
--- a/engines/teenagent/metaengine.cpp
+++ b/engines/teenagent/metaengine.cpp
@@ -22,18 +22,40 @@
 #include "common/system.h"
 #include "common/savefile.h"
 #include "common/algorithm.h"
+#include "common/translation.h"
 
 #include "base/plugins.h"
 
 #include "engines/advancedDetector.h"
 #include "teenagent/resources.h"
 #include "teenagent/teenagent.h"
+#include "teenagent/detection.h"
 #include "graphics/thumbnail.h"
 
 enum {
 	MAX_SAVES = 20
 };
 
+#ifdef USE_TTS
+
+static const ADExtraGuiOptionsMap optionsList[] = {
+	{
+		GAMEOPTION_TTS,
+		{
+			_s("Enable Text to Speech"),
+			_s("Use TTS to read text in the game (if TTS is available)"),
+			"tts_enabled",
+			false,
+			0,
+			0
+		}
+	},
+
+	AD_EXTRA_GUI_OPTIONS_TERMINATOR
+};
+
+#endif
+
 class TeenAgentMetaEngine : public AdvancedMetaEngine<ADGameDescription> {
 public:
 	const char *getName() const override {
@@ -53,6 +75,12 @@ public:
 		}
 	}
 
+#ifdef USE_TTS
+	const ADExtraGuiOptionsMap *getAdvancedExtraGuiOptions() const override {
+		return optionsList;
+	}
+#endif
+
 	Common::Error createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const override {
 		*engine = new TeenAgent::TeenAgentEngine(syst, desc);
 		return Common::kNoError;
diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp
index 08d8ba171a2..8d9cb2c2ec2 100644
--- a/engines/teenagent/scene.cpp
+++ b/engines/teenagent/scene.cpp
@@ -484,6 +484,7 @@ bool Scene::processEvent(const Common::Event &event) {
 	case Common::EVENT_LBUTTONDOWN:
 	case Common::EVENT_RBUTTONDOWN:
 		if (!message.empty() && messageFirstFrame == 0) {
+			_vm->stopTextToSpeech();
 			clearMessage();
 			nextEvent();
 			return true;
@@ -505,10 +506,12 @@ bool Scene::processEvent(const Common::Event &event) {
 					customAnimation[i].free();
 				_vm->playMusic(4);
 				_vm->loadScene(10, Common::Point(136, 153));
+				_vm->stopTextToSpeech();
 				return true;
 			}
 
 			if (!message.empty() && messageFirstFrame == 0) {
+				_vm->stopTextToSpeech();
 				clearMessage();
 				nextEvent();
 				return true;
@@ -616,6 +619,8 @@ bool Scene::render(bool tickGame, bool tickMark, uint32 messageDelta) {
 			_vm->res->font7.render(surface, currentEvent.dst.x, currentEvent.dst.y -= gameDelta, currentEvent.message, currentEvent.color);
 			_vm->_system->unlockScreen();
 
+			_vm->sayText(currentEvent.message);
+
 			if (currentEvent.dst.y < -(int)currentEvent.timer)
 				currentEvent.clear();
 			}
@@ -643,6 +648,11 @@ bool Scene::render(bool tickGame, bool tickMark, uint32 messageDelta) {
 				_vm->res->font7.render(surface, currentEvent.dst.x, currentEvent.dst.y, message, textColorCredits);
 			}
 			_vm->_system->unlockScreen();
+
+			Common::String ttsMessage = message;
+			ttsMessage.replace(';', '-');
+			_vm->sayText(ttsMessage);
+
 			return true;
 		}
 
@@ -828,6 +838,17 @@ bool Scene::render(bool tickGame, bool tickMark, uint32 messageDelta) {
 			if (visible) {
 				_vm->res->font7.render(surface, messagePos.x, messagePos.y, message, _messageColor);
 				busy = true;
+
+				Common::String ttsMessage = message;
+				if (!_vm->inventory->active()) {
+					ttsMessage.replace('\n', ' ');
+				} else {
+					// Keep a newline character after the item name, so the TTS has an appropriate pause
+					int endOfItemName = ttsMessage.find('\n');
+					ttsMessage.replace('\n', ' ');
+					ttsMessage.replace(endOfItemName, 1, "\n");
+				}
+				_vm->sayText(ttsMessage);
 			}
 		}
 
diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp
index 847b86cdbbe..e4f2b49a1c2 100644
--- a/engines/teenagent/teenagent.cpp
+++ b/engines/teenagent/teenagent.cpp
@@ -26,6 +26,7 @@
 #include "common/savefile.h"
 #include "common/system.h"
 #include "common/textconsole.h"
+#include "common/text-to-speech.h"
 
 #include "backends/audiocd/audiocd.h"
 
@@ -545,6 +546,12 @@ Common::Error TeenAgentEngine::run() {
 
 	syncSoundSettings();
 
+	Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager();
+	if (ttsMan != nullptr) {
+		ttsMan->setLanguage(ConfMan.get("language"));
+		ttsMan->enable(ConfMan.getBool("tts_enabled"));
+	}
+
 	// Initialize CD audio
 	if (_gameDescription->flags & ADGF_CD)
 		g_system->getAudioCDManager()->open();
@@ -673,6 +680,8 @@ Common::Error TeenAgentEngine::run() {
 				if (currentObject)
 					name += currentObject->name;
 
+				sayText(name);
+
 				uint w = res->font7.render(NULL, 0, 0, name, textColorMark);
 				res->font7.render(surface, (kScreenWidth - w) / 2, 180, name, textColorMark, true);
 #if 0
@@ -681,6 +690,8 @@ Common::Error TeenAgentEngine::run() {
 					currentObject->actorRect.render(surface, 0x81);
 				}
 #endif
+			} else {
+				_previousSaid.clear();
 			}
 		}
 
@@ -1063,4 +1074,21 @@ bool TeenAgentEngine::hasFeature(EngineFeature f) const {
 	}
 }
 
+void TeenAgentEngine::sayText(const Common::String &text) {
+	Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager();
+	// _previousSaid is used to prevent the TTS from looping when sayText calls are inside loops
+	if (ttsMan && ConfMan.getBool("tts_enabled") && _previousSaid != text) {
+		_previousSaid = text;
+		ttsMan->say(text);
+	}
+}
+
+void TeenAgentEngine::stopTextToSpeech() {
+	Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager();
+	if (ttsMan && ConfMan.getBool("tts_enabled") && ttsMan->isSpeaking()) {
+		ttsMan->stop();
+		_previousSaid.clear();
+	}
+}
+
 } // End of namespace TeenAgent
diff --git a/engines/teenagent/teenagent.h b/engines/teenagent/teenagent.h
index 2a29fec86c7..39ea28a84ca 100644
--- a/engines/teenagent/teenagent.h
+++ b/engines/teenagent/teenagent.h
@@ -160,6 +160,10 @@ public:
 
 	void setMusic(byte id);
 
+	void sayText(const Common::String &text);
+	void stopTextToSpeech();
+	Common::String _previousSaid;
+	
 private:
 	void processObject();
 	bool trySelectedObject();


Commit: a100cbb0ebd76064084f4dc9f70631ba659099e3
    https://github.com/scummvm/scummvm/commit/a100cbb0ebd76064084f4dc9f70631ba659099e3
Author: ellm135 (ellm13531 at gmail.com)
Date: 2025-06-04T22:51:48+01:00

Commit Message:
TEENAGENT: Add different voices for TTS

Changed paths:
    engines/teenagent/callbacks.cpp
    engines/teenagent/dialog.cpp
    engines/teenagent/dialog.h
    engines/teenagent/scene.cpp
    engines/teenagent/scene.h
    engines/teenagent/teenagent.cpp
    engines/teenagent/teenagent.h


diff --git a/engines/teenagent/callbacks.cpp b/engines/teenagent/callbacks.cpp
index d01792a8ccc..e3bb1370d07 100644
--- a/engines/teenagent/callbacks.cpp
+++ b/engines/teenagent/callbacks.cpp
@@ -46,7 +46,7 @@ void TeenAgentEngine::fnIntro() {
 	playAnimation(913, 1);
 	setOns(1, 109);
 	setLan(2, 1);
-	dialog->show(192, scene, 914, 915, textColorGoldDriver, textColorBankGuard, 2, 1);
+	dialog->show(192, scene, 914, 915, kGoldDriver, kBankGuard, 2, 1);
 	displayCredits(dsAddr_introCredits1);
 
 	loadScene(42, 139, 156, 3);
@@ -64,12 +64,12 @@ void TeenAgentEngine::fnIntro() {
 
 	loadScene(40, 139, 156, 3);
 	playMusic(3);
-	dialog->show(193, scene, 920, 924, textColorRGBBoss, textColorFortuneTeller, 1, 2);
+	dialog->show(193, scene, 920, 924, kRGBBoss, kFortuneTeller, 1, 2);
 	playSound(26, 50);
 	playAnimation(925, 0, true);
 	playAnimation(926, 1, true);
 	waitAnimation();
-	dialog->show(194, scene, 927, 920, textColorFortuneTeller, textColorRGBBoss, 2, 1);
+	dialog->show(194, scene, 927, 920, kFortuneTeller, kRGBBoss, 2, 1);
 	displayCredits(dsAddr_introCredits3);
 
 	loadScene(39, 139, 156, 3);
@@ -84,7 +84,7 @@ void TeenAgentEngine::fnIntro() {
 	playSound(81, 21);
 	playAnimation(928, 1);
 	setOns(0, 112);
-	dialog->showMono(195, scene, 929, textColorMark, 1);
+	dialog->showMono(195, scene, 929, kMark, 1);
 	showActor();
 	moveTo(319, 150, 1, true);
 	moveTo(63, 150, 1);
@@ -100,17 +100,17 @@ void TeenAgentEngine::fnIntro() {
 	playMusic(3);
 	loadScene(40, 50, 186, 1);
 	setOns(0, 113);
-	dialog->show(196, scene, 919, 0, textColorRGBBoss, textColorMark, 1, 0);
+	dialog->show(196, scene, 919, 0, kRGBBoss, kMark, 1, 0);
 	moveTo(196, 186, 1);
-	dialog->show(197, scene, 0, 920, textColorMark, textColorRGBBoss, 0, 1);
+	dialog->show(197, scene, 0, 920, kMark, kRGBBoss, 0, 1);
 	playActorAnimation(932);
-	dialog->show(198, scene, 0, 920, textColorMark, textColorRGBBoss, 0, 1);
+	dialog->show(198, scene, 0, 920, kMark, kRGBBoss, 0, 1);
 	playActorAnimation(932);
-	dialog->show(199, scene, 0, 920, textColorMark, textColorRGBBoss, 0, 1);
+	dialog->show(199, scene, 0, 920, kMark, kRGBBoss, 0, 1);
 	playActorAnimation(932);
-	dialog->show(200, scene, 0, 922, textColorMark, textColorRGBBoss, 0, 1);
+	dialog->show(200, scene, 0, 922, kMark, kRGBBoss, 0, 1);
 	playActorAnimation(933);
-	dialog->show(201, scene, 0, 920, textColorMark, textColorRGBBoss, 0, 1);
+	dialog->show(201, scene, 0, 920, kMark, kRGBBoss, 0, 1);
 	moveTo(174, 186, 1);
 	playAnimation(851, 0, true);
 	playActorAnimation(934, true);
@@ -160,7 +160,7 @@ void TeenAgentEngine::fnGuardDrinking() {
 	playSound(17, 5);
 	playAnimation(545, 0);
 
-	dialog->show(5, scene, 0, 546, textColorMark, textColorMansionGuard, 0, 1);
+	dialog->show(5, scene, 0, 546, kMark, kMansionGuard, 0, 1);
 	SET_FLAG(dsAddr_spokenWithMansionGuardFlag, 1);
 	SET_FLAG(dsAddr_haveNotSpokenWithMansionGuardFlag, 0);
 }
@@ -353,7 +353,7 @@ void TeenAgentEngine::fnSecondMansionIntrusion() {
 	playAnimation(986, 0, true);
 	playAnimation(987, 1, true);
 	waitAnimation();
-	dialog->show(178, scene, 988, 989, textColorMansionGuard, textColorJohnNoty, 1, 2);
+	dialog->show(178, scene, 988, 989, kMansionGuard, kJohnNoty, 1, 2);
 	playAnimation(990, 0, true);
 	playAnimation(991, 1, true);
 	waitAnimation();
@@ -366,12 +366,12 @@ void TeenAgentEngine::fnThirdMansionIntrusion() {
 	playAnimation(887, 1);
 	playAnimation(888, 2, true, true, true);
 	//waitAnimation();
-	dialog->showMono(179, scene, 889, textColorMansionGuard, 2);
+	dialog->showMono(179, scene, 889, kMansionGuard, 2);
 	playSound(26, 3);
 	playAnimation(891, 1, true, true, true);
 	playAnimation(892, 2);
 	waitAnimation();
-	dialog->show(180, scene, 890, 889, textColorJohnNoty, textColorMansionGuard, 3, 2);
+	dialog->show(180, scene, 890, 889, kJohnNoty, kMansionGuard, 3, 2);
 	showActor();
 }
 
@@ -381,11 +381,11 @@ void TeenAgentEngine::fnFourthMansionIntrusion() {
 	playAnimation(894, 1, true, true, true);
 	playAnimation(893, 2, true);
 	waitAnimation();
-	dialog->showMono(181, scene, 895, textColorMansionGuard, 3);
+	dialog->showMono(181, scene, 895, kMansionGuard, 3);
 	playSound(75, 9);
 	playAnimation(898, 1, true);
 	playAnimation(897, 2, true);
-	dialog->show(182, scene, 896, 895, textColorJohnNoty, textColorMansionGuard, 2, 3);
+	dialog->show(182, scene, 896, 895, kJohnNoty, kMansionGuard, 2, 3);
 	showActor();
 }
 
@@ -395,13 +395,13 @@ void TeenAgentEngine::fnFifthMansionIntrusion() {
 	playActorAnimation(901, true);
 	playAnimation(900, 1, true);
 	waitAnimation();
-	dialog->show(183, scene, 903, 902, textColorJohnNoty, textColorMansionGuard, 2, 3);
+	dialog->show(183, scene, 903, 902, kJohnNoty, kMansionGuard, 2, 3);
 	for (byte i = 3; i <= 9; i += 2)
 		playSound(56, i);
 
 	playActorAnimation(905, true);
 	playAnimation(904, 1, true);
-	dialog->show(184, scene, 903, 902, textColorJohnNoty, textColorMansionGuard, 2, 3);
+	dialog->show(184, scene, 903, 902, kJohnNoty, kMansionGuard, 2, 3);
 	showActor();
 }
 
@@ -411,8 +411,8 @@ void TeenAgentEngine::fnSixthMansionIntrusion() {
 	playAnimation(907, 2, true);
 	playAnimation(906, 3, true);
 	waitAnimation();
-	dialog->show(185, scene, 908, 909, textColorMansionGuard, textColorJohnNoty, 2, 3);
-	dialog->show(186, scene, 910, 908, textColorJohnNoty, textColorMansionGuard, 3, 2);
+	dialog->show(185, scene, 908, 909, kMansionGuard, kJohnNoty, 2, 3);
+	dialog->show(186, scene, 910, 908, kJohnNoty, kMansionGuard, 3, 2);
 	loadScene(11, scene->getPosition());
 	showActor();
 	setOns(3, 51);
@@ -448,38 +448,38 @@ void TeenAgentEngine::fnEgoSuspiciousPosition() {
 
 void TeenAgentEngine::fnGivingFlowerToOldLady() {
 	playSound(5, 2);
-	dialog->show(37, scene, 0, 523, textColorMark, textColorOldLady, 0, 1);
+	dialog->show(37, scene, 0, 523, kMark, kOldLady, 0, 1);
 	playActorAnimation(537, true);
 	playAnimation(538, 0, true);
 	waitAnimation();
 	wait(100);
-	dialog->show(38, scene, 0, 523, textColorMark, textColorOldLady, 0, 1);
+	dialog->show(38, scene, 0, 523, kMark, kOldLady, 0, 1);
 }
 
 void TeenAgentEngine::fnGiveAnotherFlowerToOldLady() {
-		dialog->pop(scene, dsAddr_dialogStackOldLady, 0, 523, textColorMark, textColorOldLady, 0, 1);
+		dialog->pop(scene, dsAddr_dialogStackOldLady, 0, 523, kMark, kOldLady, 0, 1);
 }
 
 void TeenAgentEngine::fnGivingFlowerToAnne() {
-	dialog->show(53, scene, 0, 524, textColorMark, textColorAnne, 0, 2);
+	dialog->show(53, scene, 0, 524, kMark, kAnne, 0, 2);
 	playSound(5, 10);
 	playActorAnimation(540, true);
 	playAnimation(539, 1, true);
 	waitAnimation();
 	wait(100);
-	dialog->show(54, scene, 0, 524, textColorMark, textColorAnne, 0, 2);
+	dialog->show(54, scene, 0, 524, kMark, kAnne, 0, 2);
 	wait(50);
-	dialog->show(55, scene, 0, 524, textColorMark, textColorAnne, 0, 2);
-	dialog->show(56, scene, 0, 524, textColorMark, textColorAnne, 0, 2);
+	dialog->show(55, scene, 0, 524, kMark, kAnne, 0, 2);
+	dialog->show(56, scene, 0, 524, kMark, kAnne, 0, 2);
 	wait(50);
 	moveRel(0, 1, 0);
-	dialog->show(57, scene, 0, 524, textColorMark, textColorAnne, 0, 2);
+	dialog->show(57, scene, 0, 524, kMark, kAnne, 0, 2);
 	moveRel(0, -1, 0);
 	wait(50);
 }
 
 void TeenAgentEngine::fnGiveAnotherFlowerToAnne() {
-	dialog->pop(scene, dsAddr_dialogStackAnotherFlowerToAnne, 0, 524, textColorMark, textColorAnne, 0, 2);
+	dialog->pop(scene, dsAddr_dialogStackAnotherFlowerToAnne, 0, 524, kMark, kAnne, 0, 2);
 }
 
 void TeenAgentEngine::rejectMessage() {
@@ -655,11 +655,11 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 		playActorAnimation(842);
 		wait(100);
 		// shown in different positions
-		displayMessage(dsAddr_fnMsg2, textColorMark, 16, 68); // "And how am I supposed to get back?"
+		displayMessage(dsAddr_fnMsg2, kMark, 16, 68); // "And how am I supposed to get back?"
 		wait(50);
-		displayMessage(dsAddr_fnMsg3, textColorMark, 92, 68); // "Great"
+		displayMessage(dsAddr_fnMsg3, kMark, 92, 68); // "Great"
 		wait(50);
-		displayMessage(dsAddr_fnMsg4, textColorMark, 62, 68); // "Oh, yeah, right"
+		displayMessage(dsAddr_fnMsg4, kMark, 62, 68); // "Oh, yeah, right"
 		wait(50);
 		playActorAnimation(843);
 		showActor();
@@ -703,15 +703,15 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 			playAnimation(812, 0, true);
 			playActorAnimation(811);
 
-			dialog->show(148, scene, 0, 813, textColorMark, textColorCaptain, 0, 1);
+			dialog->show(148, scene, 0, 813, kMark, kCaptain, 0, 1);
 			loadScene(6, 230, 184);
 			playMusic(5);
-			dialog->show(149, scene, 0, 814, textColorMark, textColorCaptain, 0, 1);
+			dialog->show(149, scene, 0, 814, kMark, kCaptain, 0, 1);
 			playSound(4, 14);
 			playAnimation(815, 0);
 			setOns(1, 0);
 
-			dialog->showMono(150, scene, 0, textColorMark, 0);
+			dialog->showMono(150, scene, 0, kMark, 0);
 
 			SET_FLAG(dsAddr_FirstActTrialState, 1);
 		}
@@ -779,7 +779,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 			SET_FLAG(dsAddr_JailCableAndBowlState, 3);
 			scene->getObject(4)->setName("body");
 		} else {
-			if (dialog->pop(scene, dsAddr_dialogStackJailDoorGrates, 0, 0, textColorMark, textColorMark, 0, 0) == 0x636b) { // 'im getting hungry'
+			if (dialog->pop(scene, dsAddr_dialogStackJailDoorGrates, 0, 0, kMark, kMark, 0, 0) == 0x636b) { // 'im getting hungry'
 				wait(100);
 				playSound(52, 8);
 				playSound(52, 13);
@@ -944,8 +944,8 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 		if (CHECK_FLAG(dsAddr_birdOnBarRadioAntennaFlag, 1)) {
 			moveTo(140, 152, 1);
 			if (CHECK_FLAG(dsAddr_swappedBarmanMugFlag, 1)) {
-				dialog->showMono(177, scene, 0, textColorMark, 0);
-				displayMessage(dsAddr_yeahRightMsg, textColorBarman, 32, 67); // "Yeah right!"
+				dialog->showMono(177, scene, 0, kMark, 0);
+				displayMessage(dsAddr_yeahRightMsg, kBarman, 32, 67); // "Yeah right!"
 				//reloadLan();
 				setLan(1, 0);
 				playAnimation(882, 0);
@@ -963,21 +963,21 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 		} else {
 			if (CHECK_FLAG(dsAddr_FirstActTrialState, 3)) {
 				if (CHECK_FLAG(dsAddr_spokeToBarmanAboutThirdTrialFlag, 1)) {
-					dialog->show(168, scene, 0, 857, textColorMark, textColorBarman, 0, 1);
+					dialog->show(168, scene, 0, 857, kMark, kBarman, 0, 1);
 				} else {
-					dialog->show(166, scene, 0, 857, textColorMark, textColorBarman, 0, 1); // taking mug
+					dialog->show(166, scene, 0, 857, kMark, kBarman, 0, 1); // taking mug
 					playActorAnimation(859, true);
 					playAnimation(858, 0, true);
 					waitAnimation();
 					playSound(75, 6);
 					playActorAnimation(860);
-					dialog->show(167, scene, 0, 857, textColorMark, textColorBarman, 0, 1);
+					dialog->show(167, scene, 0, 857, kMark, kBarman, 0, 1);
 					inventory->add(kInvItemMug);
 					SET_FLAG(dsAddr_spokeToBarmanAboutThirdTrialFlag, 1);
 					SET_FLAG(dsAddr_gotPasswordNeedSpeakBarmanFlag, 0);
 				}
 			} else {
-				dialog->pop(scene, dsAddr_dialogStackBarman, 0, 857, textColorMark, textColorBarman, 0, 1);
+				dialog->pop(scene, dsAddr_dialogStackBarman, 0, 857, kMark, kBarman, 0, 1);
 			}
 		}
 		break;
@@ -1068,7 +1068,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 		} else if (CHECK_FLAG(dsAddr_birdOnBarRadioAntennaFlag, 1)) {
 			displayMessage(dsAddr_barmanTooCloseMsg); // "The barman is too close"
 		} else {
-			dialog->pop(scene, dsAddr_dialogStackBarCellarDoor, 0, 857, textColorMark, textColorBarman, 0, 1);
+			dialog->pop(scene, dsAddr_dialogStackBarCellarDoor, 0, 857, kMark, kBarman, 0, 1);
 		}
 		break;
 
@@ -1103,17 +1103,17 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 		playSound(55, 1);
 		playSound(24, 12);
 		playAnimation(885, 0);
-		dialog->show(164, scene, 886, 0, textColorJohnNoty, textColorMark, 1, 0);
+		dialog->show(164, scene, 886, 0, kJohnNoty, kMark, 1, 0);
 		playMusic(3);
 		loadScene(40, 198, 186, 1);
-		dialog->show(202, scene, 0, 920, textColorMark, textColorRGBBoss, 0, 1);
+		dialog->show(202, scene, 0, 920, kMark, kRGBBoss, 0, 1);
 		inventory->clear();
 		inventory->add(kInvItemSuperGlue);
 		displayCredits(dsAddr_credits5);
 		loadScene(1, 198, 186);
 		hideActor();
 		playActorAnimation(956);
-		dialog->showMono(212, scene, 957, textColorMark, 1);
+		dialog->showMono(212, scene, 957, kMark, 1);
 		waitAnimation();
 		loadScene(15, 157, 199, 1);
 		playMusic(6);
@@ -1132,9 +1132,9 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 	case 0x4c70:
 		if (CHECK_FLAG(dsAddr_act1GuardState, 0)) {
 			if (CHECK_FLAG(dsAddr_ShownPassToGuardFlag, 1)) { // papers are shown
-				dialog->pop(scene, dsAddr_dialogStackCampGuardReadingNews, 0, 809, textColorMark, textColorCampGuard, 0, 1);
+				dialog->pop(scene, dsAddr_dialogStackCampGuardReadingNews, 0, 809, kMark, kCampGuard, 0, 1);
 			} else {
-				dialog->pop(scene, dsAddr_dialogStackCampGuardWantsDocuments, 0, 809, textColorMark, textColorCampGuard, 0, 1);
+				dialog->pop(scene, dsAddr_dialogStackCampGuardWantsDocuments, 0, 809, kMark, kCampGuard, 0, 1);
 			}
 		} else {
 			displayMessage(dsAddr_helloQMsg); // "Hello?"
@@ -1156,15 +1156,15 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 		if (CHECK_FLAG(dsAddr_ShownPassToGuardFlag, 1)) { // papers are shown
 			loadScene(5, 124, 199);
 		} else {
-			dialog->show(144, scene, 0, 809, textColorMark, textColorCampGuard, 0, 1);
+			dialog->show(144, scene, 0, 809, kMark, kCampGuard, 0, 1);
 			moveTo(269, 175, 4);
-			dialog->pop(scene, dsAddr_dialogStackCampGuardShowPass, 0, 809, textColorMark, textColorCampGuard, 0, 1);
+			dialog->pop(scene, dsAddr_dialogStackCampGuardShowPass, 0, 809, kMark, kCampGuard, 0, 1);
 		}
 		break;
 
 	case 0x4cf1: // talking with mansion guard
 		SET_FLAG(dsAddr_spokenWithMansionGuardFlag, 1);
-		if (dialog->pop(scene, dsAddr_dialogStackPleadingToMansionGuard, 0, 529, textColorMark, textColorMansionGuard, 0, 1) == 0x01b4) { // 2nd try
+		if (dialog->pop(scene, dsAddr_dialogStackPleadingToMansionGuard, 0, 529, kMark, kMansionGuard, 0, 1) == 0x01b4) { // 2nd try
 			Common::Point p = scene->getPosition();
 			moveTo(189, 159, 0);
 			//waitLanAnimationFrame(1, 1);
@@ -1177,18 +1177,18 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 
 			moveTo(p, 2);
 			inventory->add(kInvItemChocCandy);
-			dialog->pop(scene, dsAddr_dialogStackPleadingToMansionGuard, 0, 529, textColorMark, textColorMansionGuard, 0, 1);
+			dialog->pop(scene, dsAddr_dialogStackPleadingToMansionGuard, 0, 529, kMark, kMansionGuard, 0, 1);
 		}
 		break;
 
 	case 0x4d94: // talking with fatso
-		dialog->show(87, scene, 0, 666, textColorMark, textColorJohnNoty, 0, 2);
-		displayAsyncMessage(dsAddr_BribeMsg, 120, 109, 1, 10, textColorJohnNoty); // FIXME: Original (x,y) was (100, 78), rather than (120, 109)?
+		dialog->show(87, scene, 0, 666, kMark, kJohnNoty, 0, 2);
+		displayAsyncMessage(dsAddr_BribeMsg, 120, 109, 1, 10, kJohnNoty); // FIXME: Original (x,y) was (100, 78), rather than (120, 109)?
 		playSound(5, 3);
 		playAnimation(667, 1);
 		playAnimation(668, 1);
 		setOns(2, 50);
-		dialog->show(88, scene, 0, 666, textColorMark, textColorJohnNoty, 0, 2);
+		dialog->show(88, scene, 0, 666, kMark, kJohnNoty, 0, 2);
 		setOns(3, 0);
 		setFlag(dsAddr_johnNotyOutsideMansionDoorFlag, 0);
 		reloadLan();
@@ -1638,7 +1638,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 	case 0x5d88:
 		if (CHECK_FLAG(dsAddr_laundryState, 1)) { // dry laundry
 			SET_FLAG(dsAddr_laundryState, 2);
-			dialog->show(46, scene, 0, 523, textColorMark, textColorOldLady, 0, 1);
+			dialog->show(46, scene, 0, 523, kMark, kOldLady, 0, 1);
 			//waitLanAnimationFrame(1, 1); // another long waiting
 			playAnimation(604, 0);
 
@@ -1651,9 +1651,9 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 			setOns(0, 33);
 			loadScene(23, scene->getPosition());
 			playAnimation(605, 0);
-			dialog->show(47, scene, 0, 523, textColorMark, textColorOldLady, 0, 1);
+			dialog->show(47, scene, 0, 523, kMark, kOldLady, 0, 1);
 		} else {
-			uint16 d = dialog->pop(scene, dsAddr_dialogStackAskOldLadyOK, 0, 523, textColorMark, textColorOldLady, 0, 1);
+			uint16 d = dialog->pop(scene, dsAddr_dialogStackAskOldLadyOK, 0, 523, kMark, kOldLady, 0, 1);
 			if (d == 0x1913) { // 3rd time
 				wait(100);
 				moveRel(0, 0, 3);
@@ -1687,9 +1687,9 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 
 	case 0x5ff3: // get duster
 		if (CHECK_FLAG(dsAddr_givenFlowerToOldLadyAlreadyFlag, 0)) {
-			dialog->pop(scene, dsAddr_dialogStackBorrowDusterFromOldLady, 0, 523, textColorMark, textColorOldLady, 0, 1);
+			dialog->pop(scene, dsAddr_dialogStackBorrowDusterFromOldLady, 0, 523, kMark, kOldLady, 0, 1);
 		} else {
-			dialog->show(43, scene, 0, 523, textColorMark, textColorOldLady, 0, 1);
+			dialog->show(43, scene, 0, 523, kMark, kOldLady, 0, 1);
 			wait(50);
 			inventory->add(kInvItemFeatherDusterClean);
 			disableObject(12);
@@ -1776,7 +1776,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 		break;
 
 	case 0x63dc:
-		dialog->showMono(86, scene, 0, textColorMark, 0);
+		dialog->showMono(86, scene, 0, kMark, 0);
 		break;
 
 	case 0x63e3:
@@ -1785,11 +1785,11 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 
 	case 0x646e:
 	case 0x6475:
-		dialog->showMono(85, scene, 0, textColorMark, 0);
+		dialog->showMono(85, scene, 0, kMark, 0);
 		break;
 
 	case 0x6479:
-		dialog->showMono(84, scene, 0, textColorMark, 0);
+		dialog->showMono(84, scene, 0, kMark, 0);
 		break;
 
 	case 0x6507:
@@ -2028,7 +2028,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 	case 0x792b: // left click on ann
 		moveTo(245, 198, 1);
 		if (!CHECK_FLAG(dsAddr_alreadySaidAnneBeautifulFlag, 1)) {
-			dialog->showMono(50, scene, 0, textColorMark, 0);
+			dialog->showMono(50, scene, 0, kMark, 0);
 			SET_FLAG(dsAddr_alreadySaidAnneBeautifulFlag, 1);
 		} else
 			retVal = false;
@@ -2155,12 +2155,12 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 			wait(200);
 			playAnimation(0, 1);
 			setOns(0, 0);
-			dialog->showMono(156, scene, 830, textColorShockedCaptain, 1);
+			dialog->showMono(156, scene, 830, kShockedCaptain, 1);
 			loadScene(7, 130, 195, 2);
 			playMusic(4);
 			setLan(1, 1);
 			wait(100);
-			dialog->show(157, scene, 0, 832, textColorMark, textColorCaptain, 0, 1);
+			dialog->show(157, scene, 0, 832, kMark, kCaptain, 0, 1);
 
 			//playAnimation(831, 1);
 
@@ -2180,14 +2180,14 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 			waitAnimation();
 
 			setOns(0, 94);
-			dialog->show(161, scene, 0, 832, textColorMark, textColorCaptain, 0, 1);
+			dialog->show(161, scene, 0, 832, kMark, kCaptain, 0, 1);
 			enableObject(12);
 			SET_FLAG(dsAddr_AlreadyTickledCaptainFlag, 1);
 		}
 		break;
 
 	case 0x7e4f: // giving magazine to captain
-		dialog->show(162, scene, 0, 856, textColorMark, textColorCaptain, 0, 1);
+		dialog->show(162, scene, 0, 856, kMark, kCaptain, 0, 1);
 		playSound(5, 3);
 		playActorAnimation(852, true);
 		playActorAnimation(853, true);
@@ -2199,7 +2199,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 		playAnimation(856, 1);
 		playSound(5, 3);
 		//playActorAnimation(854);
-		dialog->show(163, scene, 0, 856, textColorMark, textColorCaptain, 0, 1);
+		dialog->show(163, scene, 0, 856, kMark, kCaptain, 0, 1);
 		playAnimation(855, 1);
 		wait(200);
 		moveTo(30, 181, 0);
@@ -2219,7 +2219,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 		playAnimation(877, 1);
 		playAnimation(880, 1, true);
 
-		dialog->show(176, scene, 0, 857, textColorMark, textColorBarman, 0, 1);
+		dialog->show(176, scene, 0, 857, kMark, kBarman, 0, 1);
 		setOns(2, 0x6a);
 		reloadLan();
 		playAnimation(878, 0);
@@ -2248,13 +2248,13 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 			playSound(5, 2);
 			playSound(5, 18);
 			playActorAnimation(810);
-			dialog->show(147, scene, 0, 809, textColorMark, textColorCampGuard, 0, 1);
+			dialog->show(147, scene, 0, 809, kMark, kCampGuard, 0, 1);
 			SET_FLAG(dsAddr_ShownPassToGuardFlag, 1);
 		}
 		break;
 
 	case 0x80c3: // show kaleidoscope to the guard
-		dialog->show(165, scene, 0, 809, textColorMark, textColorCampGuard, 0, 1);
+		dialog->show(165, scene, 0, 809, kMark, kCampGuard, 0, 1);
 		playSound(5, 3);
 		playSound(5, 30);
 		playSound(26, 14);
@@ -2303,7 +2303,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 			SET_FLAG(dsAddr_alreadyGotBrokenPaddleFlag, 1);
 			playSound(57, 6);
 			playActorAnimation(536);
-			dialog->showMono(77, scene, 0, textColorMark, 0);
+			dialog->showMono(77, scene, 0, kMark, 0);
 			inventory->add(kInvItemBrokenPaddle);
 		}
 		break;
@@ -2313,15 +2313,15 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 			displayMessage(dsAddr_stillThereMsg); // "Are you still there?"
 		} else {
 			displayMessage(dsAddr_echoMsg); // "Echo!"
-			displayMessage(dsAddr_loudEchoMsg, textColorWellEcho, 248, 164); // "ECHO!"
+			displayMessage(dsAddr_loudEchoMsg, kWellEcho, 248, 164); // "ECHO!"
 			displayMessage(dsAddr_whoThereMsg); // "Who's there?!"
-			displayMessage(dsAddr_loudWhoThereMsg, textColorWellEcho, 225, 164); // "WHO'S THERE?!"
+			displayMessage(dsAddr_loudWhoThereMsg, kWellEcho, 225, 164); // "WHO'S THERE?!"
 			displayMessage(dsAddr_dontCopyMsg); // "DON'T COPY ME!"
-			displayMessage(dsAddr_loudDontCopyMsg, textColorWellEcho, 172, 164); // "DON'T COPY ME!!!"
+			displayMessage(dsAddr_loudDontCopyMsg, kWellEcho, 172, 164); // "DON'T COPY ME!!!"
 			displayMessage(dsAddr_throwRockMsg); // "OR I WILL THROW A ROCK DOWN THERE!"
-			displayMessage(dsAddr_orIWillMsg, textColorWellEcho, 232, 164); // "OR I WILL"
+			displayMessage(dsAddr_orIWillMsg, kWellEcho, 232, 164); // "OR I WILL"
 			wait(100);
-			displayMessage(dsAddr_loudEchoMsg, textColorWellEcho, 248, 164);
+			displayMessage(dsAddr_loudEchoMsg, kWellEcho, 248, 164);
 			SET_FLAG(dsAddr_spokenToManInWellFlag, 1);
 		}
 		break;
@@ -2430,7 +2430,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 		break;
 
 	case 0x58a2:
-		dialog->pop(scene, dsAddr_dialogStackSonny, 0, 502, textColorMark, textColorSonny, 0, 1);
+		dialog->pop(scene, dsAddr_dialogStackSonny, 0, 502, kMark, kSonny, 0, 1);
 		scene->getObject(13)->setName((const char *)res->dseg.ptr(dsAddr_scnObjNameSonny));
 		break;
 
@@ -2519,7 +2519,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 		break;
 
 	case 0x5be1: // Talk to grandpa
-		dialog->pop(scene, dsAddr_dialogStackGrandpa, 0, 522, textColorMark, textColorGrandpa, 0, 1);
+		dialog->pop(scene, dsAddr_dialogStackGrandpa, 0, 522, kMark, kGrandpa, 0, 1);
 		break;
 
 	case 0x5bee:
@@ -2534,7 +2534,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 			displayMessage(dsAddr_drawersEmptyMsg); // "There's nothing else in the drawers"
 		} else {
 			if (!CHECK_FLAG(dsAddr_alreadyAdjustedHoopPoleFlag, 1))
-				dialog->show(24, scene, 0, 522, textColorMark, textColorGrandpa, 0, 1);
+				dialog->show(24, scene, 0, 522, kMark, kGrandpa, 0, 1);
 
 			playSound(66, 5);
 			playSound(67, 20);
@@ -2553,7 +2553,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 			setOns(0, 0);
 			playActorAnimation(520);
 		} else {
-			dialog->pop(scene, dsAddr_dialogStackGrandpaShotgun, 0, 522, textColorMark, textColorGrandpa, 0, 1);
+			dialog->pop(scene, dsAddr_dialogStackGrandpaShotgun, 0, 522, kMark, kGrandpa, 0, 1);
 		}
 		break;
 
@@ -2571,7 +2571,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 			disableObject(13);
 			inventory->add(kInvItemFan);
 		} else {
-			dialog->pop(scene, dsAddr_dialogStackGrandpaFan, 0, 522, textColorMark, textColorGrandpa, 0, 1);
+			dialog->pop(scene, dsAddr_dialogStackGrandpaFan, 0, 522, kMark, kGrandpa, 0, 1);
 		}
 		break;
 
@@ -2580,7 +2580,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 			displayMessage(dsAddr_girlTalkMsg); // "I really don't know how to talk to girls"
 		} else {
 			moveTo(245, 198, 1);
-			dialog->show(51, scene, 0, 524, textColorMark, textColorAnne, 0, 2);
+			dialog->show(51, scene, 0, 524, kMark, kAnne, 0, 2);
 			//waitLanAnimationFrame(2, 1); // too long, about 200 frames! seems to be present in original game (sic)
 			SET_FLAG(dsAddr_alreadySpokenToAnneFlag, 1);
 			for (byte i = 10; i <= 20; i += 2)
@@ -2602,7 +2602,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 			playSound(55, 5);
 			playActorAnimation(527);
 			wait(50);
-			dialog->show(52, scene, 0, 524, textColorMark, textColorAnne, 0, 2);
+			dialog->show(52, scene, 0, 524, kMark, kAnne, 0, 2);
 			scene->getObject(2)->setName((const char *)res->dseg.ptr(dsAddr_scnObjNameAnne));
 		}
 		break;
@@ -2617,7 +2617,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 		if (CHECK_FLAG(dsAddr_nutSwappedForAppleFlag, 1)) {
 			displayMessage(dsAddr_noFruitMsg); // "There are no more interesting fruits here"
 		} else {
-			dialog->pop(scene, dsAddr_dialogStackGetAppleOldLady, 0, 523, textColorMark, textColorOldLady, 0, 1);
+			dialog->pop(scene, dsAddr_dialogStackGetAppleOldLady, 0, 523, kMark, kOldLady, 0, 1);
 		}
 		break;
 
@@ -2852,7 +2852,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 		break;
 
 	case 0x70bb:
-		dialog->pop(scene, dsAddr_dialogStackBusyCook, 0, 709, textColorMark, textColorCook, 0, 1);
+		dialog->pop(scene, dsAddr_dialogStackBusyCook, 0, 709, kMark, kCook, 0, 1);
 		break;
 
 	case 0x71ae:
@@ -2908,7 +2908,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 				playSound(89, 4);
 				playSound(89, 4);
 				playSound(87, 45);
-				displayAsyncMessage(dsAddr_oneTakenMsg, 112, 108, 11, 35, textColorEskimo); // "This one's taken, OK?"
+				displayAsyncMessage(dsAddr_oneTakenMsg, 112, 108, 11, 35, kEskimo); // "This one's taken, OK?"
 				playActorAnimation(718);
 				wait(100);
 				displayMessage(dsAddr_slightMadMsg); // "It finally happened. I'm slightly mad"
@@ -3017,10 +3017,10 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 				playActorAnimation(979);
 				loadScene(37, 51, 183);
 
-				dialog->show(125, scene, 768, 769, textColorMansionGuard, textColorProfessor, 1, 2);
+				dialog->show(125, scene, 768, 769, kMansionGuard, kProfessor, 1, 2);
 				playAnimation(770, 0, true, true, true);
 				playAnimation(771, 1, true, true, true);
-				dialog->showMono(126, scene, 0, textColorMark, 0);
+				dialog->showMono(126, scene, 0, kMark, 0);
 				playAnimation(770, 0, true, true, true);
 				playAnimation(771, 1, true, true, true);
 				playSound(5, 3);
@@ -3034,11 +3034,11 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 				waitAnimation();
 				setOns(0, 74);
 				hideActor();
-				dialog->showMono(127, scene, 775, textColorJohnNoty, 1);
+				dialog->showMono(127, scene, 775, kJohnNoty, 1);
 				playAnimation(771, 1, true, true, true);
 				playAnimation(776, 0);
 
-				dialog->show(128, scene, 777, 778, textColorJohnNoty, textColorProfessor, 1, 2);
+				dialog->show(128, scene, 777, 778, kJohnNoty, kProfessor, 1, 2);
 
 				playAnimation(779, 0, true, true, true);
 				playAnimation(780, 1, true, true, true);
@@ -3095,7 +3095,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 				setOns(0, 80);
 
 				playAnimation(792, 3, true, true, true);
-				dialog->show(129, scene, 0, 791, textColorMark, textColorJohnNoty, 0, 4);
+				dialog->show(129, scene, 0, 791, kMark, kJohnNoty, 0, 4);
 				playAnimation(792, 3, true, true, true);
 
 				moveTo(40, 171, 4);
@@ -3113,7 +3113,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 		break;
 
 	case 0x783d:
-		dialog->pop(scene, dsAddr_dialogStackJohnNotyEndgame, 0, 797, textColorMark, textColorJohnNoty, 0, 1);
+		dialog->pop(scene, dsAddr_dialogStackJohnNotyEndgame, 0, 797, kMark, kJohnNoty, 0, 1);
 		break;
 
 	case 0x7962:
@@ -3133,7 +3133,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 		if (CHECK_FLAG(dsAddr_vgaArtistQuipAlreadySaidFlag, 1))
 			retVal = false;
 		else {
-			dialog->showMono(90, scene, 0, textColorMark, 0);
+			dialog->showMono(90, scene, 0, kMark, 0);
 			SET_FLAG(dsAddr_vgaArtistQuipAlreadySaidFlag, 1);
 		}
 		break;
@@ -3255,18 +3255,18 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 		break;
 
 	case 0x8117:
-		dialog->show(9, scene, 0, 529, textColorMark, textColorMansionGuard, 0, 1);
+		dialog->show(9, scene, 0, 529, kMark, kMansionGuard, 0, 1);
 		playSound(5, 2);
 		playSound(5, 44);
 		playAnimation(642, 0, true);
 		playActorAnimation(641, true);
 		waitAnimation();
-		dialog->show(10, scene, 0, 529, textColorMark, textColorMansionGuard, 0, 1);
+		dialog->show(10, scene, 0, 529, kMark, kMansionGuard, 0, 1);
 		wait(170);
-		dialog->show(11, scene, 0, 529, textColorMark, textColorMansionGuard, 0, 1);
+		dialog->show(11, scene, 0, 529, kMark, kMansionGuard, 0, 1);
 		moveRel(0, 1, 0);
 		wait(100);
-		dialog->show(12, scene, 0, 529, textColorMark, textColorMansionGuard, 0, 1);
+		dialog->show(12, scene, 0, 529, kMark, kMansionGuard, 0, 1);
 		inventory->remove(kInvItemNugget);
 		fnMansionIntrusionAttempt();
 		break;
@@ -3313,12 +3313,12 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 		for (byte i = 3; i <= 18; i += 3)
 			playSound(56, i);
 
-		displayAsyncMessage(dsAddr_heyLetGoMsg, 38, 12, 20, 37, textColorMansionGuard); // "Hey, let go, will ya?!"
+		displayAsyncMessage(dsAddr_heyLetGoMsg, 38, 12, 20, 37, kMansionGuard); // "Hey, let go, will ya?!"
 		playActorAnimation(621, true);
 		playAnimation(623, 1, true);
 		waitAnimation();
 
-		displayAsyncMessage(dsAddr_aaahhhMsg, 30, 12, 1, 9, textColorMansionGuard); // "Aaaaaaaaaaaaahhh!"
+		displayAsyncMessage(dsAddr_aaahhhMsg, 30, 12, 1, 9, kMansionGuard); // "Aaaaaaaaaaaaahhh!"
 		playSound(35, 1);
 		playActorAnimation(622, true);
 		playAnimation(624, 0, true);
@@ -3464,7 +3464,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 			displayMessage(dsAddr_noNeedMsg); // "No need to do it again"
 		} else {
 			SET_FLAG(dsAddr_alreadyAdjustedHoopPoleFlag, 1);
-			dialog->show(17, scene, 0, 502, textColorMark, textColorSonny, 0, 1);
+			dialog->show(17, scene, 0, 502, kMark, kSonny, 0, 1);
 			waitLanAnimationFrame(1, 7);
 			playSound(5, 16);
 			playSound(1, 25);
@@ -3507,8 +3507,8 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 			disableObject(15);
 			disableObject(16);
 			moveTo(162, 164, 2);
-			displayMessage(dsAddr_grandpaPromiseMsg, textColorSonny, 70, 76); // "But grandpa, you promised!"
-			displayMessage(dsAddr_ohLetsGoMsg, textColorGrandpa, 90, 76); // "Oh all right. Let's go"
+			displayMessage(dsAddr_grandpaPromiseMsg, kSonny, 70, 76); // "But grandpa, you promised!"
+			displayMessage(dsAddr_ohLetsGoMsg, kGrandpa, 90, 76); // "Oh all right. Let's go"
 			moveTo(162, 191, 2);
 			setOns(1, 0);
 			setOns(2, 0);
@@ -3602,7 +3602,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 	case 0x89cc:
 		inventory->remove(kInvItemWrappedCandy);
 		playSound(5, 6);
-		dialog->show(60, scene, 0, 524, textColorMark, textColorAnne, 0, 2);
+		dialog->show(60, scene, 0, 524, kMark, kAnne, 0, 2);
 		// FIXME - Dialog #61 not explicitly called. Does Dialog #60 run on somehow?
 		playActorAnimation(555, true);
 		playAnimation(556, 1, true);
@@ -3610,7 +3610,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 		playActorAnimation(557, true);
 		playAnimation(558, 1, true);
 		waitAnimation();
-		dialog->show(62, scene, 0, 524, textColorMark, textColorAnne, 0, 2);
+		dialog->show(62, scene, 0, 524, kMark, kAnne, 0, 2);
 		inventory->add(kInvItemRibbon);
 		break;
 
@@ -3620,25 +3620,25 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 		inventory->remove(kInvItemNut);
 		inventory->add(kInvItemPlasticApple);
 		wait(50);
-		dialog->show(44, scene, 0, 523, textColorMark, textColorOldLady, 0, 1);
-		dialog->show(45, scene, 0, 523, textColorMark, textColorOldLady, 0, 1);
+		dialog->show(44, scene, 0, 523, kMark, kOldLady, 0, 1);
+		dialog->show(45, scene, 0, 523, kMark, kOldLady, 0, 1);
 		SET_FLAG(dsAddr_nutSwappedForAppleFlag, 1);
 		break;
 
 	case 0x8a6f: // banknote + ann
 		if (CHECK_FLAG(dsAddr_examinedBanknoteFlag, 1)) {
-			dialog->show(63, scene, 0, 524, textColorMark, textColorAnne, 0, 2);
+			dialog->show(63, scene, 0, 524, kMark, kAnne, 0, 2);
 			playSound(5, 3);
 			playSound(5, 20);
 			playAnimation(671, 1, true);
 			playActorAnimation(670, true);
 			waitAnimation();
 			//playAnimation(672, 1);
-			dialog->show(64, scene, 524, 672, textColorMark, textColorAnne, 0, 2);
+			dialog->show(64, scene, 524, 672, kMark, kAnne, 0, 2);
 			//playAnimation(672, 1);
 
 			playSound(83, 12);
-			displayAsyncMessage(dsAddr_hundredBucksMsg, 204, 114, 23, 38, textColorAnne); // "A hundred bucks!!!"
+			displayAsyncMessage(dsAddr_hundredBucksMsg, 204, 114, 23, 38, kAnne); // "A hundred bucks!!!"
 			playActorAnimation(673);
 			loadScene(11, scene->getPosition());
 			playSound(24, 31);
@@ -4109,7 +4109,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 
 	case 0x6c83:
 		waitLanAnimationFrame(1, 1);
-		dialog->pop(scene, dsAddr_dialogStackRobotSafe, 0, 727, textColorMark, textColorMike, 0, 1);
+		dialog->pop(scene, dsAddr_dialogStackRobotSafe, 0, 727, kMark, kMike, 0, 1);
 		scene->getObject(1)->setName((const char *)res->dseg.ptr(dsAddr_scnObjNameMike));
 		SET_FLAG(dsAddr_MansionRobotSafeUnlockedFlag, 1);
 		break;
@@ -4132,47 +4132,47 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 		loadScene(11, scene->getPosition());
 
 		playAnimation(750, 2);
-		dialog->show(117, scene, 751, 529, textColorProfessor, textColorMansionGuard, 2, 1);
+		dialog->show(117, scene, 751, 529, kProfessor, kMansionGuard, 2, 1);
 
 		playAnimation(752, 0, true);
 		playAnimation(753, 1, true);
 		waitAnimation();
-		dialog->show(118, scene, 529, 751, textColorMansionGuard, textColorProfessor, 1, 2);
+		dialog->show(118, scene, 529, 751, kMansionGuard, kProfessor, 1, 2);
 
 		loadScene(30, scene->getPosition());
-		dialog->show(108, scene, 733, 734, textColorProfessor, textColorJohnNoty, 2, 3);
+		dialog->show(108, scene, 733, 734, kProfessor, kJohnNoty, 2, 3);
 
 		playSound(75, 13);
 		playSound(32, 22);
 		playAnimation(735, 1, true);
 		playAnimation(736, 2, true);
 		waitAnimation();
-		dialog->show(109, scene, 737, 738, textColorJohnNoty, textColorProfessor, 3, 2);
+		dialog->show(109, scene, 737, 738, kJohnNoty, kProfessor, 3, 2);
 
 		playSound(32, 1);
 		playAnimation(739, 1, true);
 		playAnimation(740, 2, true);
 		waitAnimation();
-		dialog->show(110, scene, 733, 734, textColorProfessor, textColorJohnNoty, 2, 3);
+		dialog->show(110, scene, 733, 734, kProfessor, kJohnNoty, 2, 3);
 
 		playAnimation(742, 1, true);
 		playAnimation(741, 2, true);
 		waitAnimation();
-		dialog->show(111, scene, 743, 733, textColorJohnNoty, textColorProfessor, 3, 2);
+		dialog->show(111, scene, 743, 733, kJohnNoty, kProfessor, 3, 2);
 
 		playAnimation(744, 1, true);
 		playAnimation(745, 2, true);
 		waitAnimation();
-		dialog->show(112, scene, 734, 733, textColorJohnNoty, textColorProfessor, 3, 2);
+		dialog->show(112, scene, 734, 733, kJohnNoty, kProfessor, 3, 2);
 
 		playAnimation(746, 1, true);
 		playAnimation(747, 2, true);
 		waitAnimation();
 
-		dialog->show(113, scene, 734, 734, textColorJohnNoty, textColorJohnNoty, 3, 3);
-		dialog->show(114, scene, 748, 748, textColorJohnNoty, textColorJohnNoty, 3, 3);
-		dialog->show(115, scene, 749, 749, textColorJohnNoty, textColorJohnNoty, 3, 3);
-		dialog->show(116, scene, 748, 748, textColorJohnNoty, textColorJohnNoty, 3, 3);
+		dialog->show(113, scene, 734, 734, kJohnNoty, kJohnNoty, 3, 3);
+		dialog->show(114, scene, 748, 748, kJohnNoty, kJohnNoty, 3, 3);
+		dialog->show(115, scene, 749, 749, kJohnNoty, kJohnNoty, 3, 3);
+		dialog->show(116, scene, 748, 748, kJohnNoty, kJohnNoty, 3, 3);
 
 		playMusic(10);
 		loadScene(32, scene->getPosition());
@@ -4185,7 +4185,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 
 		hideActor();
 		loadScene(31, scene->getPosition());
-		dialog->show(123, scene, 763, 764, textColorMansionGuard, textColorJohnNoty, 1, 2);
+		dialog->show(123, scene, 763, 764, kMansionGuard, kJohnNoty, 1, 2);
 
 		loadScene(32, scene->getPosition());
 		showActor();
@@ -4208,7 +4208,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 		playActorAnimation(756);
 		hideActor();
 		playAnimation(758, 1);
-		dialog->show(121, scene, 759, 759, textColorJohnNoty, textColorJohnNoty, 2, 2);
+		dialog->show(121, scene, 759, 759, kJohnNoty, kJohnNoty, 2, 2);
 
 		playSound(40, 5);
 		playSound(52, 13);
@@ -4224,9 +4224,9 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 		playSound(58, 12);
 		playSound(58, 14);
 		playAnimation(765, 1);
-		dialog->show(124, scene, 766, 766, textColorMansionGuard, textColorMansionGuard, 1, 1);
+		dialog->show(124, scene, 766, 766, kMansionGuard, kMansionGuard, 1, 1);
 		loadScene(32, scene->getPosition());
-		dialog->show(122, scene, 761, 761, textColorJohnNoty, textColorJohnNoty, 2, 2);
+		dialog->show(122, scene, 761, 761, kJohnNoty, kJohnNoty, 2, 2);
 		playAnimation(762, 1);
 		setOns(2, 0);
 		showActor();
@@ -4428,11 +4428,11 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 
 					playSound(5, 3);
 					playSound(5, 39);
-					displayAsyncMessage(dsAddr_singingMsg, 68, 126, 9, 35, textColorJohnNoty); // "siiiiinging!"
+					displayAsyncMessage(dsAddr_singingMsg, 68, 126, 9, 35, kJohnNoty); // "siiiiinging!"
 					playActorAnimation(728);
 
 					waitLanAnimationFrame(1, 1);
-					dialog->show(98, scene, 0, 727, textColorMark, textColorMike, 0, 1);
+					dialog->show(98, scene, 0, 727, kMark, kMike, 0, 1);
 					SET_FLAG(dsAddr_MansionRobotSafeVoiceTestPassedFlag, 1);
 					fnRobotSafeUnlockCheck();
 				}
@@ -4453,7 +4453,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 				playActorAnimation(729);
 
 				waitLanAnimationFrame(1, 1);
-				dialog->show(99, scene, 0, 727, textColorMark, textColorMike, 0, 1);
+				dialog->show(99, scene, 0, 727, kMark, kMike, 0, 1);
 				SET_FLAG(dsAddr_MansionRobotSafeScentTestPassedFlag, 1);
 				fnRobotSafeUnlockCheck();
 			}
@@ -4473,7 +4473,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 				playActorAnimation(730);
 
 				waitLanAnimationFrame(1, 1);
-				dialog->show(100, scene, 0, 727, textColorMark, textColorMike, 0, 1);
+				dialog->show(100, scene, 0, 727, kMark, kMike, 0, 1);
 				SET_FLAG(dsAddr_MansionRobotSafeViewTestPassedFlag, 1);
 				fnRobotSafeUnlockCheck();
 			}
@@ -4490,7 +4490,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 		playSound(52, 10);
 		playActorAnimation(711);
 		moveRel(0, 0, 4);
-		dialog->show(95, scene, 0, 709, textColorMark, textColorCook, 0, 1);
+		dialog->show(95, scene, 0, 709, kMark, kCook, 0, 1);
 		moveTo(300, 190, 4);
 		inventory->remove(kInvItemFakeChilli);
 		disableObject(8);
@@ -4500,7 +4500,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 		playSound(15, 28);
 		playSound(16, 37);
 		playAnimation(713, 0);
-		dialog->show(96, scene, 0, 709, textColorMark, textColorCook, 0, 1);
+		dialog->show(96, scene, 0, 709, kMark, kCook, 0, 1);
 		playSound(85, 2);
 		playAnimation(714, 0);
 		setLan(1, 0);
@@ -4620,7 +4620,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 					SET_FLAG(dsAddr_mansionVCRPlayingTapeFlag, 1);
 					reloadLan();
 					if (!CHECK_FLAG(dsAddr_mansionVCRPlayedTapeBeforeFlag, 1)) {
-						dialog->show(93, scene, 0, 702, textColorMark, textColorJohnNoty, 0, 1);
+						dialog->show(93, scene, 0, 702, kMark, kJohnNoty, 0, 1);
 						SET_FLAG(dsAddr_mansionVCRPlayedTapeBeforeFlag, 1);
 					}
 				} else
@@ -4695,7 +4695,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 		playMusic(3);
 		loadScene(11, 105, 157, 4);
 
-		dialog->show(203, scene, 0, 938, textColorMark, textColorCaptain, 0, 1);
+		dialog->show(203, scene, 0, 938, kMark, kCaptain, 0, 1);
 
 		playAnimation(939, 0, true, true);
 		playActorAnimation(942, true);
@@ -4716,9 +4716,9 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 		playActorAnimation(945, true);
 		waitAnimation();
 
-		dialog->show(204, scene, 0, 938, textColorMark, textColorCaptain, 0, 1);
+		dialog->show(204, scene, 0, 938, kMark, kCaptain, 0, 1);
 		playAnimation(946, 0);
-		dialog->show(205, scene, 0, 938, textColorMark, textColorCaptain, 0, 1);
+		dialog->show(205, scene, 0, 938, kMark, kCaptain, 0, 1);
 
 		playSound(24, 7);
 		playAnimation(948, 0, true);
@@ -4726,16 +4726,16 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 		waitAnimation();
 
 		loadScene(40, 198, 186, 1);
-		dialog->show(206, scene, 0, 920, textColorMark, textColorRGBBoss, 0, 1);
-		dialog->show(207, scene, 0, 921, textColorMark, textColorRGBBoss, 0, 1);
+		dialog->show(206, scene, 0, 920, kMark, kRGBBoss, 0, 1);
+		dialog->show(207, scene, 0, 921, kMark, kRGBBoss, 0, 1);
 		playAnimation(923, 0);
-		dialog->show(208, scene, 0, 920, textColorMark, textColorRGBBoss, 0, 1);
+		dialog->show(208, scene, 0, 920, kMark, kRGBBoss, 0, 1);
 
 		moveTo(237, 186, 0);
 		moveTo(237, 177, 0);
 		moveTo(192, 177, 4);
 		playAnimation(949, 0);
-		dialog->showMono(209, scene, 950, textColorRGBBoss, 1);
+		dialog->showMono(209, scene, 950, kRGBBoss, 1);
 
 		playSound(32, 5);
 		playSound(40, 14);
@@ -4748,10 +4748,10 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
 		displayCredits();
 		loadScene(39, 192, 177, 0);
 		hideActor();
-		dialog->showMono(210, scene, 953, textColorMarkEnd, 1);
+		dialog->showMono(210, scene, 953, kMarkEnd, 1);
 		playSound(5, 15);
 		playAnimation(954, 0);
-		dialog->showMono(211, scene, 955, textColorMarkEnd, 1);
+		dialog->showMono(211, scene, 955, kMarkEnd, 1);
 		playMusic(2);
 		displayCredits(dsAddr_finalCredits6, 4500); // 3 minutes (infinite until key pressed in original)
 		scene->push(SceneEvent(SceneEvent::kQuit));
diff --git a/engines/teenagent/dialog.cpp b/engines/teenagent/dialog.cpp
index d23d5aabd3b..d6e53cf7e16 100644
--- a/engines/teenagent/dialog.cpp
+++ b/engines/teenagent/dialog.cpp
@@ -26,7 +26,7 @@
 
 namespace TeenAgent {
 
-void Dialog::show(uint16 dialogNum, Scene *scene, uint16 animation1, uint16 animation2, byte color1, byte color2, byte slot1, byte slot2) {
+void Dialog::show(uint16 dialogNum, Scene *scene, uint16 animation1, uint16 animation2, CharacterID character1ID, CharacterID character2ID, byte slot1, byte slot2) {
 	uint16 addr = _vm->res->getDialogAddr(dialogNum);
 	// WORKAROUND: For Dialog 163, The usage of this in the engine overlaps the previous dialog i.e. the
 	// starting offset used is two bytes early, thus implicitly changing the first command of this dialog
@@ -36,14 +36,16 @@ void Dialog::show(uint16 dialogNum, Scene *scene, uint16 animation1, uint16 anim
 	// Similar issue occurs with Dialog 0 which is used from dialogue stack at 0x0001, rather than start of 0x0000
 	if (dialogNum == 163)
 		addr -= 2;
-	show(scene, addr, animation1, animation2, color1, color2, slot1, slot2);
+	show(scene, addr, animation1, animation2, character1ID, character2ID, slot1, slot2);
 }
 
-void Dialog::show(Scene *scene, uint16 addr, uint16 animation1, uint16 animation2, byte color1, byte color2, byte slot1, byte slot2) {
+void Dialog::show(Scene *scene, uint16 addr, uint16 animation1, uint16 animation2, CharacterID character1ID, CharacterID character2ID, byte slot1, byte slot2) {
 	debugC(0, kDebugDialog, "Dialog::show(%04x, %u:%u, %u:%u)", addr, slot1, animation1, slot2, animation2);
 	int n = 0;
 	Common::String message;
-	byte color = color1;
+	byte color = characterDialogData[character1ID].textColor;
+	byte color1 = color;
+	byte color2 = characterDialogData[character2ID].textColor;
 
 	if (animation1 != 0) {
 		SceneEvent e1(SceneEvent::kPlayAnimation);
@@ -101,10 +103,14 @@ void Dialog::show(Scene *scene, uint16 addr, uint16 animation1, uint16 animation
 					SceneEvent em(SceneEvent::kMessage);
 					em.message = message;
 					em.color = color;
-					if (color == color1)
+					if (color == color1) {
 						em.slot = slot1;
-					if (color == color2)
+						em.characterID = character1ID;
+					}
+					if (color == color2) {
 						em.slot = slot2;
+						em.characterID = character2ID;
+					}
 					scene->push(em);
 					message.clear();
 				}
@@ -135,7 +141,7 @@ void Dialog::show(Scene *scene, uint16 addr, uint16 animation1, uint16 animation
 	scene->push(ec);
 }
 
-uint16 Dialog::pop(Scene *scene, uint16 addr, uint16 animation1, uint16 animation2, byte color1, byte color2, byte slot1, byte slot2) {
+uint16 Dialog::pop(Scene *scene, uint16 addr, uint16 animation1, uint16 animation2, CharacterID character1ID, CharacterID character2ID, byte slot1, byte slot2) {
 	debugC(0, kDebugDialog, "Dialog::pop(%04x, %u:%u, %u:%u)", addr, slot1, animation1, slot2, animation2);
 	uint16 next;
 	do {
@@ -145,7 +151,7 @@ uint16 Dialog::pop(Scene *scene, uint16 addr, uint16 animation1, uint16 animatio
 	uint16 next2 = _vm->res->dseg.get_word(addr);
 	if (next2 != 0xffff)
 		_vm->res->dseg.set_word(addr - 2, 0);
-	show(scene, next, animation1, animation2, color1, color2, slot1, slot2);
+	show(scene, next, animation1, animation2, character1ID, character2ID, slot1, slot2);
 	return next;
 }
 
diff --git a/engines/teenagent/dialog.h b/engines/teenagent/dialog.h
index 00c63999135..eef6f542cd3 100644
--- a/engines/teenagent/dialog.h
+++ b/engines/teenagent/dialog.h
@@ -53,6 +53,62 @@ enum {
 	textColorBarman = 0xef
 };
 
+enum CharacterID {
+	kMark = 0,
+	kGoldDriver = 1,
+	kBankGuard = 2,
+	kRGBBoss = 3,
+	kFortuneTeller = 4,
+	kCampGuard = 5,
+	kCaptain = 6,
+	kShockedCaptain = 7,
+	kBarman = 8,
+	kSonny = 9,
+	kGrandpa = 10,
+	kAnne = 11,
+	kWellEcho = 12,
+	kOldLady = 13,
+	kMansionGuard = 14,
+	kJohnNoty = 15,
+	kProfessor = 16,
+	kCook = 17,
+	kEskimo = 18,
+	kMike = 19,
+	kMarkEnd = 20,
+	kCreditsText = 21
+};
+
+struct CharacterDialogData {
+	int voiceID;
+	bool male;
+	byte textColor;
+};
+
+static const CharacterDialogData characterDialogData[] = {
+	{ 0, true, textColorMark },
+	{ 1, true, textColorGoldDriver },
+	{ 2, true, textColorBankGuard },
+	{ 3, true, textColorRGBBoss },
+	{ 0, false, textColorFortuneTeller },
+	{ 4, true, textColorCampGuard },
+	{ 5, true, textColorCaptain },
+	{ 5, true, textColorShockedCaptain },	// Same voice as captain
+	{ 6, true, textColorBarman },
+	{ 7, true, textColorSonny, },
+	{ 8, true, textColorGrandpa },
+	{ 1, false, textColorAnne },
+	{ 9, true, textColorWellEcho },
+	{ 2, false, textColorOldLady },
+	{ 10, true, textColorMansionGuard },
+	{ 11, true, textColorJohnNoty },
+	{ 12, true, textColorProfessor },
+	{ 13, true, textColorCook },
+	{ 14, true, textColorEskimo },
+	{ 15, true, textColorMike },
+	{ 0, true, textColorMarkEnd },	// Same voice as Mark
+	{ 0, true, textColorCredits }	// Same voice as Mark
+};
+
 class Scene;
 class TeenAgentEngine;
 
@@ -60,26 +116,26 @@ class Dialog {
 public:
 	Dialog(TeenAgentEngine *vm) : _vm(vm) { }
 
-	uint16 pop(Scene *scene, uint16 addr, uint16 animation1, uint16 animation2, byte color1, byte color2, byte slot1, byte slot2);
+	uint16 pop(Scene *scene, uint16 addr, uint16 animation1, uint16 animation2, CharacterID character1ID, CharacterID character2ID, byte slot1, byte slot2);
 
 	uint16 popMark(Scene *scene, uint16 addr) {
-		return pop(scene, addr, 0, 0, textColorMark, textColorMark, 0, 0);
+		return pop(scene, addr, 0, 0, kMark, kMark, 0, 0);
 	}
 
-	void show(uint16 dialogNum, Scene *scene, uint16 animation1, uint16 animation2, byte color1, byte color2, byte slot1, byte slot2);
+	void show(uint16 dialogNum, Scene *scene, uint16 animation1, uint16 animation2, CharacterID character1ID, CharacterID character2ID, byte slot1, byte slot2);
 
-	void showMono(uint16 dialogNum, Scene *scene, uint16 animation, byte color, byte slot) {
-		show(dialogNum, scene, animation, animation, color, color, slot, slot);
+	void showMono(uint16 dialogNum, Scene *scene, uint16 animation, CharacterID characterID, byte slot) {
+		show(dialogNum, scene, animation, animation, characterID, characterID, slot, slot);
 	}
 
 	void showMark(uint16 dialogNum, Scene *scene) {
-		show(dialogNum, scene, 0, 0, textColorMark, textColorMark, 0, 0);
+		show(dialogNum, scene, 0, 0, kMark, kMark, 0, 0);
 	}
 
 private:
 	TeenAgentEngine *_vm;
 
-	void show(Scene *scene, uint16 addr, uint16 animation1, uint16 animation2, byte color1, byte color2, byte slot1, byte slot2);
+	void show(Scene *scene, uint16 addr, uint16 animation1, uint16 animation2, CharacterID character1ID, CharacterID character2ID, byte slot1, byte slot2);
 };
 
 } // End of namespace TeenAgent
diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp
index 8d9cb2c2ec2..25bb4aa560d 100644
--- a/engines/teenagent/scene.cpp
+++ b/engines/teenagent/scene.cpp
@@ -507,6 +507,7 @@ bool Scene::processEvent(const Common::Event &event) {
 				_vm->playMusic(4);
 				_vm->loadScene(10, Common::Point(136, 153));
 				_vm->stopTextToSpeech();
+				_vm->setTTSVoice(kMark);
 				return true;
 			}
 
@@ -844,9 +845,11 @@ bool Scene::render(bool tickGame, bool tickMark, uint32 messageDelta) {
 					ttsMessage.replace('\n', ' ');
 				} else {
 					// Keep a newline character after the item name, so the TTS has an appropriate pause
-					int endOfItemName = ttsMessage.find('\n');
-					ttsMessage.replace('\n', ' ');
-					ttsMessage.replace(endOfItemName, 1, "\n");
+					uint32 endOfItemName = ttsMessage.find('\n');
+					if (endOfItemName != Common::String::npos) {
+						ttsMessage.replace('\n', ' ');
+						ttsMessage.replace(endOfItemName, 1, "\n");
+					}
 				}
 				_vm->sayText(ttsMessage);
 			}
@@ -992,6 +995,7 @@ bool Scene::processEventQueue() {
 
 		case SceneEvent::kCreditsMessage:
 		case SceneEvent::kMessage: {
+			_vm->setTTSVoice((CharacterID)currentEvent.characterID);
 			message = currentEvent.message;
 			messageAnimation = NULL;
 			if (currentEvent.firstFrame) {
@@ -1277,6 +1281,13 @@ void Scene::clear() {
 void Scene::clearMessage() {
 	message.clear();
 	messageTimer = 0;
+
+	// Reset TTS voice to Mark's voice so that objects and items are always narrated
+	// with his voice
+	if (_messageColor != textColorMark) {
+		_vm->setTTSVoice(kMark);
+	}
+
 	_messageColor = textColorMark;
 	messageFirstFrame = 0;
 	messageLastFrame = 0;
diff --git a/engines/teenagent/scene.h b/engines/teenagent/scene.h
index 8e78fa51b6a..7eaf415beb8 100644
--- a/engines/teenagent/scene.h
+++ b/engines/teenagent/scene.h
@@ -90,6 +90,7 @@ struct SceneEvent {
 		byte lastFrame;
 	};
 	byte object;
+	int characterID;
 
 	SceneEvent(Type type_) :
 		type(type_), message(), color(textColorMark), slot(0), animation(0), timer(0), orientation(0), dst(),
diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp
index e4f2b49a1c2..7c9d277f611 100644
--- a/engines/teenagent/teenagent.cpp
+++ b/engines/teenagent/teenagent.cpp
@@ -725,12 +725,12 @@ Common::String TeenAgentEngine::parseMessage(uint16 addr) {
 	return message;
 }
 
-void TeenAgentEngine::displayMessage(const Common::String &str, byte color, uint16 x, uint16 y) {
+void TeenAgentEngine::displayMessage(const Common::String &str, CharacterID characterID, uint16 x, uint16 y) {
 	if (str.empty()) {
 		return;
 	}
 
-	if (color == textColorMark) { // mark's
+	if (characterDialogData[characterID].textColor == textColorMark) { // mark's
 		SceneEvent e(SceneEvent::kPlayAnimation);
 		e.animation = 0;
 		e.slot = 0x80;
@@ -740,10 +740,11 @@ void TeenAgentEngine::displayMessage(const Common::String &str, byte color, uint
 	{
 		SceneEvent event(SceneEvent::kMessage);
 		event.message = str;
-		event.color = color;
+		event.color = characterDialogData[characterID].textColor;
 		event.slot = 0;
 		event.dst.x = x;
 		event.dst.y = y;
+		event.characterID = characterID;
 		scene->push(event);
 	}
 
@@ -755,19 +756,20 @@ void TeenAgentEngine::displayMessage(const Common::String &str, byte color, uint
 	}
 }
 
-void TeenAgentEngine::displayMessage(uint16 addr, byte color, uint16 x, uint16 y) {
-	displayMessage(parseMessage(addr), color, x, y);
+void TeenAgentEngine::displayMessage(uint16 addr, CharacterID characterID, uint16 x, uint16 y) {
+	displayMessage(parseMessage(addr), characterID, x, y);
 }
 
-void TeenAgentEngine::displayAsyncMessage(uint16 addr, uint16 x, uint16 y, uint16 firstFrame, uint16 lastFrame, byte color) {
+void TeenAgentEngine::displayAsyncMessage(uint16 addr, uint16 x, uint16 y, uint16 firstFrame, uint16 lastFrame, CharacterID characterID) {
 	SceneEvent event(SceneEvent::kMessage);
 	event.message = parseMessage(addr);
 	event.slot = 0;
-	event.color = color;
+	event.color = characterDialogData[characterID].textColor;
 	event.dst.x = x;
 	event.dst.y = y;
 	event.firstFrame = firstFrame;
 	event.lastFrame = lastFrame;
+	event.characterID = characterID;
 
 	scene->push(event);
 }
@@ -804,6 +806,7 @@ void TeenAgentEngine::displayCredits(uint16 addr, uint16 timer) {
 	int w = res->font8.render(NULL, 0, 0, event.message, textColorCredits);
 	event.dst.x = (kScreenWidth - w) / 2;
 	event.timer = timer;
+	event.characterID = kCreditsText;
 	scene->push(event);
 }
 
@@ -818,6 +821,7 @@ void TeenAgentEngine::displayCredits() {
 			++lines;
 	event.dst.x = (kScreenWidth - res->font7.render(NULL, 0, 0, event.message, textColorCredits)) / 2;
 	event.timer = 11 * lines - event.dst.y + 22;
+	event.characterID = kCreditsText;
 	debug(2, "credits = %s", event.message.c_str());
 	scene->push(event);
 }
@@ -829,6 +833,7 @@ void TeenAgentEngine::displayCutsceneMessage(uint16 addr, uint16 x, uint16 y) {
 	event.dst.x = x;
 	event.dst.y = y;
 	event.lan = 7;
+	event.characterID = kMark;
 
 	scene->push(event);
 }
@@ -1091,4 +1096,41 @@ void TeenAgentEngine::stopTextToSpeech() {
 	}
 }
 
+void TeenAgentEngine::setTTSVoice(CharacterID characterID) const {
+	Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager();
+	if (ttsMan && ConfMan.getBool("tts_enabled")) {
+		Common::Array<int> voices;
+		int pitch = 0;
+		Common::TTSVoice::Gender gender;
+
+		if (characterDialogData[characterID].male) {
+			voices = ttsMan->getVoiceIndicesByGender(Common::TTSVoice::MALE);
+			gender = Common::TTSVoice::MALE;
+		} else {
+			voices = ttsMan->getVoiceIndicesByGender(Common::TTSVoice::FEMALE);
+			gender = Common::TTSVoice::FEMALE;
+		}
+
+		// If no voice is available for the necessary gender, set the voice to default
+		if (voices.empty()) {
+			ttsMan->setVoice(0);
+		} else {
+			int voiceIndex = characterDialogData[characterID].voiceID % voices.size();
+			ttsMan->setVoice(voices[voiceIndex]);
+		}
+
+		// If no voices are available for this gender, alter the pitch to mimic a voice
+		// of the other gender
+		if (ttsMan->getVoice().getGender() != gender) {
+			if (gender == Common::TTSVoice::MALE) {
+				pitch -= 50;
+			} else {
+				pitch += 50;
+			}
+		}
+
+		ttsMan->setPitch(pitch);
+	}
+}
+
 } // End of namespace TeenAgent
diff --git a/engines/teenagent/teenagent.h b/engines/teenagent/teenagent.h
index 39ea28a84ca..450980d7059 100644
--- a/engines/teenagent/teenagent.h
+++ b/engines/teenagent/teenagent.h
@@ -112,9 +112,9 @@ public:
 	Common::String parseMessage(uint16 addr);
 
 	//event driven:
-	void displayMessage(uint16 addr, byte color = textColorMark, uint16 x = 0, uint16 y = 0);
-	void displayMessage(const Common::String &str, byte color = textColorMark, uint16 x = 0, uint16 y = 0);
-	void displayAsyncMessage(uint16 addr, uint16 x, uint16 y, uint16 firstFrame, uint16 lastFrame, byte color = textColorMark);
+	void displayMessage(uint16 addr, CharacterID characterID = kMark, uint16 x = 0, uint16 y = 0);
+	void displayMessage(const Common::String &str, CharacterID characterID = kMark, uint16 x = 0, uint16 y = 0);
+	void displayAsyncMessage(uint16 addr, uint16 x, uint16 y, uint16 firstFrame, uint16 lastFrame, CharacterID characterID = kMark);
 	void displayAsyncMessageInSlot(uint16 addr, byte slot, uint16 firstFrame, uint16 lastFrame, byte color = textColorMark);
 	void displayCredits(uint16 addr, uint16 timer = 0);
 	void displayCutsceneMessage(uint16 addr, uint16 x, uint16 y);
@@ -162,6 +162,7 @@ public:
 
 	void sayText(const Common::String &text);
 	void stopTextToSpeech();
+	void setTTSVoice(CharacterID characterID) const;
 	Common::String _previousSaid;
 	
 private:


Commit: 16748885863a002c850d240371c1d09608b862d4
    https://github.com/scummvm/scummvm/commit/16748885863a002c850d240371c1d09608b862d4
Author: ellm135 (ellm13531 at gmail.com)
Date: 2025-06-04T22:51:48+01:00

Commit Message:
TEENAGENT: Change TTS to English for Czech and Polish versions

Currently, the Polish and Czech versions have all text in English.
Therefore, the TTS language for these versions should be English to
match the text. The Polish CD/Floppy versions also have no working
voiceover, so they need full TTS.

Changed paths:
    engines/teenagent/detection.cpp
    engines/teenagent/teenagent.cpp


diff --git a/engines/teenagent/detection.cpp b/engines/teenagent/detection.cpp
index 317588470cc..a1f615cd8a3 100644
--- a/engines/teenagent/detection.cpp
+++ b/engines/teenagent/detection.cpp
@@ -153,7 +153,7 @@ static const ADGameDescription teenAgentGameDescriptions[] = {
 		Common::PL_POL,
 		Common::kPlatformDOS,
 		ADGF_CD,
-		GUIO1(GUIO_NOMIDI)
+		GUIO2(GUIO_NOMIDI, GAMEOPTION_TTS)
 	},
 	{ // Polish Floppy
 		"teenagent",
diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp
index 7c9d277f611..665a3b91f3a 100644
--- a/engines/teenagent/teenagent.cpp
+++ b/engines/teenagent/teenagent.cpp
@@ -548,7 +548,15 @@ Common::Error TeenAgentEngine::run() {
 
 	Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager();
 	if (ttsMan != nullptr) {
-		ttsMan->setLanguage(ConfMan.get("language"));
+		// Currently, the Polish and Czech versions have all text in English
+		// Therefore, the TTS language should be English to match the text
+		// The Polish CD/Floppy versions also have no working voiceover, so they need full TTS
+		if (_gameDescription->language == Common::PL_POL || _gameDescription->language == Common::CS_CZE) {
+			ttsMan->setLanguage("en");
+		} else {
+			ttsMan->setLanguage(ConfMan.get("language"));
+		}
+		
 		ttsMan->enable(ConfMan.getBool("tts_enabled"));
 	}
 




More information about the Scummvm-git-logs mailing list