Fix copyright position for PAL 1.1 (#2952)

This commit is contained in:
Amaro Martínez 2023-06-07 12:02:45 -05:00 committed by GitHub
parent 7e1ee6e23e
commit e46c60a7a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 31 deletions

View File

@ -619,26 +619,21 @@ s16 GetCharArraySize(const char* str) {
return length; return length;
} }
static char* EnMag_GetCopyrightTex() static void EnMag_SetCopyValues(const char** copy_tex, u16* copy_width, u16* copy_xl, u16* copy_xh) {
{ u32 gameVersion = ResourceMgr_GetGameVersion(0);
uint32_t gameVersion = ResourceMgr_GetGameVersion(0);
switch (gameVersion) { switch (gameVersion) {
case OOT_PAL_11: case OOT_PAL_11:
return gTitleCopyrightN64Tex; *copy_tex = gTitleCopyright1998Tex;
*copy_width = 128;
*copy_xl = 376;
*copy_xh = 888;
break;
default: default:
return gTitleCopyrightGCTex; *copy_tex = gTitleCopyright19982003Tex;
} *copy_width = 160;
} *copy_xl = 312;
*copy_xh = 952;
static int EnMag_GetCopyrightTexWidth() { break;
uint32_t gameVersion = ResourceMgr_GetGameVersion(0);
switch (gameVersion) {
case OOT_PAL_11:
return 128;
default:
return 160;
} }
} }
@ -664,6 +659,12 @@ void EnMag_DrawInnerMq(Actor* thisx, PlayState* play, Gfx** gfxp) {
lang = gSaveContext.language; lang = gSaveContext.language;
} }
const char* copy_tex = NULL;
u16 copy_width;
u16 copy_xl;
u16 copy_xh;
EnMag_SetCopyValues(&copy_tex, &copy_width, &copy_xl, &copy_xh);
gSPSegment(gfx++, 0x06, play->objectCtx.status[this->actor.objBankIndex].segment); gSPSegment(gfx++, 0x06, play->objectCtx.status[this->actor.objBankIndex].segment);
Gfx_SetupDL_39Ptr(&gfx); Gfx_SetupDL_39Ptr(&gfx);
@ -725,8 +726,7 @@ void EnMag_DrawInnerMq(Actor* thisx, PlayState* play, Gfx** gfxp) {
gDPPipeSync(gfx++); gDPPipeSync(gfx++);
gDPSetPrimColor(gfx++, 0, 0, 255, 255, 255, (s16)this->subAlpha); gDPSetPrimColor(gfx++, 0, 0, 255, 255, 255, (s16)this->subAlpha);
EnMag_DrawImageRGBA32(&gfx, 174, 145, gTitleMasterQuestSubtitleTex, EnMag_DrawImageRGBA32(&gfx, 174, 145, gTitleMasterQuestSubtitleTex, 128, 32);
EnMag_GetCopyrightTexWidth(), 32);
} }
Gfx_SetupDL_39Ptr(&gfx); Gfx_SetupDL_39Ptr(&gfx);
@ -737,13 +737,12 @@ void EnMag_DrawInnerMq(Actor* thisx, PlayState* play, Gfx** gfxp) {
gDPSetPrimColor(gfx++, 0, 0, (s16)this->copyrightAlpha, (s16)this->copyrightAlpha, (s16)this->copyrightAlpha, gDPSetPrimColor(gfx++, 0, 0, (s16)this->copyrightAlpha, (s16)this->copyrightAlpha, (s16)this->copyrightAlpha,
(s16)this->copyrightAlpha); (s16)this->copyrightAlpha);
if ((s16)this->copyrightAlpha != 0) if ((s16)this->copyrightAlpha != 0) {
{ gDPLoadTextureBlock(gfx++, copy_tex, G_IM_FMT_IA, G_IM_SIZ_8b, copy_width, 16, 0,
gDPLoadTextureBlock(gfx++, EnMag_GetCopyrightTex(), G_IM_FMT_IA, G_IM_SIZ_8b, 128, 16, 0,
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK,
G_TX_NOLOD, G_TX_NOLOD); G_TX_NOLOD, G_TX_NOLOD);
gSPTextureRectangle(gfx++, 312, 792, 952, 856, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); gSPTextureRectangle(gfx++, copy_xl, 792, copy_xh, 856, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
} }
if (gSaveContext.fileNum == 0xFEDC) { if (gSaveContext.fileNum == 0xFEDC) {
@ -861,6 +860,12 @@ void EnMag_DrawInnerVanilla(Actor* thisx, PlayState* play, Gfx** gfxp) {
lang = gSaveContext.language; lang = gSaveContext.language;
} }
const char* copy_tex = NULL;
u16 copy_width;
u16 copy_xl;
u16 copy_xh;
EnMag_SetCopyValues(&copy_tex, &copy_width, &copy_xl, &copy_xh);
gSPSegment(gfx++, 0x06, play->objectCtx.status[this->actor.objBankIndex].segment); gSPSegment(gfx++, 0x06, play->objectCtx.status[this->actor.objBankIndex].segment);
Gfx_SetupDL_39Ptr(&gfx); Gfx_SetupDL_39Ptr(&gfx);
@ -931,12 +936,11 @@ void EnMag_DrawInnerVanilla(Actor* thisx, PlayState* play, Gfx** gfxp) {
(s16)this->copyrightAlpha); (s16)this->copyrightAlpha);
if ((s16)this->copyrightAlpha != 0) { if ((s16)this->copyrightAlpha != 0) {
gDPLoadTextureBlock(gfx++, EnMag_GetCopyrightTex(), G_IM_FMT_IA, G_IM_SIZ_8b, EnMag_GetCopyrightTexWidth(), 16, gDPLoadTextureBlock(gfx++, copy_tex, G_IM_FMT_IA, G_IM_SIZ_8b, copy_width, 16, 0,
0,
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK,
G_TX_NOLOD, G_TX_NOLOD); G_TX_NOLOD, G_TX_NOLOD);
gSPTextureRectangle(gfx++, 312, 792, 952, 856, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); gSPTextureRectangle(gfx++, copy_xl, 792, copy_xh, 856, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
} }
if (gSaveContext.fileNum == 0xFEDC) { if (gSaveContext.fileNum == 0xFEDC) {

View File

@ -41,10 +41,7 @@ typedef enum {
/* 0x04 */ MAG_STATE_POST_DISPLAY /* 0x04 */ MAG_STATE_POST_DISPLAY
} EnMagGlobalState; } EnMagGlobalState;
#define dgTitleCopyrightGCTex "__OTR__objects/object_mag/gTitleCopyright19982003Tex" #define dgTitleCopyright1998Tex "__OTR__objects/object_mag/gTitleCopyright1998Tex"
static const ALIGN_ASSET(2) char gTitleCopyrightGCTex[] = dgTitleCopyrightGCTex; static const ALIGN_ASSET(2) char gTitleCopyright1998Tex[] = dgTitleCopyright1998Tex;
#define dgTitleCopyrightN64Tex "__OTR__objects/object_mag/gTitleCopyright1998Tex"
static const ALIGN_ASSET(2) char gTitleCopyrightN64Tex[] = dgTitleCopyrightN64Tex;
#endif #endif