mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-26 19:32:17 -05:00
Fixes ocarina textbox flashing (#1589)
This commit is contained in:
parent
7758749770
commit
ee505fc47d
@ -1281,8 +1281,15 @@ void Message_Decode(GlobalContext* globalCtx) {
|
|||||||
MessageContext* msgCtx = &globalCtx->msgCtx;
|
MessageContext* msgCtx = &globalCtx->msgCtx;
|
||||||
Font* font = &globalCtx->msgCtx.font;
|
Font* font = &globalCtx->msgCtx.font;
|
||||||
|
|
||||||
for (u32 i = 0; i < FONT_CHAR_TEX_SIZE * 120; i += FONT_CHAR_TEX_SIZE) {
|
if ((msgCtx->msgMode >= MSGMODE_OCARINA_STARTING && msgCtx->msgMode <= MSGMODE_OCARINA_AWAIT_INPUT) || msgCtx->textBoxType == TEXTBOX_TYPE_OCARINA) {
|
||||||
gSPInvalidateTexCache(globalCtx->state.gfxCtx->polyOpa.p++, &font->charTexBuf[i]);
|
// TODO: Figure out what specific textures to invalidate to prevent the ocarina textboxes from flashing
|
||||||
|
gSPInvalidateTexCache(globalCtx->state.gfxCtx->polyOpa.p++, NULL);
|
||||||
|
} else {
|
||||||
|
for (u32 i = 0; i < FONT_CHAR_TEX_SIZE * 120; i += FONT_CHAR_TEX_SIZE) {
|
||||||
|
if (&font->charTexBuf[i] != NULL) {
|
||||||
|
gSPInvalidateTexCache(globalCtx->state.gfxCtx->polyOpa.p++, &font->charTexBuf[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
globalCtx->msgCtx.textDelayTimer = 0;
|
globalCtx->msgCtx.textDelayTimer = 0;
|
||||||
@ -1680,6 +1687,17 @@ void Message_OpenText(GlobalContext* globalCtx, u16 textId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sMessageHasSetSfx = D_8014B2F4 = sTextboxSkipped = sTextIsCredits = 0;
|
sMessageHasSetSfx = D_8014B2F4 = sTextboxSkipped = sTextIsCredits = 0;
|
||||||
|
if ((msgCtx->msgMode >= MSGMODE_OCARINA_STARTING && msgCtx->msgMode <= MSGMODE_OCARINA_AWAIT_INPUT) ||
|
||||||
|
msgCtx->textBoxType == TEXTBOX_TYPE_OCARINA) {
|
||||||
|
// TODO: Figure out what specific textures to invalidate to prevent the ocarina textboxes from flashing
|
||||||
|
gSPInvalidateTexCache(globalCtx->state.gfxCtx->polyOpa.p++, NULL);
|
||||||
|
} else {
|
||||||
|
for (u32 i = 0; i < FONT_CHAR_TEX_SIZE * 120; i += FONT_CHAR_TEX_SIZE) {
|
||||||
|
if (&font->charTexBuf[i] != NULL) {
|
||||||
|
gSPInvalidateTexCache(globalCtx->state.gfxCtx->polyOpa.p++, &font->charTexBuf[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
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;
|
||||||
|
Loading…
Reference in New Issue
Block a user