]> git.mxchange.org Git - flightgear.git/blobdiff - Main/GLUTkey.c
Changed naming scheme of basic shared structures.
[flightgear.git] / Main / GLUTkey.c
index 75701b8350e858ff5c371bfe199cfcb20ef98114..53df0817e5db48f09d9e1f91724d1f79a623a4b5 100644 (file)
 #include <GL/glut.h>
 
 #include "GLUTkey.h"
-#include "../Aircraft/aircraft.h"
+
 #include "../constants.h"
 
-extern double fogDensity;
+#include "../Aircraft/aircraft.h"
+#include "../Weather/weather.h"
+
 extern double goal_view_offset;
+extern int show_hud;             /* HUD state */
+
 
 /* Handle keyboard events */
 void GLUTkey(unsigned char k, int x, int y) {
-    struct control_params *c;
+    struct CONTROLS *c;
+    struct WEATHER *w;
 
     c = &current_aircraft.controls;
+    w = &current_weather;
 
     printf("Key hit = %d", k);
 
@@ -74,6 +80,14 @@ void GLUTkey(unsigned char k, int x, int y) {
        case 57: /* numeric keypad 9 */
            goal_view_offset = FG_PI * 1.75;
            return;
+       case 72: /* H key */
+           show_hud = !show_hud;
+           return;
+       case 90: /* Z key */
+           w->visibility /= 1.10;
+           glFogf(GL_FOG_END, w->visibility);
+           printf("Fog density = %.4f\n", w->visibility);
+           return;
        }
     } else {
        printf("\n");
@@ -113,15 +127,10 @@ void GLUTkey(unsigned char k, int x, int y) {
        case 51: /* numeric keypad 3 (Pg Dn) */
            fgThrottleMove(0, -0.01);
            return;
-       case 122:
-           fogDensity *= 1.10;
-           glFogf(GL_FOG_END, fogDensity);
-           printf("Fog density = %.4f\n", fogDensity);
-           return;
-       case 90:
-           fogDensity /= 1.10;
-           glFogf(GL_FOG_END, fogDensity);
-           printf("Fog density = %.4f\n", fogDensity);
+       case 122: /* z key */
+           w->visibility *= 1.10;
+           glFogf(GL_FOG_END, w->visibility);
+           printf("Fog density = %.4f\n", w->visibility);
            return;
        case 27: /* ESC */
            exit(0);
@@ -133,7 +142,7 @@ void GLUTkey(unsigned char k, int x, int y) {
 
 /* Handle "special" keyboard events */
 void GLUTspecialkey(int k, int x, int y) {
-    struct control_params *c;
+    struct CONTROLS *c;
 
     c = &current_aircraft.controls;
 
@@ -211,10 +220,19 @@ void GLUTspecialkey(int k, int x, int y) {
 
 
 /* $Log$
-/* Revision 1.17  1997/07/19 22:34:02  curt
-/* Moved PI definitions to ../constants.h
-/* Moved random() stuff to ../Utils/ and renamed fg_random()
+/* Revision 1.20  1997/08/27 03:30:13  curt
+/* Changed naming scheme of basic shared structures.
 /*
+ * Revision 1.19  1997/08/25 20:27:21  curt
+ * Merged in initial HUD and Joystick code.
+ *
+ * Revision 1.18  1997/08/22 21:34:38  curt
+ * Doing a bit of reorganizing and house cleaning.
+ *
+ * Revision 1.17  1997/07/19 22:34:02  curt
+ * Moved PI definitions to ../constants.h
+ * Moved random() stuff to ../Utils/ and renamed fg_random()
+ *
  * Revision 1.16  1997/07/18 23:41:24  curt
  * Tweaks for building with Cygnus Win32 compiler.
  *