From 0dda920448fc40eda5cb5e3ba9d203a9c9392da9 Mon Sep 17 00:00:00 2001 From: bicarus-dev <202771338+bicarus-dev@users.noreply.github.com> Date: Sun, 21 Sep 2025 00:20:41 -0700 Subject: [PATCH] iidx, sdvx: show error text when subscreen fails to render (#378) ## Link to GitHub Issue, if one exists #345 ## Description of change For IIDX / SDVX, when the subscreen surface failed to capture, display an error message, suggesting the user to patch the game as needed. Prior to this change, the subscreen overlay just showed an invisible window if this happened. ## Testing Tested IIDX windowed / full screen, and voltex full screen. --- src/spice2x/overlay/windows/generic_sub.cpp | 20 ++++++++++++++++++++ src/spice2x/overlay/windows/iidx_sub.cpp | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/spice2x/overlay/windows/generic_sub.cpp b/src/spice2x/overlay/windows/generic_sub.cpp index a65b980..b148cc0 100644 --- a/src/spice2x/overlay/windows/generic_sub.cpp +++ b/src/spice2x/overlay/windows/generic_sub.cpp @@ -4,6 +4,7 @@ #include +#include "avs/game.h" #include "games/io.h" #include "cfg/screen_resize.h" #include "hooks/graphics/backends/d3d9/d3d9_backend.h" @@ -88,13 +89,32 @@ namespace overlay::windows { void GenericSubScreen::touch_transform(const ImVec2 xy_in, LONG *x_out, LONG *y_out) {} void GenericSubScreen::build_content() { + this->flags |= ImGuiWindowFlags_NoBackground; + if (this->disabled_message.has_value()) { this->flags &= ~ImGuiWindowFlags_NoBackground; ImGui::TextColored(YELLOW, "%s", this->disabled_message.value().c_str()); return; } + this->draw_texture(); + if (!this->texture) { + this->flags &= ~ImGuiWindowFlags_NoBackground; + ImGui::TextColored(YELLOW, "Failed to acquire surface texture for subscreen."); + if (avs::game::is_model("LDJ")) { + ImGui::TextColored( + YELLOW, + "Ensure that you are using the correct DLL type, \n" + "or patch the DLL to properly enable TDJ mode."); + } else if (avs::game::is_model("KFC")) { + ImGui::TextColored( + YELLOW, + "Ensure that you did not accidentally enable a patch \n" + "that turns off subscreen rendering."); + } + } + #if OVERLAYDBG if (this->status_message.has_value()) { log_warning("sub::overlay", "{}", this->status_message.value().c_str()); diff --git a/src/spice2x/overlay/windows/iidx_sub.cpp b/src/spice2x/overlay/windows/iidx_sub.cpp index afbbc49..e9bb887 100644 --- a/src/spice2x/overlay/windows/iidx_sub.cpp +++ b/src/spice2x/overlay/windows/iidx_sub.cpp @@ -14,7 +14,7 @@ namespace overlay::windows { if (GRAPHICS_IIDX_WSUB) { this->disabled_message = "Close this overlay and use the second window.\n" - "Or, turn on -iidxnosub to use the overlay instead."; + "If you don't see the window, double check your DLL type and apply TDJ I/O patches as needed."; this->draws_window = false; }