summaryrefslogtreecommitdiff
path: root/soh/src/code
diff options
context:
space:
mode:
authorBaoulettes <perlouzerie@hotmail.fr>2022-05-03 00:27:06 +0200
committerGitHub <noreply@github.com>2022-05-02 18:27:06 -0400
commitf1e85d1e720ba0fc61259dc4ea65915a9ffca9e1 (patch)
tree2186beb24b89e095bf9f41a8ef7f5e718f2deed7 /soh/src/code
parentc5f120b6f833528c5a1b0bc61bcb823a5164b597 (diff)
Bosses title cards fixes (#247)
* Boss title fixes. * Proper X/Y/H/W * Proper x,y,w,h * Proper X,Y,W,H * Actually had wrong height (was 32, should be 40) * one of the last x,y,h,w fix * WIP really need a better way to check it. * Fix Ganondorf title card. * better conditional logic * No more workaround! * Add two var in the TitleCardContext structures * Added hasTranslation to Phantom Ganon's Horse funny how that the horse that hold the title card. * Add hasTranslation to Dodongo. * Revert workaround and add hasTranslation=false * Added hasTranslation to big piggy Ganon * Add hasTranslation to Gohma * Add hasTranslation to Morpha * Add hasTranslation to Twins first part. * Add hastranslation to that eletro "dude" * Add hastranslation to bongo bongo * Added hasTranslation to airwing v2 * add hasTranslation to TitleCard_InitBossName init * isBossCard to true now that I can confirm it work imagine in TitleCard_InitBossName setting isBossCard to false... * no need to use bool there is seem to not like it * change bool to s16
Diffstat (limited to 'soh/src/code')
-rw-r--r--soh/src/code/z_actor.c38
1 files changed, 31 insertions, 7 deletions
diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c
index 9d9a34c96..eee3d1724 100644
--- a/soh/src/code/z_actor.c
+++ b/soh/src/code/z_actor.c
@@ -758,12 +758,14 @@ void func_8002CDE4(GlobalContext* globalCtx, TitleCardContext* titleCtx) {
}
void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s16 x, s16 y, u8 width,
- u8 height) {
+ u8 height, s16 hasTranslation) {
if (ResourceMgr_OTRSigCheck(texture))
texture = ResourceMgr_LoadTexByName(texture);
titleCtx->texture = texture;
+ titleCtx->isBossCard = true;
+ titleCtx->hasTranslation = hasTranslation;
titleCtx->x = x;
titleCtx->y = y;
titleCtx->width = width;
@@ -981,6 +983,8 @@ void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCt
titleCtx->texture = ResourceMgr_LoadTexByName(texture);
//titleCtx->texture = texture;
+ titleCtx->isBossCard = false;
+ titleCtx->hasTranslation = false;
titleCtx->x = x;
titleCtx->y = y;
titleCtx->width = width;
@@ -1009,6 +1013,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 +1029,48 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) {
height = (width * height > 0x1000) ? 0x1000 / width : height;
titleSecondY = titleY + (height * 4);
+ textureLanguageOffset = 0x0;
+ shiftTopY = 0x0;
+ shiftBottomY = 0x1000;
+
+ //if this card is bosses cards, has translation and that is not using English language.
+ if (titleCtx->isBossCard == 1 && titleCtx->hasTranslation == 1 && gSaveContext.language != LANGUAGE_ENG) {
+ if (gSaveContext.language == LANGUAGE_GER) {
+ textureLanguageOffset = (width * height * gSaveContext.language);
+ shiftTopY = 0x400;
+ shiftBottomY = 0x1400;
+ } else if (gSaveContext.language == LANGUAGE_FRA) {
+ textureLanguageOffset = (width * height * gSaveContext.language);
+ shiftTopY = 0x800;
+ shiftBottomY = 0x1800;
+ }
+ }
+
// 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);