[Scummvm-git-logs] scummvm master -> 8fe0f93630600b52efdd9d9420ddc9318eb5a176

AndywinXp noreply at scummvm.org
Sun Apr 28 17:59:36 UTC 2024


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:
8fe0f93630 SCUMM: Rename CHARSET_1() to displayDialog()


Commit: 8fe0f93630600b52efdd9d9420ddc9318eb5a176
    https://github.com/scummvm/scummvm/commit/8fe0f93630600b52efdd9d9420ddc9318eb5a176
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-04-28T19:59:30+02:00

Commit Message:
SCUMM: Rename CHARSET_1() to displayDialog()

We are now using a name which respects the coding
guidelines and also reflects how the actual function was
named.

Changed paths:
    engines/scumm/actor.cpp
    engines/scumm/gfx_gui.cpp
    engines/scumm/script_v2.cpp
    engines/scumm/scumm.cpp
    engines/scumm/scumm.h
    engines/scumm/scumm_v7.h
    engines/scumm/string.cpp
    engines/scumm/string_v7.cpp


diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index 9b9f1713873..62818444023 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -3032,7 +3032,7 @@ void ScummEngine_v7::actorTalk(const byte *msg) {
 		_string[0].wrapping = true;
 	}
 
-	CHARSET_1();
+	displayDialog();
 
 	if (!usingOldSystem) {
 		if (_game.version == 8)
@@ -3052,7 +3052,7 @@ void ScummEngine::actorTalk(const byte *msg) {
 	// I have commented out this workaround, since it did cause another
 	// bug (#11480). It is not okay to skip the stopTalk() calls here.
 	// Instead, I have added two checks from LOOM DOS EGA disasm (one
-	// below and one in CHARSET_1()).
+	// below and one in displayDialog()).
 	// WORKAROUND for bugs #985 and #990
 	/*if (_game.id == GID_LOOM) {
 		if (!*_charsetBuffer)
@@ -3079,7 +3079,7 @@ void ScummEngine::actorTalk(const byte *msg) {
 			if (_game.heversion != 0)
 				((ActorHE *)a)->_heTalking = true;
 			// The second check is from LOOM DOS EGA disasm. It prevents weird speech animations
-			// with empty strings (bug #990). The same code is present in CHARSET_1(). The FM-Towns
+			// with empty strings (bug #990). The same code is present in displayDialog(). The FM-Towns
 			// versions don't have such code, but I do not get the weird speech animations either.
 			// So apparently it is not needed there.
 			if (!_string[0].no_talk_anim && !(_game.id == GID_LOOM && _game.platform != Common::kPlatformFMTowns && !*_charsetBuffer)) {
@@ -3113,7 +3113,7 @@ void ScummEngine::actorTalk(const byte *msg) {
 	if (VAR_CHARCOUNT != 0xFF)
 		VAR(VAR_CHARCOUNT) = 0;
 	_haveActorSpeechMsg = true;
-	CHARSET_1();
+	displayDialog();
 }
 
 void Actor::runActorTalkScript(int f) {
diff --git a/engines/scumm/gfx_gui.cpp b/engines/scumm/gfx_gui.cpp
index 222e546ec63..aa3299c0ecf 100644
--- a/engines/scumm/gfx_gui.cpp
+++ b/engines/scumm/gfx_gui.cpp
@@ -2598,10 +2598,10 @@ void ScummEngine::showMainMenu() {
 
 	// A little bit of hackery: since we handle the main loop a little bit
 	// differently (basically we start from a different position, but the order
-	// remains the same), we call CHARSET_1() here to refresh the dialog texts
+	// remains the same), we call displayDialog() here to refresh the dialog texts
 	// immediately and avoid getting a frame in which their color is wrong...
 	if (_game.version == 7)
-		CHARSET_1();
+		displayDialog();
 
 	if (_game.version < 7 && !hasLoadedState) {
 		restoreSurfacesPostGUI();
diff --git a/engines/scumm/script_v2.cpp b/engines/scumm/script_v2.cpp
index 18520cc5b06..74d185359aa 100644
--- a/engines/scumm/script_v2.cpp
+++ b/engines/scumm/script_v2.cpp
@@ -377,7 +377,7 @@ void ScummEngine_v2::decodeParseString() {
 		c &= 0x7f;
 
 		if (c < 8) {
-			// Special codes as seen in CHARSET_1 etc. My guess is that they
+			// Special codes as seen in displayDialog etc. My guess is that they
 			// have a similar function as the corresponding embedded stuff in modern
 			// games. Hence for now we convert them to the modern format.
 			// This might allow us to reuse the existing code.
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index ca7cbb87ed9..8adbd9f9f0f 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -2645,10 +2645,10 @@ void ScummEngine::scummLoop(int delta) {
 	if (VAR_EGO != 0xFF)
 		oldEgo = VAR(VAR_EGO);
 
-	// In V1-V3 games, CHARSET_1 is called much earlier than in newer games.
+	// In V1-V3 games, displayDialog is called much earlier than in newer games.
 	// See also bug #987 for a case were this makes a difference.
 	if (_game.version <= 3)
-		CHARSET_1();
+		displayDialog();
 
 	processInput();
 
@@ -2756,14 +2756,14 @@ load_game:
 
 	if (_currentRoom == 0) {
 		if (_game.version > 3)
-			CHARSET_1();
+			displayDialog();
 		drawDirtyScreenParts();
 	} else {
 		walkActors();
 		moveCamera();
 		updateObjectStates();
 		if (_game.version > 3)
-			CHARSET_1();
+			displayDialog();
 
 		scummLoop_handleDrawing();
 
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index 09e08937a19..f94a3cb0c5a 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -1616,7 +1616,7 @@ protected:
 
 	virtual bool handleNextCharsetCode(Actor *a, int *c);
 	virtual void drawSentence() {}
-	virtual void CHARSET_1();
+	virtual void displayDialog();
 	bool newLine();
 	void drawString(int a, const byte *msg);
 	virtual void fakeBidiString(byte *ltext, bool ignoreVerb, int ltextSize) const;
diff --git a/engines/scumm/scumm_v7.h b/engines/scumm/scumm_v7.h
index 403f24b79d6..fa151860e95 100644
--- a/engines/scumm/scumm_v7.h
+++ b/engines/scumm/scumm_v7.h
@@ -99,7 +99,7 @@ public:
 	void processSubtitleQueue();
 	void addSubtitleToQueue(const byte *text, const Common::Point &pos, byte color, byte charset, bool center, bool wrap);
 	void clearSubtitleQueue();
-	void CHARSET_1() override;
+	void displayDialog() override;
 	bool isSmushActive() override { return _smushActive; }
 	bool isInsaneActive() override { return _insane ? _insane->isInsaneActive() : false; }
 	void removeBlastTexts() override;
diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp
index eb50085cb1f..3643d7e756a 100644
--- a/engines/scumm/string.cpp
+++ b/engines/scumm/string.cpp
@@ -550,7 +550,7 @@ bool ScummEngine::newLine() {
 			// the original code it seems that setting _nextLeft to 0 is the right thing to do here.
 			_nextLeft = /*_game.version >= 6 ? _string[0].xpos :*/ 0;
 
-		// See CHARSET_1() for more context about the following Sega CD code.
+		// See displayDialog() for more context about the following Sega CD code.
 		if (_game.platform == Common::kPlatformSegaCD) {
 			// Clip 16 pixels away from the right
 			if (_nextLeft + stringWidth > (_screenWidth - 16)) {
@@ -940,7 +940,7 @@ void ScummEngine_v2::drawSentence() {
 	drawString(2, (byte *)string);
 }
 
-void ScummEngine::CHARSET_1() {
+void ScummEngine::displayDialog() {
 	Actor *a;
 	if (_game.heversion >= 60 && _haveMsg == 3) {
 		stopTalk();
@@ -960,7 +960,7 @@ void ScummEngine::CHARSET_1() {
 
 	a = nullptr;
 	if (getTalkingActor() != 0xFF)
-		a = derefActorSafe(getTalkingActor(), "CHARSET_1");
+		a = derefActorSafe(getTalkingActor(), "displayDialog");
 
 	if (a && _string[0].overhead) {
 		int s;
diff --git a/engines/scumm/string_v7.cpp b/engines/scumm/string_v7.cpp
index df5712baa20..b499cccb59e 100644
--- a/engines/scumm/string_v7.cpp
+++ b/engines/scumm/string_v7.cpp
@@ -600,7 +600,7 @@ void ScummEngine_v7::clearSubtitleQueue() {
 	_subtitleQueuePos = 0;
 }
 
-void ScummEngine_v7::CHARSET_1() {
+void ScummEngine_v7::displayDialog() {
 	processSubtitleQueue();
 
 	bool usingOldSystem = (_game.id == GID_FT) || (_game.id == GID_DIG && _game.features & GF_DEMO);
@@ -614,7 +614,7 @@ void ScummEngine_v7::CHARSET_1() {
 
 	Actor *a = NULL;
 	if (getTalkingActor() != 0xFF)
-		a = derefActorSafe(getTalkingActor(), "CHARSET_1");
+		a = derefActorSafe(getTalkingActor(), "displayDialog");
 
 	StringTab saveStr = _string[0];
 	if (a && _string[0].overhead) {




More information about the Scummvm-git-logs mailing list