mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-01 22:30:42 -07:00
graphics: option to change monitor resolution (#689)
## Link to GitHub Issue or related Pull Request, if one exists n/a ## Description of change Add a new option under `Monitor` group to change the monitor resolution before booting the game, very similar to how orientation / refresh rate options work. This would be useful for games like Polaris Chord that boots at current resolution but manages to have graphical issues when not in 1080p. ## Testing
This commit is contained in:
@@ -385,6 +385,16 @@ int main_implementation(int argc, char *argv[]) {
|
||||
monitor_orientation = ORIENTATION_CW;
|
||||
}
|
||||
|
||||
std::optional<std::pair<uint32_t, uint32_t>> monitor_resolution;
|
||||
if (options[launcher::Options::ChangeResolution].is_active()) {
|
||||
std::pair<uint32_t, uint32_t> result;
|
||||
if (parse_width_height(options[launcher::Options::ChangeResolution].value_text(), result)) {
|
||||
monitor_resolution = result;
|
||||
} else if (!cfg_run && !cfg::CONFIGURATOR_STANDALONE) {
|
||||
log_fatal("launcher", "failed to parse -changeres");
|
||||
}
|
||||
}
|
||||
|
||||
if (options[launcher::Options::spice2x_NoD3D9DeviceHook].value_bool()) {
|
||||
D3D9_DEVICE_HOOK_DISABLE = true;
|
||||
// touch emulation gets disabled, might as well turn these on
|
||||
@@ -2189,7 +2199,7 @@ int main_implementation(int argc, char *argv[]) {
|
||||
if (options[launcher::Options::PrimaryMonitor].is_active()) {
|
||||
change_primary_monitor(options[launcher::Options::PrimaryMonitor].value_text());
|
||||
}
|
||||
update_monitor_on_boot(monitor_orientation, GRAPHICS_FORCE_REFRESH);
|
||||
update_monitor_on_boot(monitor_orientation, GRAPHICS_FORCE_REFRESH, monitor_resolution);
|
||||
|
||||
// initialize raw input
|
||||
RI_MGR = std::make_unique<rawinput::RawInputManager>();
|
||||
|
||||
Reference in New Issue
Block a user