ehh stuff isWidescreen

This commit is contained in:
yugecin 2018-10-20 20:39:35 +02:00
parent 425860ca7c
commit 8d6e34faaf
No known key found for this signature in database
GPG Key ID: 2C5AC035A7068E44
4 changed files with 3 additions and 6 deletions

View File

@ -404,7 +404,7 @@ public class SongMenu extends ComplexOpsuState {
// selection buttons
// TODO: the origin should be bottomleft or something
float selectX = width * (displayContainer.isWidescreen() ? 0.164f : 0.1875f);
float selectX = width * (isWidescreen ? 0.164f : 0.1875f);
final float footerButtonWidth = footerHeight * 0.84f;
selectModeButton = new MenuButton(SELECTION_MODE_OVERLAY, selectX, footerY);
selectX += footerHeight + 2;

View File

@ -401,6 +401,7 @@ public class DisplayContainer implements ErrorDumpable, SkinChangedListener {
height = displayMode.getHeight();
width2 = width / 2;
height2 = height / 2;
isWidescreen = width * 1000 / height > 1500; // 1777 = 16:9, 1333 = 4:3
Display.setDisplayMode(displayMode);
Display.setFullscreen(fullscreen);
@ -460,10 +461,6 @@ public class DisplayContainer implements ErrorDumpable, SkinChangedListener {
return (Sys.getTime() * 1000) / Sys.getTimerResolution();
}
public boolean isWidescreen() {
return width * 1000 / height > 1500; // 1777 = 16:9, 1333 = 4:3
}
@Override
public void writeErrorDump(StringWriter dump) {
dump.append("> DisplayContainer dump\n");

View File

@ -79,6 +79,7 @@ public class InstanceContainer {
public static GamePauseMenu pauseState;
public static int width, width2, height, height2;
public static boolean isWidescreen;
public static int mouseX, mouseY;
public static int renderDelta;

View File

@ -218,7 +218,6 @@ public class OptionsOverlay implements ResolutionChangedListener, SkinChangedLis
public void revalidate() {
this.dirty = false;
boolean isWidescreen = displayContainer.isWidescreen();
targetWidth = (int) (width * (isWidescreen ? 0.4f : 0.5f));
// calculate positions