]> git.mxchange.org Git - flightgear.git/blobdiff - Main/GLUTkey.c
Merged in make system changes from Bob Kuehne <rpk@sgi.com>
[flightgear.git] / Main / GLUTkey.c
index 22442cb866cbb73bfeb124937c67c1f492a29450..568e5b4f660c6167a7975e3fcac59838446fabee 100644 (file)
 #endif
 
 #include <GL/glut.h>
+#include <XGL/xgl.h>
 #include <stdio.h>
 
-#include "GLUTkey.h"
-#include "views.h"
+#include <Main/GLUTkey.h>
+#include <Main/views.h>
 
-#include "../constants.h"
+#include <Include/constants.h>
 
-#include "../Aircraft/aircraft.h"
-#include "../Weather/weather.h"
+#include <Aircraft/aircraft.h>
+#include <Weather/weather.h>
 
 
 extern int show_hud;             /* HUD state */
+extern int displayInstruments;
 
 
 /* Handle keyboard events */
 void GLUTkey(unsigned char k, int x, int y) {
     struct fgCONTROLS *c;
+    struct fgTIME *t;
     struct fgVIEW *v;
     struct fgWEATHER *w;
 
     c = &current_aircraft.controls;
+    t = &cur_time_params;
     v = &current_view;
     w = &current_weather;
 
@@ -85,9 +89,18 @@ void GLUTkey(unsigned char k, int x, int y) {
        case 72: /* H key */
            show_hud = !show_hud;
            return;
+       case 77: /* M key */
+           t->warp -= 60;
+           return;
+       case 84: /* T key */
+           t->warp_delta -= 30;
+           return;
+       case 87: /* W key */
+           displayInstruments = !displayInstruments;
+           return;
        case 90: /* Z key */
            w->visibility /= 1.10;
-           glFogf(GL_FOG_END, w->visibility);
+           xglFogf(GL_FOG_END, w->visibility);
            printf("Fog density = %.4f\n", w->visibility);
            return;
        }
@@ -129,9 +142,15 @@ void GLUTkey(unsigned char k, int x, int y) {
        case 51: /* numeric keypad 3 (Pg Dn) */
            fgThrottleMove(0, -0.01);
            return;
+       case 109: /* m key */
+           t->warp += 60;
+           return;
+       case 116: /* t key */
+           t->warp_delta += 30;
+           return;
        case 122: /* z key */
            w->visibility *= 1.10;
-           glFogf(GL_FOG_END, w->visibility);
+           xglFogf(GL_FOG_END, w->visibility);
            printf("Fog density = %.4f\n", w->visibility);
            return;
        case 27: /* ESC */
@@ -224,10 +243,24 @@ void GLUTspecialkey(int k, int x, int y) {
 
 
 /* $Log$
-/* Revision 1.22  1997/12/10 22:37:45  curt
-/* Prepended "fg" on the name of all global structures that didn't have it yet.
-/* i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
+/* Revision 1.26  1998/01/19 19:27:07  curt
+/* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+/* This should simplify things tremendously.
 /*
+ * Revision 1.25  1998/01/05 18:44:34  curt
+ * Add an option to advance/decrease time from keyboard.
+ *
+ * Revision 1.24  1997/12/30 16:36:46  curt
+ * Merged in Durk's changes ...
+ *
+ * Revision 1.23  1997/12/15 23:54:44  curt
+ * Add xgl wrappers for debugging.
+ * Generate terrain normals on the fly.
+ *
+ * Revision 1.22  1997/12/10 22:37:45  curt
+ * Prepended "fg" on the name of all global structures that didn't have it yet.
+ * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
+ *
  * Revision 1.21  1997/08/27 21:32:23  curt
  * Restructured view calculation code.  Added stars.
  *