Update to spice2x-26-02-17 (pre-apply)
> broken commit
This commit is contained in:
@@ -27,6 +27,12 @@ namespace overlay::windows {
|
||||
}
|
||||
|
||||
HWND ScreenResize::get_first_window() {
|
||||
// this is ideal
|
||||
if (GRAPHICS_HOOKED_WINDOW.has_value()) {
|
||||
return GRAPHICS_HOOKED_WINDOW.value();
|
||||
}
|
||||
// we typically do not want to check GRAPHICS_WINDOWS because it may include
|
||||
// system windows (e.g., CicMarshalWnd)
|
||||
if (GRAPHICS_WINDOWS.size() == 0) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -55,6 +61,7 @@ namespace overlay::windows {
|
||||
scene.offset_y = 0;
|
||||
scene.scale_x = 1.f;
|
||||
scene.scale_y = 1.f;
|
||||
scene.duplicate = cfg::ScreenDuplicateMode::None;
|
||||
}
|
||||
|
||||
cfg::SCREENRESIZE->enable_window_resize = false;
|
||||
@@ -94,6 +101,21 @@ namespace overlay::windows {
|
||||
}
|
||||
|
||||
void ScreenResize::build_fullscreen_config() {
|
||||
|
||||
if (avs::game::is_model("KFC")) {
|
||||
ImGui::TextColored(ImVec4(1, 0.5f, 0.5f, 1.f),
|
||||
"Warning: Enabling Image Resize uses more GPU\n"
|
||||
"resources and may significantly lower framerate\n"
|
||||
"for songs with Live2D! Results may vary, use at\n"
|
||||
"your own risk.");
|
||||
} else {
|
||||
ImGui::TextColored(ImVec4(1, 0.5f, 0.5f, 1.f),
|
||||
"Warning: Enabling Image Resize uses more GPU\n"
|
||||
"resources and may significantly lower framerate\n"
|
||||
"in some situations! Results may vary, use at\n"
|
||||
"your own risk.");
|
||||
}
|
||||
|
||||
// enable checkbox
|
||||
ImGui::Checkbox("Enable", &cfg::SCREENRESIZE->enable_screen_resize);
|
||||
ImGui::SameLine();
|
||||
@@ -135,21 +157,42 @@ namespace overlay::windows {
|
||||
// aspect ratio
|
||||
ImGui::Checkbox("Keep Aspect Ratio", &scene.keep_aspect_ratio);
|
||||
if (scene.keep_aspect_ratio) {
|
||||
if (ImGui::SliderFloat("Scale", &scene.scale_x, 0.5f, 2.5f)) {
|
||||
|
||||
// we want to avoid zooming out below 0.6 as it will cause StretchRect calls to
|
||||
// go on a slow sync path with the GPU, leading to frame drops in some situations
|
||||
// (e.g., SDVX Live2D)
|
||||
|
||||
if (ImGui::SliderFloat("Scale", &scene.scale_x, 0.6f, 2.5f)) {
|
||||
scene.scale_y = scene.scale_x;
|
||||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::HelpMarker("Hint: ctrl + click on the slider to type in a numeric value.");
|
||||
} else {
|
||||
ImGui::SliderFloat("Width Scale", &scene.scale_x, 0.5f, 2.5f);
|
||||
ImGui::SliderFloat("Width Scale", &scene.scale_x, 0.6f, 2.5f);
|
||||
ImGui::SameLine();
|
||||
ImGui::HelpMarker("Hint: ctrl + click on the slider to type in a numeric value.");
|
||||
ImGui::SliderFloat("Height Scale", &scene.scale_y, 0.5f, 2.5f);
|
||||
ImGui::SliderFloat("Height Scale", &scene.scale_y, 0.6f, 2.5f);
|
||||
ImGui::SameLine();
|
||||
ImGui::HelpMarker("Hint: ctrl + click on the slider to type in a numeric value.");
|
||||
}
|
||||
|
||||
static const char* dupe_items[] = { "None", "Copy Left", "Copy Right" };
|
||||
const bool duplicate_changed = ImGui::Combo(
|
||||
"Duplicate",
|
||||
reinterpret_cast<int *>(&scene.duplicate),
|
||||
dupe_items,
|
||||
ARRAYSIZE(dupe_items));
|
||||
ImGui::SameLine();
|
||||
ImGui::HelpMarker(
|
||||
"Show an identical copy of the image on the left or right, allowing you to achieve "
|
||||
"wrap-around effect when an offset is set.");
|
||||
|
||||
ImGui::EndDisabled();
|
||||
|
||||
// tell d3d9 device to clear surface to get rid of ghost image
|
||||
if (duplicate_changed) {
|
||||
cfg::SCREENRESIZE->need_surface_clean = true;
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenResize::build_windowed_config() {
|
||||
@@ -159,8 +202,7 @@ namespace overlay::windows {
|
||||
return;
|
||||
}
|
||||
|
||||
ImGui::TextUnformatted("Warning: may cause some games to crash.");
|
||||
ImGui::BeginDisabled(graphics_window_change_crashes_game());
|
||||
ImGui::BeginDisabled(graphics_window_decoration_change_crashes_game());
|
||||
if (ImGui::Combo(
|
||||
"Window Style",
|
||||
&cfg::SCREENRESIZE->window_decoration,
|
||||
@@ -185,42 +227,59 @@ namespace overlay::windows {
|
||||
"Reduces pixelated scaling artifacts. Works great on some games, but completely broken on others.\n\n"
|
||||
"This can't be changed in-game; instead, set -windowscale option in spicecfg and restart.");
|
||||
|
||||
ImGui::Checkbox("Keep Aspect Ratio", &cfg::SCREENRESIZE->client_keep_aspect_ratio);
|
||||
ImGui::Checkbox("Manual window move/resize", &cfg::SCREENRESIZE->enable_window_resize);
|
||||
|
||||
ImGui::BeginDisabled(graphics_window_move_and_resize_breaks_game());
|
||||
{
|
||||
ImGui::Checkbox("Keep Aspect Ratio", &cfg::SCREENRESIZE->client_keep_aspect_ratio);
|
||||
ImGui::Checkbox("Manual window move/resize", &cfg::SCREENRESIZE->enable_window_resize);
|
||||
}
|
||||
ImGui::EndDisabled();
|
||||
|
||||
ImGui::BeginDisabled(!cfg::SCREENRESIZE->enable_window_resize);
|
||||
|
||||
bool changed = false;
|
||||
const uint32_t step = 1;
|
||||
const uint32_t step_fast = 10;
|
||||
ImGui::BeginDisabled(cfg::SCREENRESIZE->client_keep_aspect_ratio);
|
||||
ImGui::InputScalar(
|
||||
"Width",
|
||||
ImGuiDataType_U32,
|
||||
&cfg::SCREENRESIZE->client_width,
|
||||
&step, &step_fast, nullptr);
|
||||
changed |= ImGui::IsItemDeactivatedAfterEdit();
|
||||
|
||||
ImGui::BeginDisabled(graphics_window_resize_breaks_game());
|
||||
{
|
||||
ImGui::BeginDisabled(cfg::SCREENRESIZE->client_keep_aspect_ratio);
|
||||
{
|
||||
ImGui::InputScalar(
|
||||
"Width",
|
||||
ImGuiDataType_U32,
|
||||
&cfg::SCREENRESIZE->client_width,
|
||||
&step, &step_fast, nullptr);
|
||||
changed |= ImGui::IsItemDeactivatedAfterEdit();
|
||||
}
|
||||
ImGui::EndDisabled();
|
||||
|
||||
ImGui::InputScalar(
|
||||
"Height",
|
||||
ImGuiDataType_U32,
|
||||
&cfg::SCREENRESIZE->client_height,
|
||||
&step, &step_fast, nullptr);
|
||||
changed |= ImGui::IsItemDeactivatedAfterEdit();
|
||||
}
|
||||
ImGui::EndDisabled();
|
||||
|
||||
ImGui::InputScalar(
|
||||
"Height",
|
||||
ImGuiDataType_U32,
|
||||
&cfg::SCREENRESIZE->client_height,
|
||||
&step, &step_fast, nullptr);
|
||||
changed |= ImGui::IsItemDeactivatedAfterEdit();
|
||||
ImGui::BeginDisabled(graphics_window_move_and_resize_breaks_game());
|
||||
{
|
||||
ImGui::InputScalar(
|
||||
"X Offset",
|
||||
ImGuiDataType_S32,
|
||||
&cfg::SCREENRESIZE->window_offset_x,
|
||||
&step, &step_fast, nullptr);
|
||||
changed |= ImGui::IsItemDeactivatedAfterEdit();
|
||||
|
||||
ImGui::InputScalar(
|
||||
"X Offset",
|
||||
ImGuiDataType_S32,
|
||||
&cfg::SCREENRESIZE->window_offset_x,
|
||||
&step, &step_fast, nullptr);
|
||||
changed |= ImGui::IsItemDeactivatedAfterEdit();
|
||||
|
||||
ImGui::InputScalar(
|
||||
"Y Offset",
|
||||
ImGuiDataType_S32,
|
||||
&cfg::SCREENRESIZE->window_offset_y,
|
||||
&step, &step_fast, nullptr);
|
||||
changed |= ImGui::IsItemDeactivatedAfterEdit();
|
||||
ImGui::InputScalar(
|
||||
"Y Offset",
|
||||
ImGuiDataType_S32,
|
||||
&cfg::SCREENRESIZE->window_offset_y,
|
||||
&step, &step_fast, nullptr);
|
||||
changed |= ImGui::IsItemDeactivatedAfterEdit();
|
||||
}
|
||||
ImGui::EndDisabled();
|
||||
|
||||
if (changed) {
|
||||
if (cfg::SCREENRESIZE->client_keep_aspect_ratio) {
|
||||
|
||||
Reference in New Issue
Block a user