Skip to content

Commit a515c82

Browse files
committed
Merge branch 'main' of github.com:gameplug-labs/gameplug into upscaler
2 parents d16e114 + 3b750b9 commit a515c82

9 files changed

Lines changed: 115 additions & 13 deletions

File tree

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ jobs:
7272
# The file is in bin/x32/d3d9/dinput8.dll
7373
zip -j assets/d3d9.zip bin/x32/d3d9/dinput8.dll
7474
75+
# d3d9_skyrim.zip (x32 only)
76+
# The file is in bin/x32/d3d9_skyrim/dinput8.dll
77+
zip -j assets/d3d9_skyrim.zip bin/x32/d3d9_skyrim/dinput8.dll
78+
7579
# d3d10.zip (x32 only)
7680
# The file is in bin/x32/d3d10/dinput8.dll
7781
zip -j assets/d3d10.zip bin/x32/d3d10/dinput8.dll

.github/workflows/test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ name: Test Build
33
on:
44
push:
55
branches: [ main, upscaler ]
6+
paths:
7+
- 'src/**'
68
pull_request:
79
branches: [ main, upscaler ]
10+
paths:
11+
- 'src/**'
812

913
concurrency:
1014
group: ${{ github.workflow }}-${{ github.ref }}

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## [Unreleased]
99

1010

11+
## [1.0.1] - 2026-05-28
12+
13+
### Fixed
14+
- Fix UI not interactable on some games.
15+
16+
1117
## [1.0.0] - 2026-05-26
1218

1319
### Added

GAMES_COMPATIBILITY_LIST.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
| Resident Evil 4 | d3d12 | dinput8.dll |
99
| Resident Evil 5 | d3d9 | dinput8.dll |
1010
| Resident Evil 6 | d3d9, vulkan | dinput8.dll |
11+
| Resident Evil Revelations | d3d9 | dinput8.dll |
1112
| Resident Evil Revelations 2 | d3d9 | dinput8.dll |
1213
| The Elder Scrolls V: Skyrim - Legendary Edition | d3d9 | dinput8.dll |
1314
| The Elder Scrolls V: Skyrim Anniversary | d3d11 | dinput8.dll |

src/d3d10/overlay.cpp

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,6 @@ void OnDXPresent(IDXGISwapChain* pSwapChain) {
173173
}
174174
g_ShowKeyWasPressed = keyCurrentlyPressed;
175175

176-
if (!g_Visible)
177-
return;
178-
179176
g_needsNewImGuiFrame = true;
180177
g_totalPresentCalls++;
181178

