mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-19 12:35:52 -04:00
Clamp window resolution to size of monitor on game load (thanks kingoscaragames1)
This commit is contained in:
parent
fe5266d959
commit
200a1ac93b
@ -34,13 +34,13 @@ namespace ClassicalSharp {
|
||||
#endif
|
||||
|
||||
Options.Load();
|
||||
int width = Options.GetInt(OptionsKey.WindowWidth, 0, 65536, 0);
|
||||
int height = Options.GetInt(OptionsKey.WindowHeight, 0, 65536, 0);
|
||||
DisplayDevice device = DisplayDevice.Primary;
|
||||
int width = Options.GetInt(OptionsKey.WindowWidth, 0, device.Width, 0);
|
||||
int height = Options.GetInt(OptionsKey.WindowHeight, 0, device.Height, 0);
|
||||
|
||||
// No custom resolution has been set
|
||||
if (width == 0 || height == 0) {
|
||||
width = 854; height = 480;
|
||||
DisplayDevice device = DisplayDevice.Primary;
|
||||
width = 854; height = 480;
|
||||
if (device.Width < 854) width = 640;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user