diff options
| author | Jordan Longstaff <JordanLongstaff@users.noreply.github.com> | 2024-10-14 01:41:30 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-13 22:41:30 -0700 |
| commit | 68fcc5921b022a2ea2a251c1d8d58da696aef21f (patch) | |
| tree | 456e90161ede288be0df3b6f42822a6af790d678 /soh/src/code | |
| parent | 65fbf2cc41dc0a57f7de395f435e6ae9d408338d (diff) | |
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
Diffstat (limited to 'soh/src/code')
| -rw-r--r-- | soh/src/code/z_message_PAL.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index 4e1dc8692..4736f95a7 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -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; } |
