Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ShadowMapResolution = 1 // Game uses 256 and up by default. Increas
ReflectionsResolution = 1 // Game uses 256 by default. Increasing the value makes reflections render in higher resolution. If set to 1, ResX will be used instead.
SkipIntro = 0 // Skips the intro logos.
SkipPressStartToContinue = 0 // Skips the "Press Enter to Continue" prompt.
RestoreCutsceneFOV = 0 // Use original FOV value during cutscenes.

[BONUS]
GogglesLightColor = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export bool bPlayingVideo = false;
export bool bDisplayingBackground = false;
export bool bPressStartToContinue = false;
export bool bSkipPressStartToContinue = false;
export bool bRestoreCutsceneFOV = false;
export HWND hGameWindow = NULL;
export bool bIsWindowed = false;

Expand Down
27 changes: 24 additions & 3 deletions source/SplinterCellPandoraTomorrow.WidescreenFix/Engine.ixx
Original file line number Diff line number Diff line change
Expand Up @@ -300,15 +300,29 @@ export void InitEngine()
{
void operator()(injector::reg_pack& regs)
{
*(float*)&regs.ecx = AdjustFOV(*(float*)(regs.eax + 0x374), Screen.fAspectRatio);
if (bRestoreCutsceneFOV && UObject::GetState(L"EchelonMainHUD") == L"s_Cinematic")
{
*(float*)&regs.ecx = *(float*)(regs.eax + 0x374);
}
else
{
*(float*)&regs.ecx = AdjustFOV(*(float*)(regs.eax + 0x374), Screen.fAspectRatio);
}
}
}; injector::MakeInline<UGameEngine_Draw_Hook>(rpattern.get(0).get<uint32_t>(0), rpattern.get(0).get<uint32_t>(0 + 6));

struct UGameEngine_Draw_Hook2 //1038AA8F
{
void operator()(injector::reg_pack& regs)
{
*(float*)&regs.eax = AdjustFOV(*(float*)(regs.edx + 0x374), Screen.fAspectRatio);
if (bRestoreCutsceneFOV && UObject::GetState(L"EchelonMainHUD") == L"s_Cinematic")
{
*(float*)&regs.eax = *(float*)(regs.edx + 0x374);
}
else
{
*(float*)&regs.eax = AdjustFOV(*(float*)(regs.edx + 0x374), Screen.fAspectRatio);
}
}
};
injector::MakeInline<UGameEngine_Draw_Hook2>(rpattern.get(2).get<uint32_t>(0), rpattern.get(2).get<uint32_t>(0 + 6));
Expand All @@ -320,7 +334,14 @@ export void InitEngine()
{
void operator()(injector::reg_pack& regs)
{
regs.xmm0.f32[0] = AdjustFOV(*(float*)(regs.eax + 0x374), Screen.fAspectRatio);
if (bRestoreCutsceneFOV && UObject::GetState(L"EchelonMainHUD") == L"s_Cinematic")
{
regs.xmm0.f32[0] = *(float*)(regs.eax + 0x374);
}
else
{
regs.xmm0.f32[0] = AdjustFOV(*(float*)(regs.eax + 0x374), Screen.fAspectRatio);
}
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ void Init()
gColor.RGBA = iniReader.ReadInteger("BONUS", "GogglesLightColor", 0);
bSkipIntro = iniReader.ReadInteger("MAIN", "SkipIntro", 0) != 0;
bSkipPressStartToContinue = iniReader.ReadInteger("MAIN", "SkipPressStartToContinue", 0) != 0;
bRestoreCutsceneFOV = iniReader.ReadInteger("MAIN", "RestoreCutsceneFOV", 0) != 0;

if (!Screen.Width || !Screen.Height)
std::tie(Screen.Width, Screen.Height) = GetDesktopRes();
Expand Down