Fixes laggy text boxes in Switch (#1527)

* Refactors message texture invalidation to remove lag on Switch.

* Removes unneeded commented out function calls.
This commit is contained in:
Christopher Leggett 2022-09-20 02:12:31 -04:00 committed by GitHub
parent b5b5a58302
commit c5acef2957
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1281,7 +1281,9 @@ void Message_Decode(GlobalContext* globalCtx) {
MessageContext* msgCtx = &globalCtx->msgCtx; MessageContext* msgCtx = &globalCtx->msgCtx;
Font* font = &globalCtx->msgCtx.font; 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.textDelayTimer = 0;
globalCtx->msgCtx.textUnskippable = globalCtx->msgCtx.textDelay = 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) {
} }
sMessageHasSetSfx = D_8014B2F4 = sTextboxSkipped = sTextIsCredits = 0; 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 if (textId >= 0x0500 && textId < 0x0600) { // text ids 0500 to 0600 are reserved for credits
sTextIsCredits = true; sTextIsCredits = true;