From d4a5297a97fded17b280cc68683924482b54b713 Mon Sep 17 00:00:00 2001 From: Adam Saudagar Date: Thu, 3 Feb 2022 05:51:03 +0530 Subject: [PATCH] create only one instance of d3dshot in fishy lifecycle --- fishy/engine/common/window_server.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fishy/engine/common/window_server.py b/fishy/engine/common/window_server.py index d4535f4..8b1e8fd 100644 --- a/fishy/engine/common/window_server.py +++ b/fishy/engine/common/window_server.py @@ -26,7 +26,7 @@ class WindowServer: windowOffset = None hwnd = None status = Status.STOPPED - d3: d3dshot.D3DShot = None + d3: d3dshot.D3DShot = d3dshot.create(capture_output="numpy") monitor_top_left = None @@ -47,9 +47,7 @@ def init(): WindowServer.windowOffset = math.floor(((rect[2] - rect[0]) - client_rect[2]) / 2) WindowServer.status = Status.RUNNING - d3 = d3dshot.create(capture_output="numpy") - d3.display = next((m for m in d3.displays if m.hmonitor == monitor_id), None) - WindowServer.d3 = d3 + WindowServer.d3.display = next((m for m in WindowServer.d3.displays if m.hmonitor == monitor_id), None) except pywintypes.error: logging.error("Game window not found")