mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-10-05 07:11:42 +02:00
Update to v094r42 release.
byuu says: I imagine you guys will like this WIP very much. Changelog: - ListView check boxes on Windows - ListView removal of columns on reset (changing input dropdowns) - DirectSound audio duplication on latency change - DirectSound crash on 20ms latency - Fullscreen window sizing in multi-monitor setups - Allow joypad bindings of hotkeys - Allow triggers to be mapped (Xbox 360 / XInput / Windows only) - Support joypad rumble for Game Boy Player - Video scale settings modified from {1x,2x,3x} to {2x,3x,4x} - System menu now renames to active emulation core - Added fast forward hotkey Not changing for v095: - not adding input focus settings yet - not adding shaders yet Not changing at all: - not implementing maximize
This commit is contained in:
@@ -32,14 +32,14 @@ Presentation::Presentation() {
|
||||
settingsMenu.setText("Settings");
|
||||
videoScaleMenu.setText("Video Scale");
|
||||
if(config->video.scale == "Small") videoScaleSmall.setChecked();
|
||||
if(config->video.scale == "Normal") videoScaleNormal.setChecked();
|
||||
if(config->video.scale == "Medium") videoScaleMedium.setChecked();
|
||||
if(config->video.scale == "Large") videoScaleLarge.setChecked();
|
||||
videoScaleSmall.setText("Small").onActivate([&] {
|
||||
config->video.scale = "Small";
|
||||
resizeViewport();
|
||||
});
|
||||
videoScaleNormal.setText("Normal").onActivate([&] {
|
||||
config->video.scale = "Normal";
|
||||
videoScaleMedium.setText("Medium").onActivate([&] {
|
||||
config->video.scale = "Medium";
|
||||
resizeViewport();
|
||||
});
|
||||
videoScaleLarge.setText("Large").onActivate([&] {
|
||||
@@ -137,8 +137,8 @@ auto Presentation::updateEmulator() -> void {
|
||||
|
||||
auto Presentation::resizeViewport() -> void {
|
||||
signed scale = 1;
|
||||
if(config->video.scale == "Small" ) scale = 1;
|
||||
if(config->video.scale == "Normal") scale = 2;
|
||||
if(config->video.scale == "Small" ) scale = 2;
|
||||
if(config->video.scale == "Medium") scale = 3;
|
||||
if(config->video.scale == "Large" ) scale = 4;
|
||||
|
||||
signed width = 256;
|
||||
@@ -163,24 +163,25 @@ auto Presentation::resizeViewport() -> void {
|
||||
setSize({windowWidth, windowHeight});
|
||||
viewport.setGeometry({(windowWidth - width) / 2, (windowHeight - height) / 2, width, height});
|
||||
} else {
|
||||
auto desktop = Desktop::size();
|
||||
signed windowWidth = geometry().width();
|
||||
signed windowHeight = geometry().height();
|
||||
|
||||
//aspect ratio correction is always enabled in fullscreen mode
|
||||
//note that below algorithm yields 7:6 ratio on 2560x(1440,1600) monitors
|
||||
//this is extremely close to the optimum 8:7 ratio
|
||||
//it is used so that linear interpolation isn't required
|
||||
//todo: we should handle other resolutions nicely as well
|
||||
unsigned multiplier = desktop.height() / height;
|
||||
unsigned multiplier = windowHeight / height;
|
||||
width *= 1 + multiplier;
|
||||
height *= multiplier;
|
||||
|
||||
signed x = (desktop.width() - width) / 2;
|
||||
signed y = (desktop.height() - height) / 2;
|
||||
signed x = (windowWidth - width) / 2;
|
||||
signed y = (windowHeight - height) / 2;
|
||||
|
||||
if(x < 0) x = 0;
|
||||
if(y < 0) y = 0;
|
||||
if(width > desktop.width()) width = desktop.width();
|
||||
if(height > desktop.height()) height = desktop.height();
|
||||
if(width > windowWidth) width = windowWidth;
|
||||
if(height > windowHeight) height = windowHeight;
|
||||
|
||||
viewport.setGeometry({x, y, width, height});
|
||||
}
|
||||
|
Reference in New Issue
Block a user