Skip to content

Commit b8df2d4

Browse files
authored
Merge branch 'master' into cancelDataChange
2 parents 5bd6eb8 + 20d36cd commit b8df2d4

File tree

149 files changed

+110114
-101697
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+110114
-101697
lines changed

Client/core/CClientVariables.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,16 @@ void CClientVariables::ValidateValues()
265265
ClampValue("voicevolume", 0.0f, 1.0f);
266266
ClampValue("mapalpha", 0, 255);
267267
ClampValue("mapimage", 0, 1);
268+
ClampValue("borderless_gamma_power", 0.5f, 2.0f);
269+
ClampValue("borderless_brightness_scale", 0.5f, 2.0f);
270+
ClampValue("borderless_contrast_scale", 0.5f, 2.0f);
271+
ClampValue("borderless_saturation_scale", 0.5f, 2.0f);
272+
ClampValue("borderless_gamma_enabled", false, true);
273+
ClampValue("borderless_brightness_enabled", false, true);
274+
ClampValue("borderless_contrast_enabled", false, true);
275+
ClampValue("borderless_saturation_enabled", false, true);
276+
ClampValue("borderless_apply_windowed", false, true);
277+
ClampValue("borderless_apply_fullscreen", false, true);
268278
}
269279

270280
void CClientVariables::LoadDefaults()
@@ -348,6 +358,24 @@ void CClientVariables::LoadDefaults()
348358
DEFAULT("display_fullscreen_style", 0); // 0-standard 1-borderless 2-borderless keep res 3-borderless stretch
349359
DEFAULT("display_windowed", 0); // 0-off 1-on
350360
DEFAULT("multimon_fullscreen_minimize", 1); // 0-off 1-on
361+
DEFAULT("borderless_gamma_power", 0.95f); // Gamma exponent applied to windowed gamma ramp (1.0 = unchanged)
362+
DEFAULT("borderless_brightness_scale", 1.03f); // Brightness multiplier for windowed gamma ramp (1.0 = unchanged)
363+
DEFAULT("borderless_contrast_scale", 1.0f); // Contrast multiplier for borderless presentation (1.0 = unchanged)
364+
DEFAULT("borderless_saturation_scale", 1.0f); // Saturation multiplier for borderless presentation (1.0 = unchanged)
365+
DEFAULT("borderless_enable_srgb", false); // Enable sRGB correction when running borderless
366+
DEFAULT("borderless_gamma_enabled", false); // Apply gamma adjustment while borderless tuning active
367+
DEFAULT("borderless_brightness_enabled", false); // Apply brightness adjustment while borderless tuning active
368+
DEFAULT("borderless_contrast_enabled", false); // Apply contrast adjustment while borderless tuning active
369+
DEFAULT("borderless_saturation_enabled", false); // Apply saturation adjustment while borderless tuning active
370+
DEFAULT("borderless_apply_windowed", false); // Apply display adjustments while windowed/borderless
371+
DEFAULT("borderless_apply_fullscreen", false); // Apply display adjustments while in exclusive fullscreen
372+
373+
if (Exists("borderless_enable_srgb"))
374+
{
375+
bool legacyEnable = false;
376+
Get("borderless_enable_srgb", legacyEnable);
377+
Set("borderless_apply_windowed", legacyEnable);
378+
}
351379
DEFAULT("vertical_aim_sensitivity", 0.0015f); // 0.0015f is GTA default setting
352380
DEFAULT("process_priority", 0); // 0-normal 1-above normal 2-high
353381
DEFAULT("process_dpi_aware", false); // Enable DPI awareness in core initialization

Client/core/CCore.cpp

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,11 @@ CCore::CCore()
146146
// Setup our hooks.
147147
ApplyHooks();
148148

149+
m_pModelCacheManager = nullptr;
150+
m_iDummyProgressValue = 0;
151+
m_DummyProgressTimerHandle = NULL;
152+
m_bDummyProgressUpdateAlways = false;
153+
149154
m_iUnminimizeFrameCounter = 0;
150155
m_bDidRecreateRenderTargets = false;
151156
m_fMinStreamingMemory = 0;
@@ -187,10 +192,27 @@ CCore::~CCore()
187192
// Remove input hook
188193
CMessageLoopHook::GetSingleton().RemoveHook();
189194

195+
if (m_bWindowsTimerEnabled)
196+
{
197+
KillTimer(GetHookedWindow(), IDT_TIMER1);
198+
m_bWindowsTimerEnabled = false;
199+
}
200+
201+
extern int ms_iDummyProgressTimerCounter;
202+
203+
if (m_DummyProgressTimerHandle != NULL)
204+
{
205+
DeleteTimerQueueTimer(NULL, m_DummyProgressTimerHandle, INVALID_HANDLE_VALUE);
206+
m_DummyProgressTimerHandle = NULL;
207+
ms_iDummyProgressTimerCounter = 0;
208+
}
209+
190210
// Delete the mod manager
191211
delete m_pModManager;
192212
SAFE_DELETE(m_pMessageBox);
193213

214+
SAFE_DELETE(m_pModelCacheManager);
215+
194216
// Destroy early subsystems
195217
m_bModulesLoaded = false;
196218
DestroyNetwork();
@@ -225,6 +247,8 @@ CCore::~CCore()
225247
DestroyGUI();
226248
DestroyXML();
227249

250+
SAFE_DELETE(g_pLocalization);
251+
228252
// Delete keybinds
229253
delete m_pKeyBinds;
230254

@@ -1072,6 +1096,16 @@ void CCore::CreateXML()
10721096
if (!m_pConfigFile)
10731097
{
10741098
assert(false);
1099+
1100+
if (m_pXML)
1101+
{
1102+
using PFNReleaseXMLInterface = void (*)();
1103+
if (auto pfnRelease = reinterpret_cast<PFNReleaseXMLInterface>(m_XMLModule.GetFunctionPointer("ReleaseXMLInterface")))
1104+
pfnRelease();
1105+
}
1106+
1107+
m_pXML = NULL;
1108+
m_XMLModule.UnloadModule();
10751109
return;
10761110
}
10771111

@@ -1123,10 +1157,14 @@ void CCore::DestroyXML()
11231157
{
11241158
SaveConfig(true);
11251159
delete m_pConfigFile;
1160+
m_pConfigFile = nullptr;
11261161
}
11271162

11281163
if (m_pXML)
11291164
{
1165+
using PFNReleaseXMLInterface = void (*)();
1166+
if (auto pfnRelease = reinterpret_cast<PFNReleaseXMLInterface>(m_XMLModule.GetFunctionPointer("ReleaseXMLInterface")))
1167+
pfnRelease();
11301168
m_pXML = NULL;
11311169
}
11321170

0 commit comments

Comments
 (0)