No more workaround!

This commit is contained in:
Baoulettes 2022-05-01 08:32:27 +02:00 committed by GitHub
parent 2169978de3
commit 3ef073ea83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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, void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s16 x, s16 y, u8 width,
u8 height) { u8 height, bool hasTranslation) {
if (ResourceMgr_OTRSigCheck(texture)) if (ResourceMgr_OTRSigCheck(texture))
texture = ResourceMgr_LoadTexByName(texture); texture = ResourceMgr_LoadTexByName(texture);
titleCtx->texture = texture; titleCtx->texture = texture;
titleCtx->isBossCard = false;
titleCtx->hasTranslation = hasTranslation;
titleCtx->x = x; titleCtx->x = x;
titleCtx->y = y; titleCtx->y = y;
titleCtx->width = width; titleCtx->width = width;
@ -981,6 +983,8 @@ void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCt
titleCtx->texture = ResourceMgr_LoadTexByName(texture); titleCtx->texture = ResourceMgr_LoadTexByName(texture);
//titleCtx->texture = texture; //titleCtx->texture = texture;
titleCtx->isBossCard = false;
titleCtx->hasTranslation = false;
titleCtx->x = x; titleCtx->x = x;
titleCtx->y = y; titleCtx->y = y;
titleCtx->width = width; titleCtx->width = width;
@ -1025,24 +1029,21 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) {
height = (width * height > 0x1000) ? 0x1000 / width : height; height = (width * height > 0x1000) ? 0x1000 / width : height;
titleSecondY = titleY + (height * 4); 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.
Also Ganondorf do not have French and German title card it seem.
A dirty method has been applied to actually detect it, once a better
method is found this workaround will be reverted.*/
textureLanguageOffset = 0x0; textureLanguageOffset = 0x0;
shiftTopY = 0x0; shiftTopY = 0x0;
shiftBottomY = 0x1000; shiftBottomY = 0x1000;
if (gSaveContext.language == LANGUAGE_GER && titleCtx->height == 40 && titleCtx->width == 128) {
textureLanguageOffset = (width * height * gSaveContext.language); //if this card is bosses cards, has translation and that is not using English language.
shiftTopY = 0x400; if (titleCtx->isBossCard && titleCtx->hasTranslation && gSaveContext.language != LANGUAGE_ENG) {
shiftBottomY = 0x1400; if (gSaveContext.language == LANGUAGE_GER) {
} else if (gSaveContext.language == LANGUAGE_FRA && titleCtx->height == 40 && titleCtx->width == 128) { textureLanguageOffset = (width * height * gSaveContext.language);
textureLanguageOffset = (width * height * gSaveContext.language); shiftTopY = 0x400;
shiftTopY = 0x800; shiftBottomY = 0x1400;
shiftBottomY = 0x1800; } 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 Goes over POLY_XLU_DISP but under POLY_KAL_DISP