AMFP Enhanced
C++ reference: the code this unofficial fork added
Loading...
Searching...
No Matches
LuxPresets.h
Go to the documentation of this file.
1/*
2 * AMFP-2026: Original / Modern presets for the 2026 options tab. Pure data, unit tested in
3 * tests/cpp/test_presets.cpp. The preset box only reflects the current values: picking a preset
4 * fills them in, changing any one of them afterwards shows Custom.
5 */
6#ifndef LUX_PRESETS_H
7#define LUX_PRESETS_H
8
9#include <cmath>
10#include "LuxComfort.h"
11#include "LuxGuidance.h"
12#include "LuxAutoSave.h"
13
15{
20};
21
22// HUD text size (hints, control prompts, objective line); subtitles keep their own size.
24
25inline float LuxHudTextScale(int alSize)
26{
27 static const float vScale[eLuxHudText_LastEnum] = { 1.0f, 1.2f, 1.4f };
28 return alSize >= 0 && alSize < eLuxHudText_LastEnum ? vScale[alSize] : 1.0f;
29}
30
31// New players start on Modern (user decision).
33
34/** Modern's fog thickness: the cellar keeps 75 % of its brightness, the haze is gone. */
35static const float kLuxModernFogAmount = 0.35f;
36
38{
46 bool mbJournalToast; // brief new hint / note rows
47 bool mbPadLookAccel; // gamepad look acceleration
48 int mlGuidance; // eLuxGuidance: objective line, stuck nudge, clue words
49 int mlAutoSave; // eLuxAutoSave: extra autosaves (map change, timed)
50 bool mbQuickTransitions; // shorter map-change fades, any key continues after a load
51 int mlHudTextSize; // eLuxHudText
52 int mlComfort; // eLuxComfortProfile (Custom never matches a preset)
58 float mfFogAmount; // global fog opacity, 1 = as the map has it (cWorld::SetFogAmount)
59 float mfFogColor; // fog tint kept, 0 = neutral grey of the same brightness
60};
61
63{
65 bool bModern = alPreset == eLuxPreset_Modern;
66 // Fixes and comfort: all on for Modern, stock for Original.
67 v.mbFixGuiAspect = bModern;
68 v.mbFixMouseScale = bModern;
69 v.mbReadableLoadingText = bModern;
70 v.mbSmoothShadows = bModern;
71 v.mbHDShadows = bModern;
72 v.mbControlsHud = bModern;
73 v.mbSmoothMouse = !bModern; // stock smoothing lags the camera
74 v.mbJournalToast = bModern;
75 v.mbPadLookAccel = bModern;
78 v.mbQuickTransitions = bModern;
80 v.mlComfort = bModern ? eLuxComfort_Comfort : eLuxComfort_Original; // Comfort is the default (user decision)
81 // Graphics: stock defaults (LuxConfigHandler fallbacks) vs. the 2026 batch.
82 v.mlTextureFilter = bModern ? 2 : 1; // trilinear : bilinear
83 v.mfAnisotropy = bModern ? 16.0f : 1.0f;
84 v.mlShadowQuality = bModern ? 2 : 1; // high : medium
85 v.mlParallaxQuality = bModern ? 1 : 0; // relief : simple
86 v.mlSSAOSamples = bModern ? 16 : 8;
87 v.mfFogAmount = bModern ? kLuxModernFogAmount : 1.0f; // Modern: the blue haze thinned and neutral
88 v.mfFogColor = bModern ? 0.0f : 1.0f;
89 return v;
90}
91
92inline bool LuxPresetMatches(const cLuxPresetValues& a, const cLuxPresetValues& p, float afMaxAnisotropy)
93{
94 float fWantAniso = p.mfAnisotropy < afMaxAnisotropy ? p.mfAnisotropy : afMaxAnisotropy;
103 && a.mfAnisotropy == fWantAniso && a.mlShadowQuality == p.mlShadowQuality
105 && std::fabs(a.mfFogAmount - p.mfFogAmount) < 0.01f && std::fabs(a.mfFogColor - p.mfFogColor) < 0.01f;
106}
107
108/** afMaxAnisotropy: the highest anisotropy this GPU offers (Modern asks for 16x). */
109inline int LuxDetectPreset(const cLuxPresetValues& aV, float afMaxAnisotropy = 16.0f)
110{
113 return eLuxPreset_Custom;
114}
115
116#endif
autosave and manual saves (Enhanced option "Autosave").
@ eLuxAutoSave_Off
Definition LuxAutoSave.h:22
@ eLuxAutoSave_Every10
Definition LuxAutoSave.h:25
the comfort pass (PLAN.md "Comfort pass").
@ eLuxComfort_Comfort
Definition LuxComfort.h:20
@ eLuxComfort_Original
Definition LuxComfort.h:18
gentle guidance, one Enhanced option with four levels (Modern = Normal): Off nothing extra (the origi...
@ eLuxGuidance_Normal
Definition LuxGuidance.h:22
@ eLuxGuidance_Off
Definition LuxGuidance.h:20
int LuxDetectPreset(const cLuxPresetValues &aV, float afMaxAnisotropy=16.0f)
afMaxAnisotropy: the highest anisotropy this GPU offers (Modern asks for 16x).
Definition LuxPresets.h:109
float LuxHudTextScale(int alSize)
Definition LuxPresets.h:25
bool LuxPresetMatches(const cLuxPresetValues &a, const cLuxPresetValues &p, float afMaxAnisotropy)
Definition LuxPresets.h:92
static const float kLuxModernFogAmount
Modern's fog thickness: the cellar keeps 75 % of its brightness, the haze is gone.
Definition LuxPresets.h:35
static const int kLuxDefaultPreset
Definition LuxPresets.h:32
eLuxHudText
Definition LuxPresets.h:23
@ eLuxHudText_Normal
Definition LuxPresets.h:23
@ eLuxHudText_LastEnum
Definition LuxPresets.h:23
@ eLuxHudText_Large
Definition LuxPresets.h:23
@ eLuxHudText_Larger
Definition LuxPresets.h:23
eLuxPreset
Definition LuxPresets.h:15
@ eLuxPreset_Custom
Definition LuxPresets.h:18
@ eLuxPreset_Modern
Definition LuxPresets.h:17
@ eLuxPreset_Original
Definition LuxPresets.h:16
@ eLuxPreset_LastEnum
Definition LuxPresets.h:19
cLuxPresetValues LuxPresetValues(int alPreset)
Definition LuxPresets.h:62
bool mbReadableLoadingText
Definition LuxPresets.h:41
bool mbQuickTransitions
Definition LuxPresets.h:50