Fix text speed enhancement with slowed down text (#4072)

* Correct behaviour of text speed enhancement

The text speed enhancement increases the size of the text crawl in the number of characters displayed in each step. This messes up certain parts of dialogue that were meant to be displayed in a certain way (like Ganondorf's "Heh heh heh..."), and in places where the text crawl is meant to be slower than normal, it just looks clunky. The text crawl speed enhancement is a wonderful feature, but smoothing out should be easily doable, and is a more correct implementation.

* Fix text speed for normal text

* Flatten if statements
This commit is contained in:
Jordan Longstaff 2024-10-14 01:41:30 -04:00 committed by GitHub
parent 65fbf2cc41
commit 68fcc5921b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -835,6 +835,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
u16 i;
u16 sfxHi;
u16 charTexIdx;
int gTextSpeed;
Font* font = &play->msgCtx.font;
Gfx* gfx = *gfxP;
@ -1115,11 +1116,17 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
break;
}
}
if (msgCtx->textDelayTimer == 0) {
msgCtx->textDrawPos = i + CVarGetInteger(CVAR_ENHANCEMENT("TextSpeed"), 1);
gTextSpeed = CVarGetInteger(CVAR_ENHANCEMENT("TextSpeed"), 1);
if (msgCtx->textDelay == 0) {
msgCtx->textDrawPos = i + gTextSpeed;
} else if (msgCtx->textDelayTimer == 0) {
msgCtx->textDrawPos = i + 1;
msgCtx->textDelayTimer = msgCtx->textDelay;
} else if (msgCtx->textDelayTimer <= gTextSpeed) {
msgCtx->textDelayTimer = 0;
} else {
msgCtx->textDelayTimer--;
msgCtx->textDelayTimer -= gTextSpeed;
}
*gfxP = gfx;
}