[PATCH] Fix QW options menu

Fix some logic errors causing the "use mouse" option in the menu to be
unusable. This also fixes potential crash where the NULL vid_menudrawfn could
accidently get called (by not skipping over the disabled menu entry properly).

diff -urN b/QW/client/menu.c head/QW/client/menu.c
--- b/QW/client/menu.c	2006-05-13 20:49:23.000000000 +0930
+++ head/QW/client/menu.c	2006-05-13 18:25:44.000000000 +0930
@@ -29,6 +29,7 @@
 #include "render.h"
 #include "screen.h"
 #include "sys.h"
+#include "vid.h"
 #include "view.h"
 
 #ifdef _WIN32
@@ -553,8 +554,7 @@
     case K_DOWNARROW:
 	S_LocalSound("misc/menu1.wav");
 	options_cursor++;
-	if (options_cursor >= OPTIONS_ITEMS)
-	    options_cursor = 0;
+	options_cursor %= OPTIONS_ITEMS;
 	break;
 
     case K_LEFTARROW:
@@ -566,22 +566,24 @@
 	break;
     }
 
-    if (options_cursor == 14 && vid_menudrawfn == NULL) {
+    if (options_cursor == 14 && !vid_menudrawfn) {
 	if (k == K_UPARROW)
-	    options_cursor = 13;
-	else
-	    options_cursor = 0;
+	    options_cursor--;
+	else {
+	    options_cursor++;
+	    options_cursor %= OPTIONS_ITEMS;
+	}
     }
 
-    if ((options_cursor == 15)
-#ifdef _WIN32
-	&& (modestate != MS_WINDOWED)
-#endif
-	) {
-	if (k == K_UPARROW)
-	    options_cursor = 14;
-	else
-	    options_cursor = 0;
+    if (options_cursor == 15 && VID_IsFullScreen()) {
+	if (k == K_UPARROW) {
+	    options_cursor--;
+	    if (!vid_menudrawfn)
+		options_cursor--;
+	} else {
+	    options_cursor++;
+	    options_cursor %= OPTIONS_ITEMS;
+	}
     }
 }
 
diff -urN b/QW/client/vid_win.c head/QW/client/vid_win.c
--- b/QW/client/vid_win.c	2006-03-12 06:15:47.000000000 +1030
+++ head/QW/client/vid_win.c	2006-05-13 20:48:51.000000000 +0930
@@ -3195,3 +3195,9 @@
 	break;
     }
 }
+
+qboolean
+VID_IsFullScreen()
+{
+    return VID_GetModePtr(vid_modenum)->fullscreen;
+}
