]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix bug with bogus refresh rate info in xvidmode data
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 30 Oct 2009 18:10:15 +0000 (18:10 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 30 Oct 2009 18:10:15 +0000 (18:10 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9403 d7cf8633-e32d-0410-b094-e92efae38249

vid_glx.c

index a0284127923696f38175a37734677dd9b2f744e8..9bbf5bcb027f10074066732c15ab4ab8985d38de 100644 (file)
--- a/vid_glx.c
+++ b/vid_glx.c
@@ -1102,7 +1102,10 @@ size_t VID_ListModes(vid_mode_t *modes, size_t maxcount)
                                modes[k].width = vidmodes[i]->hdisplay;
                                modes[k].height = vidmodes[i]->vdisplay;
                                modes[k].bpp = 8;
                                modes[k].width = vidmodes[i]->hdisplay;
                                modes[k].height = vidmodes[i]->vdisplay;
                                modes[k].bpp = 8;
-                               modes[k].refreshrate = vidmodes[i]->dotclock / vidmodes[i]->htotal / vidmodes[i]->vtotal;
+                               if(vidmodes[i]->dotclock && vidmodes[i]->htotal && vidmodes[i]->vtotal)
+                                       modes[k].refreshrate = vidmodes[i]->dotclock / vidmodes[i]->htotal / vidmodes[i]->vtotal;
+                               else
+                                       modes[k].refreshrate = 60;
                                modes[k].pixelheight_num = 1;
                                modes[k].pixelheight_denom = 1; // xvidmode does not provide this
                                ++k;
                                modes[k].pixelheight_num = 1;
                                modes[k].pixelheight_denom = 1; // xvidmode does not provide this
                                ++k;