mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-25 11:14:15 +01:00
Sped text up
This commit is contained in:
parent
93c57b2bad
commit
c36f2b791b
22
gflib/text.c
22
gflib/text.c
@ -327,10 +327,10 @@ void RunTextPrinters(void)
|
|||||||
if (sTextPrinters[i].active)
|
if (sTextPrinters[i].active)
|
||||||
{
|
{
|
||||||
u16 renderCmd = RenderFont(&sTextPrinters[i]);
|
u16 renderCmd = RenderFont(&sTextPrinters[i]);
|
||||||
|
CopyWindowToVram(sTextPrinters[i].printerTemplate.windowId, COPYWIN_GFX);
|
||||||
switch (renderCmd)
|
switch (renderCmd)
|
||||||
{
|
{
|
||||||
case RENDER_PRINT:
|
case RENDER_PRINT:
|
||||||
CopyWindowToVram(sTextPrinters[i].printerTemplate.windowId, COPYWIN_GFX);
|
|
||||||
case RENDER_UPDATE:
|
case RENDER_UPDATE:
|
||||||
if (sTextPrinters[i].callback != NULL)
|
if (sTextPrinters[i].callback != NULL)
|
||||||
sTextPrinters[i].callback(&sTextPrinters[i].printerTemplate, renderCmd);
|
sTextPrinters[i].callback(&sTextPrinters[i].printerTemplate, renderCmd);
|
||||||
@ -938,6 +938,7 @@ static u16 RenderText(struct TextPrinter *textPrinter)
|
|||||||
u16 currChar;
|
u16 currChar;
|
||||||
s32 width;
|
s32 width;
|
||||||
s32 widthHelper;
|
s32 widthHelper;
|
||||||
|
u8 repeats;
|
||||||
|
|
||||||
switch (textPrinter->state)
|
switch (textPrinter->state)
|
||||||
{
|
{
|
||||||
@ -961,6 +962,21 @@ static u16 RenderText(struct TextPrinter *textPrinter)
|
|||||||
else
|
else
|
||||||
textPrinter->delayCounter = textPrinter->textSpeed;
|
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;
|
currChar = *textPrinter->printerTemplate.currentChar;
|
||||||
textPrinter->printerTemplate.currentChar++;
|
textPrinter->printerTemplate.currentChar++;
|
||||||
|
|
||||||
@ -1164,6 +1180,10 @@ static u16 RenderText(struct TextPrinter *textPrinter)
|
|||||||
else
|
else
|
||||||
textPrinter->printerTemplate.currentX += gCurGlyph.width;
|
textPrinter->printerTemplate.currentX += gCurGlyph.width;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
repeats--;
|
||||||
|
|
||||||
|
} while (repeats > 0);
|
||||||
return RENDER_PRINT;
|
return RENDER_PRINT;
|
||||||
case RENDER_STATE_WAIT:
|
case RENDER_STATE_WAIT:
|
||||||
if (TextPrinterWait(textPrinter))
|
if (TextPrinterWait(textPrinter))
|
||||||
|
@ -76,8 +76,8 @@ const u16 gStandardMenuPalette[] = INCBIN_U16("graphics/interface/std_menu.gbapa
|
|||||||
|
|
||||||
static const u8 sTextSpeedFrameDelays[] =
|
static const u8 sTextSpeedFrameDelays[] =
|
||||||
{
|
{
|
||||||
[OPTIONS_TEXT_SPEED_SLOW] = 8,
|
[OPTIONS_TEXT_SPEED_SLOW] = 1,
|
||||||
[OPTIONS_TEXT_SPEED_MID] = 4,
|
[OPTIONS_TEXT_SPEED_MID] = 1,
|
||||||
[OPTIONS_TEXT_SPEED_FAST] = 1
|
[OPTIONS_TEXT_SPEED_FAST] = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user