mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-02 23:00:42 -07:00
sdvx: re-enable landscape mode (#847)
## Link to GitHub Issue or related Pull Request, if one exists n/a ## Description of change Un-deprecate SDVX landscape mode. The game calls `GetViewport` to figure out the camera position, so if we return a sane value the game goes back to rendering correctly. ## Testing Tested nabla only
This commit is contained in:
@@ -1239,7 +1239,36 @@ HRESULT STDMETHODCALLTYPE WrappedIDirect3DDevice9::GetViewport(
|
|||||||
D3DVIEWPORT9 *pViewport)
|
D3DVIEWPORT9 *pViewport)
|
||||||
{
|
{
|
||||||
WRAP_DEBUG;
|
WRAP_DEBUG;
|
||||||
CHECK_RESULT(pReal->GetViewport(pViewport));
|
const auto result = pReal->GetViewport(pViewport);
|
||||||
|
|
||||||
|
// SDVX landscape mode
|
||||||
|
// without this, the game calculates the camera angle incorrectly and
|
||||||
|
// ends up with zoomed out view of the lanes
|
||||||
|
const auto landscape_width = GRAPHICS_FS_CUSTOM_RESOLUTION.has_value() ?
|
||||||
|
GRAPHICS_FS_CUSTOM_RESOLUTION.value().first : GRAPHICS_FS_ORIGINAL_HEIGHT;
|
||||||
|
const auto landscape_height = GRAPHICS_FS_CUSTOM_RESOLUTION.has_value() ?
|
||||||
|
GRAPHICS_FS_CUSTOM_RESOLUTION.value().second : GRAPHICS_FS_ORIGINAL_WIDTH;
|
||||||
|
if (SUCCEEDED(result) &&
|
||||||
|
GRAPHICS_FS_ORIENTATION_SWAP &&
|
||||||
|
avs::game::is_model("KFC") &&
|
||||||
|
pViewport != nullptr &&
|
||||||
|
pViewport->Width == landscape_width &&
|
||||||
|
pViewport->Height == landscape_height) {
|
||||||
|
|
||||||
|
static std::once_flag log_once;
|
||||||
|
std::call_once(log_once, [pViewport]() {
|
||||||
|
log_info(
|
||||||
|
"graphics::d3d9",
|
||||||
|
"SDVX landscape viewport fix: {}x{} => {}x{}",
|
||||||
|
pViewport->Width,
|
||||||
|
pViewport->Height,
|
||||||
|
pViewport->Height,
|
||||||
|
pViewport->Width);
|
||||||
|
});
|
||||||
|
std::swap(pViewport->Width, pViewport->Height);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE WrappedIDirect3DDevice9::SetMaterial(
|
HRESULT STDMETHODCALLTYPE WrappedIDirect3DDevice9::SetMaterial(
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
#include "games/ddr/ddr.h"
|
#include "games/ddr/ddr.h"
|
||||||
#include "games/gitadora/gitadora.h"
|
#include "games/gitadora/gitadora.h"
|
||||||
#include "games/iidx/iidx.h"
|
#include "games/iidx/iidx.h"
|
||||||
|
#include "games/sdvx/sdvx.h"
|
||||||
#include "games/popn/popn.h"
|
#include "games/popn/popn.h"
|
||||||
#include "hooks/graphics/backends/d3d9/d3d9_backend.h"
|
#include "hooks/graphics/backends/d3d9/d3d9_backend.h"
|
||||||
#include "hooks/graphics/backends/d3d11/d3d11_backend.h"
|
#include "hooks/graphics/backends/d3d11/d3d11_backend.h"
|
||||||
|
|||||||
@@ -1702,18 +1702,13 @@ int main_implementation(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// SDVXFullscreenLandscape disabled due to it messing with in-game camera angle
|
if (options[launcher::Options::SDVXFullscreenLandscape].value_bool() && !GRAPHICS_WINDOWED) {
|
||||||
// FullscreenOrientationFlip continues to live on, however.
|
#if SPICE64
|
||||||
if (options[launcher::Options::SDVXFullscreenLandscape].value_bool() && !cfg::CONFIGURATOR_STANDALONE) {
|
GRAPHICS_FS_ORIENTATION_SWAP = true;
|
||||||
log_fatal("launcher", "-sdvxlandscape removed due to a camera bug in SDVX!");
|
#else
|
||||||
|
log_warning("launcher", "-sdvxlandscape is not supported in 32-bit SDVX, ignoring...");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
// if (options[launcher::Options::SDVXFullscreenLandscape].value_bool() && !GRAPHICS_WINDOWED) {
|
|
||||||
// #if SPICE64
|
|
||||||
// GRAPHICS_FS_ORIENTATION_SWAP = true;
|
|
||||||
// #else
|
|
||||||
// log_warning("launcher", "-sdvxlandscape is not supported in 32-bit SDVX, ignoring...");
|
|
||||||
// #endif
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (options[launcher::Options::FullscreenOrientationFlip].value_bool() && !GRAPHICS_WINDOWED) {
|
if (options[launcher::Options::FullscreenOrientationFlip].value_bool() && !GRAPHICS_WINDOWED) {
|
||||||
GRAPHICS_FS_ORIENTATION_SWAP = true;
|
GRAPHICS_FS_ORIENTATION_SWAP = true;
|
||||||
|
|||||||
@@ -330,9 +330,8 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
|||||||
.desc =
|
.desc =
|
||||||
"Allows you to play portrait games in landscape (and vice versa) by transposing resolution and applying image scaling.\n\n"
|
"Allows you to play portrait games in landscape (and vice versa) by transposing resolution and applying image scaling.\n\n"
|
||||||
"Works great for some games, but can COMPLETELY BREAK other games - YMMV!\n\n"
|
"Works great for some games, but can COMPLETELY BREAK other games - YMMV!\n\n"
|
||||||
"Strongly consider combining this with -forceres option to render at monitor native resolution\n\n"
|
"Strongly consider combining this with -forceres option to render at monitor native resolution.\n\n"
|
||||||
"WARNING: for SDVX, this messes with camera angle for note lanes, causing it to be zoomed out, and causes performance issues "
|
"For SDVX, use the dedicated -sdvxlandscape option.",
|
||||||
"with Live2D!",
|
|
||||||
.type = OptionType::Bool,
|
.type = OptionType::Bool,
|
||||||
.hidden = true,
|
.hidden = true,
|
||||||
.category = "Full Screen Settings"
|
.category = "Full Screen Settings"
|
||||||
@@ -3014,17 +3013,17 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
// SDVXFullscreenLandscape
|
// SDVXFullscreenLandscape
|
||||||
.title = "(DISABLED) SDVX Landscape Mode (SDVX5+)",
|
.title = "SDVX Full Screen Landscape Mode (SDVX5+)",
|
||||||
.name = "sdvxlandscape",
|
.name = "sdvxlandscape",
|
||||||
.desc =
|
.desc =
|
||||||
"Option HIDDEN and DISABLED due to it affecting in-game camera angle for displaying lanes.\n\n"
|
|
||||||
"Allows you to play in landscape by transposing resolution and applying image scaling.\n\n"
|
"Allows you to play in landscape by transposing resolution and applying image scaling.\n\n"
|
||||||
"Works only for SDVX5 and above! This is identical to -forceresswap.\n\n"
|
"Corrects the in-game perspective camera for the transposed display aspect ratio.\n\n"
|
||||||
|
"Works only for SDVX5 and above.\n\n"
|
||||||
"Will launch at 1080p by default; strongly consider combining this with -forceres option to render at monitor native resolution.",
|
"Will launch at 1080p by default; strongly consider combining this with -forceres option to render at monitor native resolution.",
|
||||||
.type = OptionType::Bool,
|
.type = OptionType::Bool,
|
||||||
.hidden = true,
|
|
||||||
.game_name = "Sound Voltex",
|
.game_name = "Sound Voltex",
|
||||||
.category = "Game Options",
|
.category = "Game Options",
|
||||||
|
.quick_setting_category = "Game",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// spice2x_EnableSMXStage
|
// spice2x_EnableSMXStage
|
||||||
|
|||||||
Reference in New Issue
Block a user