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.
This commit is contained in:
AndywinXp 2024-04-28 19:59:30 +02:00
parent 21730945e1
commit 8fe0f93630
8 changed files with 18 additions and 18 deletions

View File

@ -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) {

View File

@ -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();

View File

@ -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.

View File

@ -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();

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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) {