Sped text up

This commit is contained in:
Ninjdai 2023-11-12 02:43:13 +01:00
parent 93c57b2bad
commit c36f2b791b
2 changed files with 203 additions and 183 deletions

View File

@ -327,10 +327,10 @@ void RunTextPrinters(void)
if (sTextPrinters[i].active)
{
u16 renderCmd = RenderFont(&sTextPrinters[i]);
CopyWindowToVram(sTextPrinters[i].printerTemplate.windowId, COPYWIN_GFX);
switch (renderCmd)
{
case RENDER_PRINT:
CopyWindowToVram(sTextPrinters[i].printerTemplate.windowId, COPYWIN_GFX);
case RENDER_UPDATE:
if (sTextPrinters[i].callback != NULL)
sTextPrinters[i].callback(&sTextPrinters[i].printerTemplate, renderCmd);
@ -938,6 +938,7 @@ static u16 RenderText(struct TextPrinter *textPrinter)
u16 currChar;
s32 width;
s32 widthHelper;
u8 repeats;
switch (textPrinter->state)
{
@ -961,6 +962,21 @@ static u16 RenderText(struct TextPrinter *textPrinter)
else
textPrinter->delayCounter = textPrinter->textSpeed;
switch (GetPlayerTextSpeed())
{
case OPTIONS_TEXT_SPEED_SLOW:
repeats = 1;
break;
case OPTIONS_TEXT_SPEED_MID:
repeats = 2;
break;
case OPTIONS_TEXT_SPEED_FAST:
repeats = 4;
break;
}
do {
currChar = *textPrinter->printerTemplate.currentChar;
textPrinter->printerTemplate.currentChar++;
@ -1164,6 +1180,10 @@ static u16 RenderText(struct TextPrinter *textPrinter)
else
textPrinter->printerTemplate.currentX += gCurGlyph.width;
}
repeats--;
} while (repeats > 0);
return RENDER_PRINT;
case RENDER_STATE_WAIT:
if (TextPrinterWait(textPrinter))

View File

@ -76,8 +76,8 @@ const u16 gStandardMenuPalette[] = INCBIN_U16("graphics/interface/std_menu.gbapa
static const u8 sTextSpeedFrameDelays[] =
{
[OPTIONS_TEXT_SPEED_SLOW] = 8,
[OPTIONS_TEXT_SPEED_MID] = 4,
[OPTIONS_TEXT_SPEED_SLOW] = 1,
[OPTIONS_TEXT_SPEED_MID] = 1,
[OPTIONS_TEXT_SPEED_FAST] = 1
};