Skip to content

Commit

Permalink
Add alternate/beta title background
Browse files Browse the repository at this point in the history
Added an option to enable the alternative background for title/load screens.
  • Loading branch information
xan1242 authored Jan 20, 2020
1 parent 5d2ffaf commit 96d4982
Showing 1 changed file with 41 additions and 3 deletions.
44 changes: 41 additions & 3 deletions dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ char CurrentFEShape[255];
bool bEnableConsole = false;
bool bDisableLetterboxing = false;
bool bClassicMapPosition = false;
bool bAlternativeBackground = false;
int FixHUD = 2;
unsigned int RenderMemorySize = 0x732000;
unsigned int GeneralMemorySize = 0x5FB9000;
Expand Down Expand Up @@ -136,6 +137,16 @@ int __stdcall sub_59BAE0_hook(int a2, int a3)
CurrentFEShapePointer = *(char**)(v3 + 4);
strcpy(CurrentFEShape, CurrentFEShapePointer);

// alternative titlescreen graphics start
if (bAlternativeBackground)
{
if (strcmp(CurrentFEShapePointer, "[PC:S_INTRO.LYR.PCD] back") == 0)
{
strcpy(CurrentFEShapePointer, "[PC:S_FEAT.LYR.PCD] feat");
}
}
// alternative titlescreen graphics end

if (*(int*)(v3 + 12))
{
sub_5994D0(a3, v3);
Expand Down Expand Up @@ -738,16 +749,41 @@ int __stdcall sub_59B840_hook_2(char *key, mBorders* unk1, unsigned int unk2) //
// logo
if ((strcmp(CurrentFEElement, "LOGO.GStaticImage") == 0) || (strcmp(CurrentFEElement, "logo.GStaticImage") == 0))
{
(*unk1).botX = 0;
(*unk1).botY = 0;
(*unk1).topX = (resX_600height - (*unk1).botX) / 2;
// alternative titlescreen graphics start
if (!bAlternativeBackground)
{
(*unk1).botX = 0;
(*unk1).botY = 0;
}
// alternative titlescreen graphics end

//return retval;
}
if (strcmp(CurrentFEShape, "[PC:S_INTRO.LYR.PCD] nfsl") == 0)
{
(*unk1).topX = (resX_600height - (*unk1).botX) / 2;
// alternative titlescreen graphics start
if (bAlternativeBackground)
{
(*unk1).botX = 0;
(*unk1).botY = 0;
}
// alternative titlescreen graphics end
//return retval;
}

// alternative titlescreen graphics start
if (bAlternativeBackground)
{
if (strcmp(CurrentFEElement, "title.GText") == 0)
{
if ((*unk1).botX == 225 && (*unk1).botY == 42 && (*unk1).topY == 116)
{
(*unk1).topY = 60;
}
}
}
// alternative titlescreen graphics end
if (strcmp(CurrentFEElement, "EATip.GText") == 0)
{
(*unk1).topX = (resX_600height - (*unk1).botX) / 2;
Expand Down Expand Up @@ -776,6 +812,7 @@ int __stdcall sub_59B840_hook_2(char *key, mBorders* unk1, unsigned int unk2) //
// //(*unk1).topX = pow(aspect, 2) * 90;
// //(*unk1).topX = 435;
//}

// title screen end

// titlebar fix
Expand Down Expand Up @@ -2182,6 +2219,7 @@ int InitConfig()
bDisableLetterboxing = inireader.ReadInteger("HP2WSFix", "DisableLetterboxing", 0);
bClassicMapPosition = inireader.ReadInteger("HP2WSFix", "ClassicMapPosition", 0);
}
bAlternativeBackground = inireader.ReadInteger("HP2WSFix", "AlternativeBackground", 0);
RenderMemorySize = inireader.ReadInteger("MEMORY", "CLASS_RENDER", 0x732000);
GeneralMemorySize = inireader.ReadInteger("MEMORY", "GENERAL", 0x5FB9000);
AudioMemorySize = inireader.ReadInteger("MEMORY", "CLASS_AUDIO", 0xA00000);
Expand Down

0 comments on commit 96d4982

Please sign in to comment.