auto apply filter if screenmagnifying is not 1.0 or 2.0

This commit is contained in:
minjaesong
2024-01-25 16:04:20 +09:00
parent 54061f64a8
commit 2832f7123d
2 changed files with 7 additions and 2 deletions

View File

@@ -430,6 +430,7 @@ public class App implements ApplicationListener {
int width = scr.getWindowW();
int height = scr.getWindowH();
boolean useFullscreen = getConfigBoolean("fullscreen");
float magn = (float) getConfigDouble("screenmagnifying");
Lwjgl3ApplicationConfiguration appConfig = new Lwjgl3ApplicationConfiguration();
//appConfig.useGL30 = false; // https://stackoverflow.com/questions/46753218/libgdx-should-i-use-gl30
@@ -441,16 +442,21 @@ public class App implements ApplicationListener {
if (useFullscreen) {
// auto resize for fullscreen
var disp = Lwjgl3ApplicationConfiguration.getDisplayMode();
float magn = (float) getConfigDouble("screenmagnifying");
var newWidth = ((int)(disp.width / magn)) & 0x7FFFFFFE;
var newHeight = ((int)(disp.height / magn)) & 0x7FFFFFFE;
scr.setDimension(newWidth, newHeight, magn);
appConfig.setFullscreenMode(Lwjgl3ApplicationConfiguration.getDisplayMode());
}
else
appConfig.setWindowedMode(width, height);
// if filter is none AND magn is not (100% or 200%), set filter to hq2x
if (getConfigString("screenmagnifyingfilter").equals("none") && magn != 1f && magn != 2f) {
setConfig("screenmagnifyingfilter", "hq2x");
}
appConfig.setTransparentFramebuffer(false);
int fpsActive = Math.min(GLOBAL_FRAMERATE_LIMIT, getConfigInt("displayfps"));
if (fpsActive <= 0) fpsActive = GLOBAL_FRAMERATE_LIMIT;

View File

@@ -32,7 +32,6 @@ class UISoundControlPanel(remoCon: UIRemoCon?) : UICanvas() {
arrayOf("", { Lang["MENU_LABEL_AUDIO_ENGINE"] }, "h1"),
arrayOf("audio_speaker_setup", { Lang["MENU_OPTIONS_SPEAKER_SETUP"] }, "textsel,headphone=MENU_OPTIONS_SPEAKER_HEADPHONE,stereo=MENU_OPTIONS_SPEAKER_STEREO"),
arrayOf("audio_buffer_size", { Lang["MENU_OPTIONS_AUDIO_BUFFER_SIZE"] }, "spinnersel,128,256,512,1024,2048"),
// arrayOf("", { "(${Lang["MENU_LABEL_RESTART_REQUIRED"]})" }, "p"),
arrayOf("", { "${Lang["MENU_LABEL_AUDIO_BUFFER_INSTRUCTION"]}" }, "p"),
))