91 if (me.maxAllowedWidth && w > me.maxAllowedWidth)
93 if (me.maxAllowedHeight && h > me.maxAllowedHeight)
96 for (i = 0; i < me.nValues; ++i)
103 if (pixelheight >
stof(
argv(2)) + 0.01)
continue;
104 if (pixelheight <
stof(
argv(2)) - 0.01)
break;
107 if (pixelheight != 1)
109 float aspect = w / (h * pixelheight);
110 float bestdenom =
rint(aspect);
113 for (denom = 2; denom < 10; ++denom) {
114 float num =
rint(aspect * denom);
115 if (
fabs(num / denom - aspect) <
fabs(bestnum / bestdenom - aspect))
121 me.insertValue(me, i,
strzone(sprintf(
"%dx%d (%d:%d)", w, h, bestnum, bestdenom)),
strzone(
strcat(
ftos(w),
" ",
ftos(h),
" ",
ftos(pixelheight))));
140 for(i = 0; i < me.nValues; ++i)
147 me.maxAllowedWidth = 0;
148 me.maxAllowedHeight = 0;
155 if(r_x == 0 && r_y == 0)
157 if(r.x < 640 || r.y < 480)
162 me.addResolution(me, r.x, r.y, r.z);
165 if(r.x != 0 || r.y != 0)
166 me.addResolution(me, r.x, r.y, r.z);
175 if(r.x == 0 && r.y == 0)
179 if(r.x != 0 || r.y != 0)
181 me.maxAllowedWidth = r.x;
182 me.maxAllowedHeight = r.y;
183 me.addResolution(me, r.x, r.y, r.z);
187 me.addResolution(me, 640, 480, 1);
189 me.addResolution(me, 720, 480, 1.125);
190 me.addResolution(me, 720, 576, 0.9375);
191 me.addResolution(me, 720, 480, 0.84375);
192 me.addResolution(me, 720, 576, 0.703125);
194 me.addResolution(me, 800, 480, 1);
195 me.addResolution(me, 800, 600, 1);
196 me.addResolution(me, 1024, 600, 1);
197 me.addResolution(me, 1024, 768, 1);
198 me.addResolution(me, 1280, 720, 1);
199 me.addResolution(me, 1280, 960, 1);
200 me.addResolution(me, 1280, 1024, 1);
201 me.addResolution(me, 1920, 1080, 1);
204 LOG_TRACE(
"Total number of resolutions detected: ",
ftos(me.nValues));
206 me.vid_fullscreen = fullscreen;
208 me.configureXonoticTextSliderValues(me);