Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.minecraft.src;
- public class ScaledResolution {
- private GameSettings gameSettings;
- private int scaledWidth;
- private int scaledHeight;
- public double scaledWidthD;
- public double scaledHeightD;
- public int scaleFactor;
- public ScaledResolution(GameSettings gameSettings, int width, int height) {
- this.gameSettings = par1GameSettings;
- changeResolution(width, height);
- }
- public void changeResolution(int width, int height) {
- scaledWidth = width;
- scaledHeight = height;
- scaleFactor = 1;
- int i = gameSettings.guiScale;
- if (i == 0)
- i = 1000;
- for (; scaleFactor < i && scaledWidth / (scaleFactor + 1) >= 320 && scaledHeight / (scaleFactor + 1) >= 240; scaleFactor++) {}
- scaledWidthD = (double) scaledWidth / (double) scaleFactor;
- scaledHeightD = (double) scaledHeight / (double) scaleFactor;
- scaledWidth = (int) Math.ceil(scaledWidthD);
- scaledHeight = (int) Math.ceil(scaledHeightD);
- }
- public int getScaledWidth() {
- return scaledWidth;
- }
- public int getScaledHeight() {
- return scaledHeight;
- }
- }
Advertisement