Browse Source

Fixes laggy text boxes in Switch (#1527)

* Refactors message texture invalidation to remove lag on Switch.

* Removes unneeded commented out function calls.
pull/1532/head
Christopher Leggett 6 months ago committed by GitHub
parent
commit
c5acef2957
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      soh/src/code/z_message_PAL.c

5
soh/src/code/z_message_PAL.c

@ -1281,7 +1281,9 @@ void Message_Decode(GlobalContext* globalCtx) { @@ -1281,7 +1281,9 @@ void Message_Decode(GlobalContext* globalCtx) {
MessageContext* msgCtx = &globalCtx->msgCtx;
Font* font = &globalCtx->msgCtx.font;
gSPInvalidateTexCache(globalCtx->state.gfxCtx->polyOpa.p++, NULL);
for (u32 i = 0; i < FONT_CHAR_TEX_SIZE * 120; i += FONT_CHAR_TEX_SIZE) {
gSPInvalidateTexCache(globalCtx->state.gfxCtx->polyOpa.p++, &font->charTexBuf[i]);
}
globalCtx->msgCtx.textDelayTimer = 0;
globalCtx->msgCtx.textUnskippable = globalCtx->msgCtx.textDelay = globalCtx->msgCtx.textDelayTimer = 0;
@ -1678,7 +1680,6 @@ void Message_OpenText(GlobalContext* globalCtx, u16 textId) { @@ -1678,7 +1680,6 @@ void Message_OpenText(GlobalContext* globalCtx, u16 textId) {
}
sMessageHasSetSfx = D_8014B2F4 = sTextboxSkipped = sTextIsCredits = 0;
gSPInvalidateTexCache(globalCtx->state.gfxCtx->polyOpa.p++, NULL);
if (textId >= 0x0500 && textId < 0x0600) { // text ids 0500 to 0600 are reserved for credits
sTextIsCredits = true;

Loading…
Cancel
Save