Skip to content

Commit 06443bb

Browse files
committed
SkipQuickSort: re-enable, fix param order in ProtectLoginData
1 parent 57034d1 commit 06443bb

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/hooks_drawdistance.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,10 +340,15 @@ bool DrawDist_ReadExclusions()
340340
return true;
341341
}
342342

343-
/*
344343

345344
class SkipQuickSortHack : public Hook
346345
{
346+
// Before drawing transparent objects the game uses QuickSort on them, which seems to sort them based on Z order
347+
// For some reason on Palm Beach the order ends up incorrect, and some kind of reflection texture draws on top of the ocean texture, causing a black area to appear until getting close enough
348+
// If we skip the QuickSort call on this track that seems to fix it though, hadn't seen any other issues with transparent objects after it
349+
// Not sure if all tracks would work fine with this though, so this tweak only disables it on certain tracks setup in .lods.ini
350+
// (also not sure why console ports seem to be fine here, could it be related to games D3D9 depth buffer issue, or could be an issue with the model data itself?)
351+
347352
inline static SafetyHookInline DrawStoredModel_Execute_hook = {};
348353
static void DrawStoredModel_Execute_dest()
349354
{
@@ -380,7 +385,6 @@ class SkipQuickSortHack : public Hook
380385
static SkipQuickSortHack instance;
381386
};
382387
SkipQuickSortHack SkipQuickSortHack::instance;
383-
*/
384388

385389
class DrawDistanceIncrease : public Hook
386390
{

src/hooks_misc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class ProtectLoginData : public Hook
109109
}
110110
catch (const std::exception& e)
111111
{
112-
spdlog::error("ProtectLoginData: failed to encrypt login data to {} ({}), login details will be scrubbed from common.dat", e.what(), LoginDataFilename);
112+
spdlog::error("ProtectLoginData: failed to encrypt login data to {} ({}), login details will be scrubbed from common.dat", LoginDataFilename, e.what());
113113
}
114114

115115
SecureZeroMemory(loginData, loginDataLength);
@@ -135,7 +135,7 @@ class ProtectLoginData : public Hook
135135
}
136136
catch (const std::exception& e)
137137
{
138-
spdlog::error("ProtectLoginData: failed to encrypt login data to {} ({}), login details will be scrubbed from common.dat", e.what(), LoginDataFilename);
138+
spdlog::error("ProtectLoginData: failed to encrypt login data to {} ({}), login details will be scrubbed from common.dat", LoginDataFilename, e.what());
139139
}
140140

141141
SecureZeroMemory(loginData, loginDataLength);

0 commit comments

Comments
 (0)