Tweaks for building with Cygnus Win32 compiler.
This commit is contained in:
parent
ff2636c4f8
commit
6ef6f4d986
9 changed files with 182 additions and 59 deletions
|
@ -44,7 +44,7 @@ simtest: $(TARGET) LaRCsim.o
|
|||
all: $(TARGET)
|
||||
|
||||
clean:
|
||||
rm -f *.o $(TARGET) *~ core
|
||||
rm -f *.o $(TARGET) lib*.a *~ core
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
@ -56,6 +56,9 @@ include depend
|
|||
|
||||
#---------------------------------------------------------------------------
|
||||
# $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.
|
||||
#
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef __CYGWIN32__
|
||||
#ifdef WIN32
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
|
@ -49,9 +49,10 @@ void GLUTkey(unsigned char k, int x, int y) {
|
|||
|
||||
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;
|
||||
|
@ -79,6 +80,7 @@ void GLUTkey(unsigned char k, int x, int y) {
|
|||
return;
|
||||
}
|
||||
} else {
|
||||
printf("\n");
|
||||
switch (k) {
|
||||
case 50: /* numeric keypad 2 */
|
||||
fgElevMove(-0.05);
|
||||
|
@ -139,30 +141,86 @@ void GLUTspecialkey(int k, int x, int y) {
|
|||
|
||||
c = ¤t_aircraft.controls;
|
||||
|
||||
printf("Special key hit = %d\n", k);
|
||||
printf("Special key hit = %d", 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;
|
||||
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
|
||||
*
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef __CYGWIN32__
|
||||
#ifdef WIN32
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
|
@ -417,6 +417,14 @@ static void fgMainLoop( void ) {
|
|||
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;
|
||||
|
@ -460,7 +468,7 @@ int main( int argc, char *argv[] ) {
|
|||
|
||||
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");*/
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
|
@ -627,11 +635,22 @@ int main( int argc, char *argv[] ) {
|
|||
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.
|
||||
*
|
||||
|
|
|
@ -52,7 +52,7 @@ $(TARGET): $(OFILES) $(AFILES)
|
|||
all: $(TARGET)
|
||||
|
||||
clean:
|
||||
rm -f *.o $(TARGET) lib*.a *~ core
|
||||
rm -f *.o $(TARGET) $(TARGET).exe lib*.a *~ core
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
@ -76,6 +76,9 @@ mesh2GL.o:
|
|||
|
||||
#---------------------------------------------------------------------------
|
||||
# $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.
|
||||
#
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
**************************************************************************/
|
||||
|
||||
|
||||
#ifdef __CYGWIN32__
|
||||
#ifdef WIN32
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
|
@ -40,6 +40,14 @@
|
|||
#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) {
|
||||
|
@ -188,11 +196,13 @@ GLint mesh2GL(struct mesh *m) {
|
|||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
#ifdef USE_RAND
|
||||
srand(time(&t));
|
||||
#else
|
||||
srandom(time(&t));
|
||||
#endif
|
||||
*/
|
||||
|
||||
for ( i = 0; i < 200; i++ ) {
|
||||
#ifdef USE_RAND
|
||||
|
@ -214,9 +224,12 @@ GLint mesh2GL(struct mesh *m) {
|
|||
|
||||
|
||||
/* $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.
|
||||
*
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
# include <malloc.h>
|
||||
#endif
|
||||
|
||||
#ifdef __CYGWIN32__
|
||||
#ifdef WIN32
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
|
@ -197,7 +197,7 @@ double mesh_altitude(double lon, double lat) {
|
|||
|
||||
if ( dx > dy ) {
|
||||
/* lower triangle */
|
||||
printf(" Lower triangle\n");
|
||||
/* printf(" Lower triangle\n"); */
|
||||
|
||||
x1 = xindex;
|
||||
y1 = yindex;
|
||||
|
@ -211,15 +211,15 @@ double mesh_altitude(double lon, double lat) {
|
|||
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;
|
||||
|
@ -228,7 +228,7 @@ double mesh_altitude(double lon, double lat) {
|
|||
}
|
||||
} else {
|
||||
/* upper triangle */
|
||||
printf(" Upper triangle\n");
|
||||
/* printf(" Upper triangle\n"); */
|
||||
|
||||
x1 = xindex;
|
||||
y1 = yindex;
|
||||
|
@ -242,16 +242,16 @@ double mesh_altitude(double lon, double lat) {
|
|||
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;
|
||||
|
@ -265,9 +265,12 @@ double mesh_altitude(double lon, double lat) {
|
|||
|
||||
|
||||
/* $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.
|
||||
*
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
**************************************************************************/
|
||||
|
||||
|
||||
#ifdef __CYGWIN32__
|
||||
#ifdef WIN32
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
|
@ -45,7 +45,7 @@ struct scenery_params cur_scenery_params;
|
|||
/* 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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -69,9 +69,12 @@ void fgSceneryRender() {
|
|||
|
||||
|
||||
/* $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.
|
||||
*
|
||||
|
|
|
@ -52,17 +52,20 @@ clean:
|
|||
|
||||
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.
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
#---------------------------------------------------------------------------
|
||||
|
||||
|
||||
VERSION = 0.07
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Choose your weapons
|
||||
#---------------------------------------------------------------------------
|
||||
|
@ -48,6 +50,18 @@ RANLIB = ranlib
|
|||
#
|
||||
# -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
|
||||
|
@ -61,8 +75,6 @@ RANLIB = ranlib
|
|||
#
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
FG_CFLAGS = -g -Wall
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Uncomment one of the following sections depending on your system
|
||||
|
@ -80,31 +92,37 @@ FG_CFLAGS = -g -Wall
|
|||
# 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.
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue