mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-20 05:16:01 +00:00
fix: turn off D3DGear's capture hook when it sits beside a game (#1627)
The Crew 2 loads D3DGear64.dll from its folder. Its DXGI Present hook faults over a thousand times within seconds under Wine and the game never presents again: black screen while the sound keeps playing. droiddeck-game-env now disables the DLL when it finds it beside the game, and DLL overrides from several engine fixes are kept together instead of the last one replacing the others.
This commit is contained in:
1 parent
a0a68f7280
commit
830c753312
2 files changed
+34
-1
No files matched your search
@@ -107,6 +107,15 @@ def godot_sentry(game):
|
||||
return {"WINEDLLOVERRIDES": ";".join(n + "=d" for n in sentry)}, [], "Godot: Sentry crash handler off"
|
||||
|
||||
|
||||
@fix
|
||||
def d3dgear_hook(game):
|
||||
"""D3DGear's capture DLL left beside a game (The Crew 2) is loaded by it and hooks the DXGI swapchain;
|
||||
under Wine the hook faults over a thousand times within seconds and the game never presents again:
|
||||
black screen while the sound keeps playing."""
|
||||
if "d3dgear64.dll" in game.files:
|
||||
return {"WINEDLLOVERRIDES": "d3dgear64=d"}, [], "D3DGear capture hook off (it stops the game drawing)"
|
||||
|
||||
|
||||
@fix
|
||||
def deep_rock_gdk_raytracing(game):
|
||||
if game.stem == "fsd-wingdk-shipping" and not any(game.has_arg(arg) for arg in ("-raytracing", "-noraytracing")):
|
||||
@@ -254,7 +263,10 @@ def engine_fixes(exe, args):
|
||||
for check in FIXES:
|
||||
found = check(game)
|
||||
if found:
|
||||
env.update(found[0])
|
||||
for name, value in found[0].items():
|
||||
if name == "WINEDLLOVERRIDES" and env.get(name):
|
||||
value = env[name] + ";" + value
|
||||
env[name] = value
|
||||
extra += found[1]
|
||||
notes.append(found[2])
|
||||
return env, extra, notes
|
||||
|
||||
@@ -402,6 +402,27 @@ class GameEnvironmentTest(unittest.TestCase):
|
||||
(asylum / name).touch()
|
||||
self.assertEqual(MODULE["engine_fixes"](str(asylum / "BmLauncher.exe"), []), ({}, [], []))
|
||||
|
||||
def test_d3dgear_capture_hook_beside_the_game_is_turned_off(self):
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
game = Path(tmp) / "The Crew 2"
|
||||
game.mkdir()
|
||||
for name in ("TheCrew2.exe", "TheCrew2_BE.exe", "d3dgear64.dll"):
|
||||
(game / name).touch()
|
||||
env, extra, notes = MODULE["engine_fixes"](str(game / "TheCrew2.exe"), [])
|
||||
self.assertEqual((env, extra), ({"WINEDLLOVERRIDES": "d3dgear64=d"}, []))
|
||||
self.assertTrue(notes)
|
||||
(game / "d3dgear64.dll").rename(game / "D3DGear64.DLL")
|
||||
self.assertEqual(MODULE["engine_fixes"](str(game / "TheCrew2.exe"), [])[0], {"WINEDLLOVERRIDES": "d3dgear64=d"})
|
||||
(game / "D3DGear64.DLL").unlink()
|
||||
self.assertEqual(MODULE["engine_fixes"](str(game / "TheCrew2.exe"), []), ({}, [], []))
|
||||
|
||||
def test_dll_overrides_from_several_fixes_are_all_kept(self):
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
for name in ("Game.exe", "Game.pck", "GodotSharp.dll", "libsentry.windows.release.x86_64.dll", "d3dgear64.dll"):
|
||||
(Path(tmp) / name).touch()
|
||||
env = MODULE["engine_fixes"](str(Path(tmp) / "Game.exe"), [])[0]
|
||||
self.assertEqual(env["WINEDLLOVERRIDES"], "libsentry.windows.release.x86_64=d;d3dgear64=d")
|
||||
|
||||
def test_black_ops_iii_and_dark_souls_remastered_skip_protonfixes(self):
|
||||
for exe in ("/game/Call of Duty Black Ops III/BlackOps3.exe", "/game/DARK SOULS REMASTERED/DarkSoulsRemastered.exe"):
|
||||
env, extra, notes = MODULE["engine_fixes"](exe, [])
|
||||
|
||||
Reference in new issue
Block a user