mirror of
https://github.com/gopher64/gopher64.git
synced 2026-07-11 01:25:20 +02:00
Add cli flag for widescreen (#1152)
* Add cli flag for widescreen and enable config fallback * Fix else statement brace spacing and trailing whitespace * Fix trailing whitespace within args.widescreen else statement
This commit is contained in:
@@ -22,6 +22,8 @@ pub struct Args {
|
||||
#[arg(short, long)]
|
||||
pub fullscreen: bool,
|
||||
#[arg(long)]
|
||||
pub widescreen: bool,
|
||||
#[arg(long)]
|
||||
pub overclock: Option<bool>,
|
||||
#[arg(long)]
|
||||
pub disable_expansion_pak: Option<bool>,
|
||||
@@ -170,6 +172,13 @@ pub fn run(args: Args, arg_count: usize) -> std::io::Result<()> {
|
||||
} else {
|
||||
device.ui.video.fullscreen = device.ui.config.video.fullscreen;
|
||||
}
|
||||
|
||||
if args.widescreen {
|
||||
device.ui.video.widescreen = true;
|
||||
} else {
|
||||
device.ui.video.widescreen = device.ui.config.video.widescreen;
|
||||
}
|
||||
|
||||
let overclock = args
|
||||
.overclock
|
||||
.unwrap_or(device.ui.config.emulation.overclock);
|
||||
|
||||
@@ -68,6 +68,7 @@ pub struct Storage {
|
||||
pub struct Video {
|
||||
pub window: *mut sdl3_sys::video::SDL_Window,
|
||||
pub fullscreen: bool,
|
||||
pub widescreen: bool,
|
||||
pub fps_tx: Option<tokio::sync::mpsc::UnboundedSender<bool>>,
|
||||
pub fps_rx: Option<tokio::sync::mpsc::UnboundedReceiver<bool>>,
|
||||
pub vis_tx: Option<tokio::sync::mpsc::UnboundedSender<bool>>,
|
||||
@@ -267,6 +268,7 @@ impl Ui {
|
||||
video: Video {
|
||||
window: std::ptr::null_mut(),
|
||||
fullscreen: false,
|
||||
widescreen: false,
|
||||
fps_tx: Some(fps_tx),
|
||||
fps_rx: Some(fps_rx),
|
||||
vis_tx: Some(vis_tx),
|
||||
|
||||
+3
-3
@@ -20,8 +20,8 @@ fn build_gfx_info(device: &mut device::Device, netplay: bool) -> GFX_INFO {
|
||||
DPC_END_REG: &mut device.rdp.regs_dpc[device::rdp::DPC_END_REG],
|
||||
DPC_STATUS_REG: &mut device.rdp.regs_dpc[device::rdp::DPC_STATUS_REG],
|
||||
PAL: device.cart.pal,
|
||||
widescreen: device.ui.config.video.widescreen,
|
||||
fullscreen: device.ui.video.fullscreen,
|
||||
widescreen: device.ui.video.widescreen,
|
||||
vsync: if !netplay {
|
||||
device.ui.config.video.vsync
|
||||
} else {
|
||||
@@ -56,14 +56,14 @@ pub fn init(device: &mut device::Device, netplay: bool) {
|
||||
2
|
||||
};
|
||||
if device.cart.pal {
|
||||
window_width = if device.ui.config.video.widescreen {
|
||||
window_width = if device.ui.video.widescreen {
|
||||
PAL_WIDESCREEN_WIDTH * scale
|
||||
} else {
|
||||
PAL_STANDARD_WIDTH * scale
|
||||
};
|
||||
window_height = PAL_HEIGHT * scale;
|
||||
} else {
|
||||
window_width = if device.ui.config.video.widescreen {
|
||||
window_width = if device.ui.video.widescreen {
|
||||
NTSC_WIDESCREEN_WIDTH * scale
|
||||
} else {
|
||||
NTSC_STANDARD_WIDTH * scale
|
||||
|
||||
Reference in New Issue
Block a user