all: $(TARGET)
clean:
- rm -f *.o $(TARGET) *~ core
+ rm -f *.o $(TARGET) lib*.a *~ core
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------
# $Log$
+# Revision 1.9 1997/07/18 23:41:23 curt
+# Tweaks for building with Cygnus Win32 compiler.
+#
# Revision 1.8 1997/07/12 02:24:48 curt
# Added ranlib.
#
#include <math.h>
#include <stdio.h>
-#ifdef __CYGWIN32__
+#ifdef WIN32
# include <windows.h>
#endif
c = ¤t_aircraft.controls;
- printf("Key hit = %d\n", k);
+ printf("Key hit = %d", k);
if ( GLUT_ACTIVE_SHIFT && glutGetModifiers() ) {
+ printf(" SHIFTED\n");
switch (k) {
case 49: /* numeric keypad 1 */
goal_view_offset = M_PI * 0.75;
return;
}
} else {
+ printf("\n");
switch (k) {
case 50: /* numeric keypad 2 */
fgElevMove(-0.05);
c = ¤t_aircraft.controls;
- printf("Special key hit = %d\n", k);
-
- switch (k) {
- case GLUT_KEY_UP:
- fgElevMove(0.05);
- return;
- case GLUT_KEY_DOWN:
- fgElevMove(-0.05);
- return;
- case GLUT_KEY_LEFT:
- fgAileronMove(-0.05);
- return;
- case GLUT_KEY_RIGHT:
- fgAileronMove(0.05);
- return;
- }
+ printf("Special key hit = %d", k);
+ if ( GLUT_ACTIVE_SHIFT && glutGetModifiers() ) {
+ printf(" SHIFTED\n");
+ switch (k) {
+ case GLUT_KEY_END: /* numeric keypad 1 */
+ goal_view_offset = M_PI * 0.75;
+ return;
+ case GLUT_KEY_DOWN: /* numeric keypad 2 */
+ goal_view_offset = M_PI;
+ return;
+ case GLUT_KEY_PAGE_DOWN: /* numeric keypad 3 */
+ goal_view_offset = M_PI * 1.25;
+ return;
+ case GLUT_KEY_LEFT: /* numeric keypad 4 */
+ goal_view_offset = M_PI * 0.50;
+ return;
+ case GLUT_KEY_RIGHT: /* numeric keypad 6 */
+ goal_view_offset = M_PI * 1.50;
+ return;
+ case GLUT_KEY_HOME: /* numeric keypad 7 */
+ goal_view_offset = M_PI * 0.25;
+ return;
+ case GLUT_KEY_UP: /* numeric keypad 8 */
+ goal_view_offset = 0.00;
+ return;
+ case GLUT_KEY_PAGE_UP: /* numeric keypad 9 */
+ goal_view_offset = M_PI * 1.75;
+ return;
+ }
+ } else {
+ printf("\n");
+ switch (k) {
+ case GLUT_KEY_UP:
+ fgElevMove(0.05);
+ return;
+ case GLUT_KEY_DOWN:
+ fgElevMove(-0.05);
+ return;
+ case GLUT_KEY_LEFT:
+ fgAileronMove(-0.05);
+ return;
+ case GLUT_KEY_RIGHT:
+ fgAileronMove(0.05);
+ return;
+ case GLUT_KEY_HOME: /* numeric keypad 1 */
+ fgElevTrimMove(-0.001);
+ return;
+ case GLUT_KEY_END: /* numeric keypad 7 */
+ fgElevTrimMove(0.001);
+ return;
+ case GLUT_KEY_INSERT: /* numeric keypad Ins */
+ fgRudderMove(-0.05);
+ return;
+ case 13: /* numeric keypad Enter */
+ fgRudderMove(0.05);
+ return;
+ case 53: /* numeric keypad 5 */
+ fgAileronSet(0.0);
+ fgElevSet(0.0);
+ fgRudderSet(0.0);
+ return;
+ case GLUT_KEY_PAGE_UP: /* numeric keypad 9 (Pg Up) */
+ fgThrottleMove(0, 0.01);
+ return;
+ case GLUT_KEY_PAGE_DOWN: /* numeric keypad 3 (Pg Dn) */
+ fgThrottleMove(0, -0.01);
+ return;
+ }
+ }
}
/* $Log$
-/* Revision 1.15 1997/07/16 20:04:47 curt
-/* Minor tweaks to aid Win32 port.
+/* Revision 1.16 1997/07/18 23:41:24 curt
+/* Tweaks for building with Cygnus Win32 compiler.
/*
+ * Revision 1.15 1997/07/16 20:04:47 curt
+ * Minor tweaks to aid Win32 port.
+ *
* Revision 1.14 1997/07/12 03:50:20 curt
* Added an #include <Windows32/Base.h> to help compiling for Win32
*
#include <stdio.h>
#include <stdlib.h>
-#ifdef __CYGWIN32__
+#ifdef WIN32
# include <windows.h>
#endif
FG_Altitude * FEET_TO_METER);
}
+
+#ifndef USE_RAND
+# ifdef sgi
+# undef RAND_MAX
+# define RAND_MAX 2147483647
+# endif
+#endif
+
#ifdef USE_RAND
FG_U_gust = rand() * 3.0 / RAND_MAX - 1.0;
FG_V_gust = rand() * 3.0 / RAND_MAX - 1.0;
f = ¤t_aircraft.flight;
- printf("Flight Gear: prototype code to test OpenGL, LaRCsim, and VRML\n\n");
+ /* printf("Flight Gear: prototype code to test OpenGL, LaRCsim, and VRML\n\n");*/
/**********************************************************************
return(0);
}
+#ifdef NO_PRINTF
+
+#include <stdarg.h>
+int printf (const char *format, ...) {
+}
+
+#endif
+
/* $Log$
-/* Revision 1.35 1997/07/18 14:28:34 curt
-/* Hacked in some support for wind/turbulence.
+/* Revision 1.36 1997/07/18 23:41:25 curt
+/* Tweaks for building with Cygnus Win32 compiler.
/*
+ * Revision 1.35 1997/07/18 14:28:34 curt
+ * Hacked in some support for wind/turbulence.
+ *
* Revision 1.34 1997/07/16 20:04:48 curt
* Minor tweaks to aid Win32 port.
*
all: $(TARGET)
clean:
- rm -f *.o $(TARGET) lib*.a *~ core
+ rm -f *.o $(TARGET) $(TARGET).exe lib*.a *~ core
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------
# $Log$
+# Revision 1.22 1997/07/18 23:41:25 curt
+# Tweaks for building with Cygnus Win32 compiler.
+#
# Revision 1.21 1997/07/05 20:43:34 curt
# renamed mat3 directory to Math so we could add other math related routines.
#
**************************************************************************/
-#ifdef __CYGWIN32__
+#ifdef WIN32
# include <windows.h>
#endif
#include "../Math/polar.h"
+#ifndef USE_RAND
+# ifdef sgi
+# undef RAND_MAX
+# define RAND_MAX 2147483647
+# endif
+#endif
+
+
/* The following routine is a real hack used for testing puposes only
* and should probably be removed. */
void mesh_make_test_object(double lon, double lat) {
}
*/
+/*
#ifdef USE_RAND
srand(time(&t));
#else
srandom(time(&t));
#endif
+*/
for ( i = 0; i < 200; i++ ) {
#ifdef USE_RAND
/* $Log$
-/* Revision 1.35 1997/07/18 14:28:35 curt
-/* Hacked in some support for wind/turbulence.
+/* Revision 1.36 1997/07/18 23:41:25 curt
+/* Tweaks for building with Cygnus Win32 compiler.
/*
+ * Revision 1.35 1997/07/18 14:28:35 curt
+ * Hacked in some support for wind/turbulence.
+ *
* Revision 1.34 1997/07/16 20:04:50 curt
* Minor tweaks to aid Win32 port.
*
# include <malloc.h>
#endif
-#ifdef __CYGWIN32__
+#ifdef WIN32
# include <windows.h>
#endif
if ( dx > dy ) {
/* lower triangle */
- printf(" Lower triangle\n");
+ /* printf(" Lower triangle\n"); */
x1 = xindex;
y1 = yindex;
y3 = yindex + skip;
z3 = eg.mesh_data[y3 * eg.cols + x3];
- printf(" dx = %.2f dy = %.2f\n", dx, dy);
+ /* printf(" dx = %.2f dy = %.2f\n", dx, dy);
printf(" (x1,y1,z1) = (%d,%d,%d)\n", x1, y1, z1);
printf(" (x2,y2,z2) = (%d,%d,%d)\n", x2, y2, z2);
- printf(" (x3,y3,z3) = (%d,%d,%d)\n", x3, y3, z3);
+ printf(" (x3,y3,z3) = (%d,%d,%d)\n", x3, y3, z3); */
zA = dx * (z2 - z1) / skip + z1;
zB = dx * (z3 - z1) / skip + z1;
- printf(" zA = %.2f zB = %.2f\n", zA, zB);
+ /* printf(" zA = %.2f zB = %.2f\n", zA, zB); */
if ( dx > EPSILON ) {
elev = dy * (zB - zA) / dx + zA;
}
} else {
/* upper triangle */
- printf(" Upper triangle\n");
+ /* printf(" Upper triangle\n"); */
x1 = xindex;
y1 = yindex;
y3 = yindex + skip;
z3 = eg.mesh_data[y3 * eg.cols + x3];
- printf(" dx = %.2f dy = %.2f\n", dx, dy);
+ /* printf(" dx = %.2f dy = %.2f\n", dx, dy);
printf(" (x1,y1,z1) = (%d,%d,%d)\n", x1, y1, z1);
printf(" (x2,y2,z2) = (%d,%d,%d)\n", x2, y2, z2);
- printf(" (x3,y3,z3) = (%d,%d,%d)\n", x3, y3, z3);
+ printf(" (x3,y3,z3) = (%d,%d,%d)\n", x3, y3, z3); */
zA = dy * (z2 - z1) / skip + z1;
zB = dy * (z3 - z1) / skip + z1;
- printf(" zA = %.2f zB = %.2f\n", zA, zB );
- printf(" xB - xA = %.2f\n", eg.col_step * dy / eg.row_step);
+ /* printf(" zA = %.2f zB = %.2f\n", zA, zB );
+ printf(" xB - xA = %.2f\n", eg.col_step * dy / eg.row_step); */
if ( dy > EPSILON ) {
elev = dx * (zB - zA) / dy + zA;
/* $Log$
-/* Revision 1.16 1997/07/16 20:04:51 curt
-/* Minor tweaks to aid Win32 port.
+/* Revision 1.17 1997/07/18 23:41:26 curt
+/* Tweaks for building with Cygnus Win32 compiler.
/*
+ * Revision 1.16 1997/07/16 20:04:51 curt
+ * Minor tweaks to aid Win32 port.
+ *
* Revision 1.15 1997/07/14 16:26:04 curt
* Testing/playing -- placed objects randomly across the entire terrain.
*
**************************************************************************/
-#ifdef __CYGWIN32__
+#ifdef WIN32
# include <windows.h>
#endif
/* Initialize the Scenery Management system */
void fgSceneryInit() {
/* set the default terrain detail level */
- cur_scenery_params.terrain_skip = 20;
+ cur_scenery_params.terrain_skip = 10;
}
/* $Log$
-/* Revision 1.7 1997/07/16 20:04:52 curt
-/* Minor tweaks to aid Win32 port.
+/* Revision 1.8 1997/07/18 23:41:27 curt
+/* Tweaks for building with Cygnus Win32 compiler.
/*
+ * Revision 1.7 1997/07/16 20:04:52 curt
+ * Minor tweaks to aid Win32 port.
+ *
* Revision 1.6 1997/07/14 16:26:05 curt
* Testing/playing -- placed objects randomly across the entire terrain.
*
tar: clean
(cd ../..; \
- tar cvf prototype-0.05.tar FlightGear/COPYING FlightGear/Docs \
+ tar cvf prototype-$(VERSION).tar FlightGear/COPYING FlightGear/Docs \
FlightGear/Src FlightGear/Thanks)
zip: clean
(cd ../..; \
- zip -r prototype-0.05.zip FlightGear/COPYING FlightGear/Docs \
+ zip -r prototype-$(VERSION).zip FlightGear/COPYING FlightGear/Docs \
FlightGear/Src FlightGear/Thanks)
#---------------------------------------------------------------------------
# $Log$
+# Revision 1.17 1997/07/18 23:41:20 curt
+# Tweaks for building with Cygnus Win32 compiler.
+#
# Revision 1.16 1997/07/07 20:59:47 curt
# Working on scenery transformations to enable us to fly fluidly over the
# poles with no discontinuity/distortion in scenery.
#---------------------------------------------------------------------------
+VERSION = 0.07
+
#---------------------------------------------------------------------------
# Choose your weapons
#---------------------------------------------------------------------------
#
# -O2 - Enable compiler optimization
#
+#---------------------------------------------------------------------------
+
+GLOBAL_CFLAGS = -g -Wall
+
+
+#---------------------------------------------------------------------------
+# Platform specific compile options, these should be set with FG_CFLAGS
+# below. These have been predefined for the supported platforms below.
+#
+# -DNO_PRINTF - Disable all printf()'s. Works by replacing the printf
+# fuction with an empty function.
+#
# -DUSE_ITIMER - Use setitimer(), getitimer(), and signal() to mimic
# a real time system and call the flight model routines
# at a regular interval, rather than between screen updates
#
#---------------------------------------------------------------------------
-FG_CFLAGS = -g -Wall
-
#---------------------------------------------------------------------------
# Uncomment one of the following sections depending on your system
# INTERFACE_LIBS = -lglut
# INTERFACE_FILES = GLUTkey.c
# GRAPHICS_LIBS = -lGLU -lGL -lXmu -lX11
+# FG_CFLAGS = $(GLOBAL_CFLAGS)
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------
# Linux/Mesa with the GLUT toolkit
#
-INTERFACE_FLAGS = -DGLUT
-INTERFACE_LIBS = -lglut
-INTERFACE_FILES = GLUTkey.c
-MESA_LIBS = -L/usr/lib/mesa -lMesatk -lMesaaux -lMesaGLU -lMesaGL
-X11_LIBS = -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11
-GRAPHICS_LIBS = $(MESA_LIBS) $(X11_LIBS)
+# INTERFACE_FLAGS = -DGLUT
+# INTERFACE_LIBS = -lglut
+# INTERFACE_FILES = GLUTkey.c
+# MESA_LIBS = -L/usr/lib/mesa -lMesatk -lMesaaux -lMesaGLU -lMesaGL
+# X11_LIBS = -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11
+# GRAPHICS_LIBS = $(MESA_LIBS) $(X11_LIBS)
+# FG_CFLAGS = $(GLOBAL_CFLAGS)
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------
-# Cygnus Win32 (gcc based) with the GLUT toolkit
+# Cygnus Win32 (gcc based) with a static version of the GLUT toolkit
#
-# INTERFACE_FLAGS = -DGLUT
-# INTERFACE_LIBS = -Wl,--subsystem,windows -L. -lglut
-# INTERFACE_FILES = GLUTkey.c
-# GRAPHICS_LIBS = -lglu32 -lopengl32
+INTERFACE_FLAGS = -DGLUT
+INTERFACE_LIBS = ../Win32/libglut.a
+INTERFACE_FILES = GLUTkey.c
+GRAPHICS_LIBS = -lglu32 -lopengl32 -luser32 -lgdi32
+FG_CFLAGS = $(GLOBAL_CFLAGS) -DWIN32 -DUSE_RAND
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------
# $Log$
+# Revision 1.8 1997/07/18 23:41:20 curt
+# Tweaks for building with Cygnus Win32 compiler.
+#
# Revision 1.7 1997/07/18 14:28:34 curt
# Hacked in some support for wind/turbulence.
#