float multiplier = 0;
float realmultiplier = 0;
float screenwidth = 0, screenheight = 0;
+float minscreenwidth = 640, minscreenheight = 480;
+float maxscreenwidth = 3000, maxscreenheight = 3000;
bool fullscreen = 0;
float viewdistance = 0;
XYZ viewer;
if (newdetail > 2) {
newdetail = 2;
}
- if (newscreenwidth > 3000) {
+ if (newscreenwidth < minscreenwidth || newscreenwidth > maxscreenwidth) {
newscreenwidth = screenwidth;
}
- if (newscreenwidth < 0) {
- newscreenwidth = screenwidth;
- }
- if (newscreenheight > 3000) {
- newscreenheight = screenheight;
- }
- if (newscreenheight < 0) {
+ if (newscreenheight < minscreenheight || newscreenheight > maxscreenheight) {
newscreenheight = screenheight;
}
errno = 0;
if (!strncmp(setting, "Screenwidth", 11)) {
ipstream >> kContextWidth;
+ if (kContextWidth < (int)minscreenwidth || kContextWidth > (int)maxscreenwidth) {
+ kContextWidth = (int)minscreenwidth;
+ }
} else if (!strncmp(setting, "Screenheight", 12)) {
ipstream >> kContextHeight;
+ if (kContextHeight < (int)minscreenheight || kContextHeight > (int)maxscreenheight) {
+ kContextHeight = (int)minscreenheight;
+ }
} else if (!strncmp(setting, "Fullscreen", 10)) {
ipstream >> fullscreen;
} else if (!strncmp(setting, "Mouse sensitivity", 17)) {
if (detail < 0) {
detail = 0;
}
- if (screenwidth < 0) {
+ if (screenwidth < minscreenwidth || screenwidth > maxscreenwidth) {
screenwidth = 1024;
}
- if (screenheight < 0) {
+ if (screenheight < minscreenheight || screenheight > maxscreenheight) {
screenheight = 768;
}
extern int kContextHeight;
extern float screenwidth, screenheight;
extern bool fullscreen;
+extern float minscreenwidth, minscreenheight;
+extern float maxscreenwidth, maxscreenheight;
void DefaultSettings();
void SaveSettings();