Boss title fixes.

This commit is contained in:
Baoulettes 2022-04-30 14:01:31 +02:00 committed by GitHub
parent 444026038e
commit 870422fa24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 27 additions and 6 deletions

View File

@ -1009,6 +1009,9 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) {
s32 doubleWidth;
s32 titleY;
s32 titleSecondY;
s32 textureLanguageOffset;
s32 shiftTopY;
s32 shiftBottomY;
if (titleCtx->alpha != 0) {
width = titleCtx->width;
@ -1022,31 +1025,49 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) {
height = (width * height > 0x1000) ? 0x1000 / width : height;
titleSecondY = titleY + (height * 4);
/* A more elegant way should be made but this one actually work fine.
I tried every single bosses in both English/French and German.
Zone name should not be affected by this changes.
I do not see any zone name with these dimensions. */
if (gSaveContext.language == LANGUAGE_GER && titleCtx->height == 40 && titleCtx->width == 128) {
textureLanguageOffset = (width * height * gSaveContext.language);
shiftTopY = 0x400;
shiftBottomY = 0x1400;
} else if (gSaveContext.language == LANGUAGE_FRA && titleCtx->height == 40 && titleCtx->width == 128) {
textureLanguageOffset = (width * height * gSaveContext.language);
shiftTopY = 0x800;
shiftBottomY = 0x1800;
} else { //Fall back to English value.
textureLanguageOffset = 0;
shiftTopY = 0;
shiftBottomY = 0x1000;
}
// WORLD_OVERLAY_DISP Goes over POLY_XLU_DISP but under POLY_KAL_DISP
WORLD_OVERLAY_DISP = func_80093808(WORLD_OVERLAY_DISP);
gDPSetPrimColor(WORLD_OVERLAY_DISP++, 0, 0, (u8)titleCtx->intensity, (u8)titleCtx->intensity, (u8)titleCtx->intensity,
(u8)titleCtx->alpha);
gDPLoadTextureBlock(WORLD_OVERLAY_DISP++, (uintptr_t)titleCtx->texture, G_IM_FMT_IA,
gDPLoadTextureBlock(WORLD_OVERLAY_DISP++, (uintptr_t)titleCtx->texture + textureLanguageOffset + shiftBottomY, G_IM_FMT_IA,
G_IM_SIZ_8b,
width, height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
gSPTextureRectangle(WORLD_OVERLAY_DISP++, titleX, titleY, ((doubleWidth * 2) + titleX) - 4, titleY + (height * 4) - 1,
//Removing the -1 there remove the gap between top and bottom textures.
gSPTextureRectangle(WORLD_OVERLAY_DISP++, titleX, titleY, ((doubleWidth * 2) + titleX) - 4, titleY + (height * 4),
G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
height = titleCtx->height - height;
// If texture is bigger than 0x1000, display the rest
if (height > 0) {
gDPLoadTextureBlock(WORLD_OVERLAY_DISP++, (uintptr_t)titleCtx->texture + 0x1000,
gDPLoadTextureBlock(WORLD_OVERLAY_DISP++, (uintptr_t)titleCtx->texture + textureLanguageOffset + shiftBottomY,
G_IM_FMT_IA,
G_IM_SIZ_8b, width, height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
//Removing the -1 there remove the gap between top and bottom textures.
gSPTextureRectangle(WORLD_OVERLAY_DISP++, titleX, titleSecondY, ((doubleWidth * 2) + titleX) - 4,
titleSecondY + (height * 4) - 1, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
titleSecondY + (height * 4), G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
}
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_actor.c", 2880);