/* Draw the Stars */
void fgStarsRender( void ) {
- struct fgFLIGHT *f;
+ fgFLIGHT *f;
struct fgVIEW *v;
struct fgLIGHT *l;
struct fgTIME *t;
int i;
- f = ¤t_aircraft.flight;
+ f = current_aircraft.flight;
l = &cur_light_params;
t = &cur_time_params;
v = ¤t_view;
/* $Log$
-/* Revision 1.6 1998/02/02 20:53:23 curt
-/* To version 0.29
+/* Revision 1.7 1998/02/09 15:07:48 curt
+/* Minor tweaks.
/*
+ * Revision 1.6 1998/02/02 20:53:23 curt
+ * To version 0.29
+ *
* Revision 1.5 1998/01/27 18:35:53 curt
* Minor tweaks.
*
{
Hptr hud;
+ fgPrintf( FG_COCKPIT, FG_INFO, "Initializing HUD\n" );
+
hud = (Hptr)calloc(sizeof( HUD),1);
if( hud == NULL )
return( NULL );
return( hud );
}
+
// add_instrument
//
// This is a stand in for linked list code that will get replaced later
// by some more elegant list handling code.
-void add_instrument( Hptr hud, HIptr pinstrument )
-{
- if( !hud || !pinstrument ) {
- return;
+void add_instrument( Hptr hud, HIptr pinstrument ) {
+ if( !hud || !pinstrument ) {
+ return;
}
- pinstrument->next = hud->instruments;
- hud->instruments = pinstrument;
+
+ pinstrument->next = hud->instruments;
+ hud->instruments = pinstrument;
}
+
// fgHUDAddHorizon
//
// Constructs a HUD_horizon "object" and installs it into the hud instrument
int hole_len, \
double (*load_value)() )
{
- HUD_horizon *phorizon;
- HUD_instr *pinstrument;
+ HUD_horizon *phorizon;
+ HUD_instr *pinstrument;
- if( !hud ) {
- return NULL;
+ if( !hud ) {
+ return NULL;
}
// construct the parent object
- pinstrument = (HIptr)calloc(sizeof(HUD_instr),1);
- if( pinstrument == NULL ) {
- return( NULL );
+ pinstrument = (HIptr)calloc(sizeof(HUD_instr),1);
+ if( pinstrument == NULL ) {
+ return( NULL );
}
- pinstrument->type = HUDhorizon; // ARTIFICIAL_HORIZON;
+ pinstrument->type = HUDhorizon; // ARTIFICIAL_HORIZON;
// Construct the horizon
- phorizon = (HUD_horizon *) calloc( sizeof(HUD_horizon),1);
- if( phorizon == NULL ) {
- return( NULL );
+ phorizon = (HUD_horizon *) calloc( sizeof(HUD_horizon),1);
+ if( phorizon == NULL ) {
+ return( NULL );
}
- phorizon->x_pos = x_pos;
- phorizon->y_pos = y_pos;
- phorizon->scr_width = length;
- phorizon->scr_hole = hole_len;
- phorizon->load_value = load_value;
- // Install the horizon in the parent.
- pinstrument->instr = phorizon;
+ phorizon->x_pos = x_pos;
+ phorizon->y_pos = y_pos;
+ phorizon->scr_width = length;
+ phorizon->scr_hole = hole_len;
+ phorizon->load_value = load_value;
+ // Install the horizon in the parent.
+ pinstrument->instr = phorizon;
// Install the instrument into hud.
- add_instrument( hud, pinstrument);
+ add_instrument( hud, pinstrument);
- return( hud );
+ return( hud );
}
// fgHUDAddScale
// all C++.
//
-void fgUpdateHUD( Hptr hud )
-{
- HIptr phud_instr;
+void fgUpdateHUD( Hptr hud ) {
+ HIptr phud_instr;
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
+ glMatrixMode(GL_PROJECTION);
+ glPushMatrix();
- glLoadIdentity();
- gluOrtho2D(0, 640, 0, 480);
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
- glLoadIdentity();
+ glLoadIdentity();
+ gluOrtho2D(0, 640, 0, 480);
+ glMatrixMode(GL_MODELVIEW);
+ glPushMatrix();
+ glLoadIdentity();
- glColor3f(1.0, 1.0, 1.0);
- glIndexi(7);
+ glColor3f(1.0, 1.0, 1.0);
+ glIndexi(7);
- glDisable(GL_DEPTH_TEST);
- glDisable(GL_LIGHTING);
+ glDisable(GL_DEPTH_TEST);
+ glDisable(GL_LIGHTING);
- glLineWidth(1);
- glColor3f (0.1, 0.9, 0.1);
+ glLineWidth(1);
+ glColor3f (0.1, 0.9, 0.1);
- fgPrintf( FG_COCKPIT, FG_DEBUG,
- "HUD Code %d Status %d\n",
- hud->code, hud->status );
+ fgPrintf( FG_COCKPIT, FG_DEBUG,
+ "HUD Code %d Status %d\n",
+ hud->code, hud->status );
- phud_instr = hud->instruments;
- while( phud_instr ) {
- switch (phud_instr->type){
- case HUDhorizon: // ARTIFICIAL HORIZON
- drawhorizon( (pHUDhorizon)phud_instr );
- break;
+ phud_instr = hud->instruments;
+ while( phud_instr ) {
+ /* printf("Drawing Instrument %d\n", phud_instr->type); */
- case HUDscale: // Need to simplify this call.
- drawscale ( (pHUDscale) phud_instr );
- break;
+ switch (phud_instr->type){
+ case HUDhorizon: // ARTIFICIAL HORIZON
+ drawhorizon( (pHUDhorizon)phud_instr->instr );
+ break;
+
+ case HUDscale: // Need to simplify this call.
+ drawscale ( (pHUDscale) phud_instr->instr );
+ break;
- case HUDlabel:
- drawlabel ( (pHUDlabel) phud_instr );
- break;
+ case HUDlabel:
+ drawlabel ( (pHUDlabel) phud_instr->instr );
+ break;
- case HUDladder:
- drawladder( (pHUDladder) phud_instr );
- break;
+ case HUDladder:
+ drawladder( (pHUDladder) phud_instr->instr );
+ break;
- case HUDcontrols:
- drawControlSurfaces( (pHUDControlSurface) phud_instr );
- default:; // Ignore anything you don't know about.
- }
- phud_instr = phud_instr->next;
- }
+ case HUDcontrols:
+ drawControlSurfaces( (pHUDControlSurface) phud_instr->instr );
+
+ default:; // Ignore anything you don't know about.
+ }
- glEnable(GL_DEPTH_TEST);
- glEnable(GL_LIGHTING);
- glMatrixMode(GL_PROJECTION);
- glPopMatrix();
- glMatrixMode(GL_MODELVIEW);
- glPopMatrix();
+ phud_instr = phud_instr->next;
+ }
+ glEnable(GL_DEPTH_TEST);
+ glEnable(GL_LIGHTING);
+ glMatrixMode(GL_PROJECTION);
+ glPopMatrix();
+ glMatrixMode(GL_MODELVIEW);
+ glPopMatrix();
}
/* $Log$
-/* Revision 1.11 1998/02/07 15:29:34 curt
-/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
-/* <chotchkiss@namg.us.anritsu.com>
+/* Revision 1.12 1998/02/09 15:07:48 curt
+/* Minor tweaks.
/*
+ * Revision 1.11 1998/02/07 15:29:34 curt
+ * Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+ * <chotchkiss@namg.us.anritsu.com>
+ *
* Revision 1.10 1998/02/03 23:20:14 curt
* Lots of little tweaks to fix various consistency problems discovered by
* Solaris' CC. Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
xglPopMatrix();
/* draw scenery */
- xglShadeModel( GL_SMOOTH );
+ xglShadeModel( GL_FLAT /* GL_SMOOTH */ );
xglEnable( GL_DEPTH_TEST );
xglEnable( GL_FOG );
xglFogfv (GL_FOG_COLOR, l->fog_color);
#endif
/* $Log$
-/* Revision 1.57 1998/02/07 15:29:40 curt
-/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
-/* <chotchkiss@namg.us.anritsu.com>
+/* Revision 1.58 1998/02/09 15:07:49 curt
+/* Minor tweaks.
/*
+ * Revision 1.57 1998/02/07 15:29:40 curt
+ * Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+ * <chotchkiss@namg.us.anritsu.com>
+ *
* Revision 1.56 1998/02/03 23:20:23 curt
* Lots of little tweaks to fix various consistency problems discovered by
* Solaris' CC. Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
/* FG_Altitude = FG_Runway_altitude + 3.758099; */
/* Initial Position: Somewhere near the Grand Canyon */
- FG_Longitude = ( -112.5 ) * DEG_TO_RAD;
- FG_Latitude = ( 36.5 ) * DEG_TO_RAD;
- FG_Runway_altitude = 5000.0;
- FG_Altitude = FG_Runway_altitude + 3.758099;
+ /* FG_Longitude = ( -112.5 ) * DEG_TO_RAD; */
+ /* FG_Latitude = ( 36.5 ) * DEG_TO_RAD; */
+ /* FG_Runway_altitude = 5000.0; */
+ /* FG_Altitude = FG_Runway_altitude + 3.758099; */
/* A random test position */
/* FG_Longitude = ( 88128.00 / 3600.0 ) * DEG_TO_RAD; */
/* $Log$
-/* Revision 1.40 1998/02/07 15:29:44 curt
-/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
-/* <chotchkiss@namg.us.anritsu.com>
+/* Revision 1.41 1998/02/09 15:07:50 curt
+/* Minor tweaks.
/*
+ * Revision 1.40 1998/02/07 15:29:44 curt
+ * Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+ * <chotchkiss@namg.us.anritsu.com>
+ *
* Revision 1.39 1998/02/03 23:20:25 curt
* Lots of little tweaks to fix various consistency problems discovered by
* Solaris' CC. Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
/* printf(" Alt Up = (%.4f, %.4f, %.4f)\n",
alt_up.x, alt_up.y, alt_up.z); */
- /* Derive the VIEW matrix */
+ /* Calculate the VIEW matrix */
MAT3mult(VIEW, LOCAL, UP);
/* printf("VIEW matrix\n"); */
/* MAT3print(VIEW, stdout); */
/* $Log$
-/* Revision 1.13 1998/02/07 15:29:45 curt
-/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
-/* <chotchkiss@namg.us.anritsu.com>
+/* Revision 1.14 1998/02/09 15:07:50 curt
+/* Minor tweaks.
/*
+ * Revision 1.13 1998/02/07 15:29:45 curt
+ * Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+ * <chotchkiss@namg.us.anritsu.com>
+ *
* Revision 1.12 1998/01/29 00:50:28 curt
* Added a view record field for absolute x, y, z position.
*
}
/* printf(" p->lat = %d\n", p->lat); */
- p->x = (lon - p->lon) * 8;
- p->y = (lat - p->lat) * 8;
+ p->x = (int)((lon - p->lon) * 8);
+ p->y = (int)((lat - p->lat) * 8);
/* printf( "Bucket = lon,lat = %d,%d x,y index = %d,%d\n",
p->lon, p->lat, p->x, p->y); */
}
/* $Log$
-/* Revision 1.5 1998/01/29 00:51:38 curt
-/* First pass at tile cache, dynamic tile loading and tile unloading now works.
+/* Revision 1.6 1998/02/09 15:07:51 curt
+/* Minor tweaks.
/*
+ * Revision 1.5 1998/01/29 00:51:38 curt
+ * First pass at tile cache, dynamic tile loading and tile unloading now works.
+ *
* Revision 1.4 1998/01/27 03:26:41 curt
* Playing with new fgPrintf command.
*
#define MAXNODES 100000
-double nodes[MAXNODES][3];
-double normals[MAXNODES][3];
+static double nodes[MAXNODES][3];
+static double normals[MAXNODES][3];
/* given three points defining a triangle, calculate the normal */
GLint tile;
FILE *f;
int first, ncount, vncount, n1, n2, n3, n4;
- static int use_vertex_norms = 1;
+ static int use_vertex_norms = 0;
int winding;
int last1, last2, odd;
/* $Log$
-/* Revision 1.22 1998/02/01 03:39:54 curt
+/* Revision 1.23 1998/02/09 15:07:52 curt
/* Minor tweaks.
/*
+ * Revision 1.22 1998/02/01 03:39:54 curt
+ * Minor tweaks.
+ *
* Revision 1.21 1998/01/31 00:43:25 curt
* Added MetroWorks patches from Carmen Volpe.
*
#---------------------------------------------------------------------------
FG_VERSION_MAJOR = 0
-FG_VERSION_MINOR = 31
+FG_VERSION_MINOR = 32
FG_VERSION = $(FG_VERSION_MAJOR).$(FG_VERSION_MINOR)
# Choose your weapons
#---------------------------------------------------------------------------
-CC = gcc
-CXX = gcc
+CC = g++
+CXX = g++
LD = ld
AR = ar
RANLIB = ranlib
c = (long)(365.25*y) - 694025L;
}
- d = 30.6001*(m+1);
+ d = (int)(30.6001*(m+1));
mjd = b + c + d + dy - 0.5;
/* $Log$
-/* Revision 1.34 1998/02/07 15:29:47 curt
-/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
-/* <chotchkiss@namg.us.anritsu.com>
+/* Revision 1.35 1998/02/09 15:07:52 curt
+/* Minor tweaks.
/*
+ * Revision 1.34 1998/02/07 15:29:47 curt
+ * Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+ * <chotchkiss@namg.us.anritsu.com>
+ *
* Revision 1.33 1998/02/02 20:54:04 curt
* Incorporated Durk's changes.
*
A = y / 100;
B = 2 - A + (A / 4);
- C = 365.25 * y;
- D = 30.6001 * (m + 1);
+ C = (int)(365.25 * y);
+ D = (int)(30.6001 * (m + 1));
JD = B + C + D + d + 1720994.5;
/* $Log$
-/* Revision 1.24 1998/01/27 00:48:07 curt
-/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
-/* system and commandline/config file processing code.
+/* Revision 1.25 1998/02/09 15:07:53 curt
+/* Minor tweaks.
/*
+ * Revision 1.24 1998/01/27 00:48:07 curt
+ * Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+ * system and commandline/config file processing code.
+ *
* Revision 1.23 1998/01/19 19:27:21 curt
* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
* This should simplify things tremendously.
/* temporarily remove the code of this do-nothing routine */
#ifdef FG_WEATHER_UPDATE
- struct fgFLIGHT *f;
+ fgFLIGHT *f;
struct fgWEATHER *w;
- f = ¤t_aircraft.flight;
+ f = current_aircraft.flight;
w = ¤t_weather;
/* Add some random turbulence */
/* $Log$
-/* Revision 1.13 1998/01/27 00:48:08 curt
-/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
-/* system and commandline/config file processing code.
+/* Revision 1.14 1998/02/09 15:07:54 curt
+/* Minor tweaks.
/*
+ * Revision 1.13 1998/01/27 00:48:08 curt
+ * Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+ * system and commandline/config file processing code.
+ *
* Revision 1.12 1998/01/19 19:27:22 curt
* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
* This should simplify things tremendously.