Skip to content
This repository was archived by the owner on Mar 20, 2025. It is now read-only.

Commit c591903

Browse files
committed
Add command for displaying current FOV.
1 parent d328986 commit c591903

3 files changed

Lines changed: 14 additions & 0 deletions

File tree

Cecil/CecilExtensions.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ INDEX sam_bBackgroundGameRender = TRUE;
2323
// FOV patch
2424
INDEX sam_bUseVerticalFOV = TRUE;
2525
FLOAT sam_fCustomFOV = -1.0f;
26+
INDEX sam_bCheckFOV = FALSE;
2627

2728
// Red screen on damage
2829
INDEX sam_bRedScreenOnDamage = TRUE;
@@ -121,6 +122,7 @@ void CECIL_Init(void) {
121122
// FOV patch
122123
_pShell->DeclareSymbol("user INDEX sam_bUseVerticalFOV post:CECIL_RegisterCommand;", &sam_bUseVerticalFOV);
123124
_pShell->DeclareSymbol("user FLOAT sam_fCustomFOV post:CECIL_RegisterCommand;", &sam_fCustomFOV);
125+
_pShell->DeclareSymbol("user INDEX sam_bCheckFOV;", &sam_bCheckFOV);
124126

125127
// Red screen on damage
126128
_pShell->DeclareSymbol("user INDEX sam_bRedScreenOnDamage post:CECIL_RegisterCommand;", &sam_bRedScreenOnDamage);

Cecil/CecilExtensions.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ extern INDEX sam_bBackgroundGameRender;
1919
// FOV patch
2020
extern INDEX sam_bUseVerticalFOV;
2121
extern FLOAT sam_fCustomFOV;
22+
extern INDEX sam_bCheckFOV;
2223

2324
// Red screen on damage
2425
extern INDEX sam_bRedScreenOnDamage;

Cecil/FOVPatch.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ static void P_RenderView(CWorld &woWorld, CEntity &enViewer, CAnyProjection3D &p
3030

3131
FLOAT &fNewFOV = ppr.ppr_FOVWidth;
3232

33+
// Display projection FOV
34+
if (sam_bCheckFOV) CPrintF("View: %.2f\n", fNewFOV);
35+
3336
// Set custom FOV
3437
if (sam_fCustomFOV > 0.0f) {
3538
fNewFOV = sam_fCustomFOV;
@@ -38,13 +41,21 @@ static void P_RenderView(CWorld &woWorld, CEntity &enViewer, CAnyProjection3D &p
3841
// Don't let FOV be invalid
3942
fNewFOV = Clamp(fNewFOV, 60.0f, 110.0f);
4043

44+
// Display desired vertical FOV
45+
if (sam_bCheckFOV) CPrintF("VFOV: %.2f\n", fNewFOV);
46+
4147
// Adjust FOV for wider resolutions (preserve vertical FOV instead of horizontal)
4248
if (sam_bUseVerticalFOV) {
4349
AdjustFOV(dpDrawport, fNewFOV);
4450

4551
// Don't let FOV be invalid
4652
fNewFOV = Clamp(fNewFOV, 1.0f, 170.0f);
4753
}
54+
55+
// Display patched horizontal FOV
56+
if (sam_bCheckFOV) CPrintF("HFOV: %.2f\n", fNewFOV);
57+
58+
sam_bCheckFOV = FALSE;
4859
}
4960

5061
// Proceed to the original function

0 commit comments

Comments
 (0)