Add window size parameter (#8281)

* Add window size parameter

* Formatting

* Java 8
This commit is contained in:
Gureumi
2023-02-17 09:13:59 -05:00
committed by GitHub
parent ebb798cac3
commit f7ccf3c04a
@@ -41,15 +41,28 @@ public class DesktopLauncher extends ClientLauncher{
maximized = true; maximized = true;
width = 900; width = 900;
height = 700; height = 700;
//enable gl3 with command-line argument (slower performance, apparently) for(int i = 0;i<arg.length;i++){
if(Structs.contains(arg, "-gl3")){ if(arg[i].charAt(0) == '-'){
String name = arg[i].substring(1);
try{
switch(name){
case "width":
width = Integer.parseInt(arg[i + 1]);
case "height":
height = Integer.parseInt(arg[i + 1]);
case "gl3":
gl30 = true; gl30 = true;
} case "antialias":
if(Structs.contains(arg, "-antialias")){
samples = 16; samples = 16;
} case "debug":
if(Structs.contains(arg, "-debug")){
Log.level = LogLevel.debug; Log.level = LogLevel.debug;
case "maximized":
maximized = Boolean.parseBoolean(arg[i + 1]);
}
}catch(NumberFormatException number){
Log.warn("Invalid parameter number value.");
}
}
} }
setWindowIcon(FileType.internal, "icons/icon_64.png"); setWindowIcon(FileType.internal, "icons/icon_64.png");
}}); }});