@@ -277,11 +274,39 @@ void OnDXPresent(IDXGISwapChain* pSwapChain) {
277274
if (shouldLog)
278275
Logger::info("DX10 Frame " + std::to_string(frameCount10));
279276

277+
ImGuiIO& io = ImGui::GetIO();
278+
280279
ImGui_ImplDX10_NewFrame();
281280
ImGui_ImplWin32_NewFrame();
281+
io.DisplaySize = ImVec2((float)desc.BufferDesc.Width, (float)desc.BufferDesc.Height);
282+
283+
if (g_Visible && g_currentHWND) {
284+
POINT cursorPos;
285+
if (GetCursorPos(&cursorPos)) {
286+
ScreenToClient(g_currentHWND, &cursorPos);
287+
io.AddMousePosEvent((float)cursorPos.x, (float)cursorPos.y);
288+
}
289+
// Poll button state and feed it through the event queue
290+
io.AddMouseButtonEvent(0, (GetAsyncKeyState(VK_LBUTTON) & 0x8000) != 0);
291+
io.AddMouseButtonEvent(1, (GetAsyncKeyState(VK_RBUTTON) & 0x8000) != 0);
292+
io.AddMouseButtonEvent(2, (GetAsyncKeyState(VK_MBUTTON) & 0x8000) != 0);
293+
// Draw ImGui's own cursor on top – mirrors Community Shaders behaviour.
294+
// The game cursor can be hidden in certain states (in-game, menus with
295+
// hardware cursor hidden), so ImGui's software cursor is more reliable.
296+
io.MouseDrawCursor = true;
297+
} else {
298+
io.MouseDrawCursor = false;
299+
}
300+
301+
if (!g_Visible) {
302+
io.ClearInputKeys();
303+
}
304+
282305
ImGui::NewFrame();
283306

284-
ImGuiOverlayShared::DrawUI(desc.BufferDesc.Width, desc.BufferDesc.Height);
307+
if (g_Visible) {
308+
ImGuiOverlayShared::DrawUI(desc.BufferDesc.Width, desc.BufferDesc.Height);
309+
}
285310

286311
ImGui::Render();
287312

src/d3d11/overlay.cpp

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,13 +287,31 @@ void OnDXPresent(IDXGISwapChain* pSwapChain) {
287287
bool shouldLog = (frameCount11 < 5);
288288
if (shouldLog)
289289
Logger::info("DX11 Frame " + std::to_string(frameCount11));
290-
290+
291291
ImGuiIO& io = ImGui::GetIO();
292292

293293
ImGui_ImplDX11_NewFrame();
294294
ImGui_ImplWin32_NewFrame();
295295
io.DisplaySize = ImVec2((float)desc.BufferDesc.Width, (float)desc.BufferDesc.Height);
296296

297+
if (g_Visible && g_currentHWND) {
298+
POINT cursorPos;
299+
if (GetCursorPos(&cursorPos)) {
300+
ScreenToClient(g_currentHWND, &cursorPos);
301+
io.AddMousePosEvent((float)cursorPos.x, (float)cursorPos.y);
302+
}
303+
// Poll button state and feed it through the event queue
304+
io.AddMouseButtonEvent(0, (GetAsyncKeyState(VK_LBUTTON) & 0x8000) != 0);
305+
io.AddMouseButtonEvent(1, (GetAsyncKeyState(VK_RBUTTON) & 0x8000) != 0);
306+
io.AddMouseButtonEvent(2, (GetAsyncKeyState(VK_MBUTTON) & 0x8000) != 0);
307+
// Draw ImGui's own cursor on top – mirrors Community Shaders behaviour.
308+
// The game cursor can be hidden in certain states (in-game, menus with
309+
// hardware cursor hidden), so ImGui's software cursor is more reliable.
310+
io.MouseDrawCursor = true;
311+
} else {
312+
io.MouseDrawCursor = false;
313+
}
314+
297315
// io.MouseDrawCursor = g_Visible;
298316
if (!g_Visible) {
299317
io.ClearInputKeys();

src/d3d12/overlay.cpp

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -478,9 +478,6 @@ void OnDXPresent(IDXGISwapChain* pSwapChain) {
478478
}
479479
g_ShowKeyWasPressed = keyCurrentlyPressed;
480480

481-
if (!g_Visible)
482-
return;
483-
484481
g_needsNewImGuiFrame = true;
485482
g_totalPresentCalls++;
486483

@@ -682,11 +679,39 @@ void OnDXPresent(IDXGISwapChain* pSwapChain) {
682679

683680
// UI Logic
684681
if (g_needsNewImGuiFrame) {
682+
ImGuiIO& io = ImGui::GetIO();
683+
685684
ImGui_ImplDX12_NewFrame();
686685
ImGui_ImplWin32_NewFrame();
686+
io.DisplaySize = ImVec2((float)width, (float)height);
687+
688+
if (g_Visible && g_currentHWND) {
689+
POINT cursorPos;
690+
if (GetCursorPos(&cursorPos)) {
691+
ScreenToClient(g_currentHWND, &cursorPos);
692+
io.AddMousePosEvent((float)cursorPos.x, (float)cursorPos.y);
693+
}
694+
// Poll button state and feed it through the event queue
695+
io.AddMouseButtonEvent(0, (GetAsyncKeyState(VK_LBUTTON) & 0x8000) != 0);
696+
io.AddMouseButtonEvent(1, (GetAsyncKeyState(VK_RBUTTON) & 0x8000) != 0);
697+
io.AddMouseButtonEvent(2, (GetAsyncKeyState(VK_MBUTTON) & 0x8000) != 0);
698+
// Draw ImGui's own cursor on top – mirrors Community Shaders behaviour.
699+
// The game cursor can be hidden in certain states (in-game, menus with
700+
// hardware cursor hidden), so ImGui's software cursor is more reliable.
701+
io.MouseDrawCursor = true;
702+
} else {
703+
io.MouseDrawCursor = false;
704+
}
705+
706+
if (!g_Visible) {
707+
io.ClearInputKeys();
708+
}
709+
687710
ImGui::NewFrame();
688711

689-
ImGuiOverlayShared::DrawUI(width, height);
712+
if (g_Visible) {
713+
ImGuiOverlayShared::DrawUI(width, height);
714+
}
690715
ImGui::Render();
691716
g_needsNewImGuiFrame = false;
692717
}

src/d3d9/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,3 @@ if(BIN_OUTPUT_DIR)
9898
COMMENT "Copying Skyrim D3D9 proxy to d3d9_skyrim/dinput8.dll"
9999
)
100100
endif()
101-

src/vk/overlay.cpp

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,6 @@ void OverlayRenderer::NewFrame() {
328328
}
329329
m_showKeyWasPressed = keyCurrentlyPressed;
330330

331-
if (!m_visible)
332-
return;
333-
334331
auto currentTime = std::chrono::steady_clock::now();
335332
float deltaTime = std::chrono::duration<float, std::ratio<1, 1>>(currentTime - m_lastTime).count();
336333
m_lastTime = currentTime;
@@ -341,6 +338,29 @@ void OverlayRenderer::NewFrame() {
341338

342339
ImGui_ImplVulkan_NewFrame();
343340
ImGui_ImplWin32_NewFrame();
341+
342+
if (m_visible && m_hWnd) {
343+
POINT cursorPos;
344+
if (GetCursorPos(&cursorPos)) {
345+
ScreenToClient(m_hWnd, &cursorPos);
346+
io.AddMousePosEvent((float)cursorPos.x, (float)cursorPos.y);
347+
}
348+
// Poll button state and feed it through the event queue
349+
io.AddMouseButtonEvent(0, (GetAsyncKeyState(VK_LBUTTON) & 0x8000) != 0);
350+
io.AddMouseButtonEvent(1, (GetAsyncKeyState(VK_RBUTTON) & 0x8000) != 0);
351+
io.AddMouseButtonEvent(2, (GetAsyncKeyState(VK_MBUTTON) & 0x8000) != 0);
352+
// Draw ImGui's own cursor on top – mirrors Community Shaders behaviour.
353+
// The game cursor can be hidden in certain states (in-game, menus with
354+
// hardware cursor hidden), so ImGui's software cursor is more reliable.
355+
io.MouseDrawCursor = true;
356+
} else {
357+
io.MouseDrawCursor = false;
358+
}
359+
360+
if (!m_visible) {
361+
io.ClearInputKeys();
362+
}
363+
344364
ImGui::NewFrame();
345365
}
346366

0 commit comments

Comments
 (0)