Skip to content

Commit dafdad1

Browse files
committed
disable water flicker test for extra night shadows
1 parent cbef04b commit dafdad1

File tree

1 file changed

+47
-45
lines changed

1 file changed

+47
-45
lines changed

source/fixes.ixx

Lines changed: 47 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -950,43 +950,43 @@ public:
950950
}
951951
}
952952

953-
// Water flicker mitigation
953+
// Water flicker mitigation experiment
954954
{
955-
auto pattern = find_pattern("83 EC ? F3 0F 10 4D ? F3 0F 10 05 ? ? ? ? 0F 2F C1 F3 0F 10 55 ? F3 0F 10 5D ? F3 0F 11 54 24 ? F3 0F 11 5C 24 ? F3 0F 11 4C 24 ? 72 ? 6A ? 83 EC ? F3 0F 11 5C 24 ? F3 0F 11 14 24 E8 ? ? ? ? D9 5C 24 ? 83 C4 ? 8B 45", "83 EC ? F3 0F 10 45 ? F3 0F 10 0D ? ? ? ? F3 0F 11 44 24 ? F3 0F 10 45 ? F3 0F 11 44 24 ? F3 0F 10 45 ? 0F 2F C8 F3 0F 11 44 24 ? 72 ? D9 45 ? 6A ? 83 EC ? D9 5C 24 ? D9 45 ? D9 1C 24 E8 ? ? ? ? D9 5C 24 ? 83 C4 ? D9 EE");
956-
GET_NTH_CLOSEST_WATER_NODE_WITH_HEADING = (decltype(GET_NTH_CLOSEST_WATER_NODE_WITH_HEADING))pattern.get_first(-6);
957-
958-
pattern = find_pattern("E8 ? ? ? ? 85 C0 0F 84 ? ? ? ? 80 7D ? ? C6 44 24 ? ? 74 ? FF 77", "E8 ? ? ? ? 85 C0 0F 84 ? ? ? ? 80 7D ? ? C6 44 24 ? ? 74 ? 8B 4E");
959-
hbIsSphereVisible.fun = injector::MakeCALL(pattern.get_first(0), AddLightIsSphereVisible, true).get();
960-
961-
pattern = find_pattern("E8 ? ? ? ? 85 C0 0F 84 ? ? ? ? 8B 4C 24 ? 3B F9", "E8 ? ? ? ? 85 C0 0F 84 ? ? ? ? 3B F7");
962-
hbIsSphereVisible.fun = injector::MakeCALL(pattern.get_first(0), DrawWaterIsSphereVisible, true).get();
963-
964-
pattern = find_pattern("E8 ? ? ? ? 8B D0 8B B4 BA", "E8 ? ? ? ? 8B BC B0 ? ? ? ? 8B 94 B0");
965-
static auto RenderWaterHook = safetyhook::create_mid(pattern.get_first(0), [](SafetyHookContext& regs)
966-
{
967-
bAnyVisibleNearbyWaterOnScreen = false;
968-
WaterQuadsCount = 0;
969-
});
970-
971-
pattern = find_pattern("0F B7 0C 72 C1 E1 ? 0F BF 81", "0F B7 04 78 C1 E0 04 0F BF 88 ? ? ? ? 8B 14 CD ? ? ? ? 0F BF 88 ? ? ? ? 03 C9");
972-
static auto RenderWaterCounterHook = safetyhook::create_mid(pattern.get_first(0), [](SafetyHookContext& regs)
973-
{
974-
WaterQuadsCount++;
975-
});
976-
977-
//pattern = find_pattern("F3 0F 11 44 24 ? FF 74 24 ? F3 0F 11 44 24", "F3 0F 11 44 24 ? 8B 54 24 ? 52 F3 0F 11 44 24");
978-
//static auto RenderWaterCounterHook2 = safetyhook::create_mid(pattern.get_first(0), [](SafetyHookContext& regs)
955+
//auto pattern = find_pattern("83 EC ? F3 0F 10 4D ? F3 0F 10 05 ? ? ? ? 0F 2F C1 F3 0F 10 55 ? F3 0F 10 5D ? F3 0F 11 54 24 ? F3 0F 11 5C 24 ? F3 0F 11 4C 24 ? 72 ? 6A ? 83 EC ? F3 0F 11 5C 24 ? F3 0F 11 14 24 E8 ? ? ? ? D9 5C 24 ? 83 C4 ? 8B 45", "83 EC ? F3 0F 10 45 ? F3 0F 10 0D ? ? ? ? F3 0F 11 44 24 ? F3 0F 10 45 ? F3 0F 11 44 24 ? F3 0F 10 45 ? 0F 2F C8 F3 0F 11 44 24 ? 72 ? D9 45 ? 6A ? 83 EC ? D9 5C 24 ? D9 45 ? D9 1C 24 E8 ? ? ? ? D9 5C 24 ? 83 C4 ? D9 EE");
956+
//GET_NTH_CLOSEST_WATER_NODE_WITH_HEADING = (decltype(GET_NTH_CLOSEST_WATER_NODE_WITH_HEADING))pattern.get_first(-6);
957+
//
958+
//pattern = find_pattern("E8 ? ? ? ? 85 C0 0F 84 ? ? ? ? 80 7D ? ? C6 44 24 ? ? 74 ? FF 77", "E8 ? ? ? ? 85 C0 0F 84 ? ? ? ? 80 7D ? ? C6 44 24 ? ? 74 ? 8B 4E");
959+
//hbIsSphereVisible.fun = injector::MakeCALL(pattern.get_first(0), AddLightIsSphereVisible, true).get();
960+
//
961+
//pattern = find_pattern("E8 ? ? ? ? 85 C0 0F 84 ? ? ? ? 8B 4C 24 ? 3B F9", "E8 ? ? ? ? 85 C0 0F 84 ? ? ? ? 3B F7");
962+
//hbIsSphereVisible.fun = injector::MakeCALL(pattern.get_first(0), DrawWaterIsSphereVisible, true).get();
963+
//
964+
//pattern = find_pattern("E8 ? ? ? ? 8B D0 8B B4 BA", "E8 ? ? ? ? 8B BC B0 ? ? ? ? 8B 94 B0");
965+
//static auto RenderWaterHook = safetyhook::create_mid(pattern.get_first(0), [](SafetyHookContext& regs)
966+
//{
967+
// bAnyVisibleNearbyWaterOnScreen = false;
968+
// WaterQuadsCount = 0;
969+
//});
970+
//
971+
//pattern = find_pattern("0F B7 0C 72 C1 E1 ? 0F BF 81", "0F B7 04 78 C1 E0 04 0F BF 88 ? ? ? ? 8B 14 CD ? ? ? ? 0F BF 88 ? ? ? ? 03 C9");
972+
//static auto RenderWaterCounterHook = safetyhook::create_mid(pattern.get_first(0), [](SafetyHookContext& regs)
979973
//{
980974
// WaterQuadsCount++;
981975
//});
976+
//
977+
////pattern = find_pattern("F3 0F 11 44 24 ? FF 74 24 ? F3 0F 11 44 24", "F3 0F 11 44 24 ? 8B 54 24 ? 52 F3 0F 11 44 24");
978+
////static auto RenderWaterCounterHook2 = safetyhook::create_mid(pattern.get_first(0), [](SafetyHookContext& regs)
979+
////{
980+
//// WaterQuadsCount++;
981+
////});
982+
//
983+
//pattern = find_pattern("8B 35 ? ? ? ? F3 0F 11 44 24 ? F3 0F 10 80", "8B 1D ? ? ? ? F3 0F 10 83");
984+
//static auto RenderLightsHook = safetyhook::create_mid(pattern.get_first(0), [](SafetyHookContext& regs)
985+
//{
986+
// bAnyVisibleNearbyLightOnScreen = false;
987+
//});
982988

983-
pattern = find_pattern("8B 35 ? ? ? ? F3 0F 11 44 24 ? F3 0F 10 80", "8B 1D ? ? ? ? F3 0F 10 83");
984-
static auto RenderLightsHook = safetyhook::create_mid(pattern.get_first(0), [](SafetyHookContext& regs)
985-
{
986-
bAnyVisibleNearbyLightOnScreen = false;
987-
});
988-
989-
pattern = hook::pattern("A8 ? 0F 84 ? ? ? ? 8B C8");
989+
auto pattern = hook::pattern("A8 ? 0F 84 ? ? ? ? 8B C8");
990990
static auto loc_927DE0 = resolve_next_displacement(pattern.get_first(0)).value();
991991
injector::MakeNOP(pattern.get_first(2), 6);
992992
static auto LightCounterHook = safetyhook::create_mid(pattern.get_first(0), [](SafetyHookContext& regs)
@@ -996,19 +996,21 @@ public:
996996
{
997997
if ((regs.eax & 6) != 0)
998998
{
999-
if (Natives::IsInteriorScene())
1000-
{
1001-
return; // Flicker - Always in interiors
1002-
}
1003-
1004-
if (!bAnyVisibleNearbyWaterOnScreen)
1005-
{
1006-
return; // Flicker - No water on screen
1007-
}
1008-
else if (bAnyVisibleNearbyLightOnScreen)
1009-
{
1010-
return; // Flicker - Water and lights
1011-
}
999+
return;
1000+
1001+
//if (Natives::IsInteriorScene())
1002+
//{
1003+
// return; // Flicker - Always in interiors
1004+
//}
1005+
//
1006+
//if (!bAnyVisibleNearbyWaterOnScreen)
1007+
//{
1008+
// return; // Flicker - No water on screen
1009+
//}
1010+
//else if (bAnyVisibleNearbyLightOnScreen)
1011+
//{
1012+
// return; // Flicker - Water and lights
1013+
//}
10121014
}
10131015
}
10141016
else

0 commit comments

Comments
 (0)