struct fgCOCKPIT *cockpit;
Hptr hud;
+ printf("Initializing cockpit subsystem\n");
+
cockpit = (struct fgCOCKPIT *)calloc(sizeof(struct fgCOCKPIT),1);
if( cockpit == NULL )
return( NULL );
aircraft_cockpit = cockpit;
- printf( "Code %d Status %d\n", cockpit->hud->code, cockpit->hud->status );
+ printf(" Code %d Status %d\n", cockpit->hud->code,
+ cockpit->hud->status );
return( cockpit );
}
/* $Log$
-/* Revision 1.3 1997/12/15 23:54:33 curt
-/* Add xgl wrappers for debugging.
-/* Generate terrain normals on the fly.
+/* Revision 1.4 1997/12/30 20:47:34 curt
+/* Integrated new event manager with subsystem initializations.
/*
+ * Revision 1.3 1997/12/15 23:54:33 curt
+ * Add xgl wrappers for debugging.
+ * Generate terrain normals on the fly.
+ *
* Revision 1.2 1997/12/10 22:37:38 curt
* Prepended "fg" on the name of all global structures that didn't have it yet.
* i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
int fgFlightModelInit(int model, struct fgFLIGHT *f, double dt) {
int result;
+ printf("Initializing flight model\n");
+
if ( model == FG_LARCSIM ) {
fgFlight_2_LaRCsim(f); /* translate FG to LaRCsim structure */
fgLaRCsimInit(dt);
/* $Log$
-/* Revision 1.4 1997/12/10 22:37:42 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.5 1997/12/30 20:47:37 curt
+/* Integrated new event manager with subsystem initializations.
/*
+ * Revision 1.4 1997/12/10 22:37:42 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.3 1997/08/27 03:30:04 curt
* Changed naming scheme of basic shared structures.
*
static int joystick_fd;
-int fgJoystickInit( int joy_num )
-{
+int fgJoystickInit( int joy_num ) {
+ printf("Initializing joystick\n");
+
#ifdef HAVE_JOYSTICK
int status;
char *fname;
/* $Log$
-/* Revision 1.1 1997/08/29 18:06:54 curt
-/* Initial revision.
+/* Revision 1.2 1997/12/30 20:47:40 curt
+/* Integrated new event manager with subsystem initializations.
/*
+ * Revision 1.1 1997/08/29 18:06:54 curt
+ * Initial revision.
+ *
*/
fgSceneryRender();
/* display HUD */
- /* if( show_hud ) {
+ if( show_hud ) {
fgCockpitUpdate();
- } */
+ }
/* display instruments */
if (displayInstruments) {
}
*/
+
/* What should we do when we have nothing else to do? How about get
* ready for the next move and update the display? */
static void fgMainLoop( void ) {
printf("Model iterations needed = %d, new remainder = %d\n", multi_loop,
remainder);
+ /* Run flight model */
if ( ! use_signals ) {
/* flight model */
fgUpdateTimeDepCalcs(multi_loop);
fgAircraftOutputCurrent(a);
+ /* Process/manage pending events */
+ fgEventProcess();
+
/* redraw display */
fgRenderFrame();
}
/* $Log$
-/* Revision 1.42 1997/12/30 16:36:47 curt
-/* Merged in Durk's changes ...
+/* Revision 1.43 1997/12/30 20:47:43 curt
+/* Integrated new event manager with subsystem initializations.
/*
+ * Revision 1.42 1997/12/30 16:36:47 curt
+ * Merged in Durk's changes ...
+ *
* Revision 1.41 1997/12/30 13:06:56 curt
* A couple lighting tweaks ...
*
#include "../Scenery/sky.h"
#include "../Scenery/stars.h"
#include "../Scenery/sun.h"
+#include "../Time/event.h"
#include "../Time/fg_time.h"
#include "../Time/sunpos.h"
#include "../Weather/weather.h"
g = &general;
+ printf("General Initialization\n");
+ printf("======= ==============\n");
+
/* seed the random number generater */
fg_srandom();
exit(0);
}
printf("FG_ROOT = %s\n", g->root_dir);
+
+ printf("\n");
}
t = &cur_time_params;
v = ¤t_view;
+ printf("Initialize Subsystems\n");
+ printf("========== ==========\n");
/****************************************************************
* The following section sets up the flight model EOM parameters and
/* fgSlewInit(-335340,162540, 15, 4.38); */
/* fgSlewInit(-398673.28,120625.64, 53, 4.38); */
+ /* Initialize the event manager */
+ fgEventInit();
+
+ /* Dump event stats every 60 seconds */
+ fgEventRegister( "fgEventPrintStats()", fgEventPrintStats,
+ FG_EVENT_READY, 60000 );
+
/* Initialize "time" */
fgTimeInit(t);
fgTimeUpdate(f, t);
/* Initialize shared sun position and sun_vec */
- fgUpdateSunPos(scenery.center);
+ fgEventRegister( "fgUpdateSunPos()", fgUpdateSunPos, FG_EVENT_READY, 1000 );
/* Initialize view parameters */
fgViewInit(v);
fgWeatherInit();
/* Initialize the Cockpit subsystem */
- /*
- if( fgCockpitInit( current_aircraft ) == NULL )
- {
+ if( fgCockpitInit( current_aircraft ) == NULL ) {
printf( "Error in Cockpit initialization!\n" );
exit( 1 );
}
- */
/* Initialize the orbital elements of sun, moon and mayor planets */
fgSolarSystemInit(*t);
* eventually */
cur_elev = mesh_altitude(FG_Longitude * RAD_TO_DEG * 3600.0,
FG_Latitude * RAD_TO_DEG * 3600.0);
- printf("Ground elevation is %.2f meters here.\n", cur_elev);
+ printf("True ground elevation is %.2f meters here.\n", cur_elev);
if ( cur_elev > -9990.0 ) {
FG_Runway_altitude = cur_elev * METER_TO_FEET;
}
if ( FG_Altitude < FG_Runway_altitude ) {
FG_Altitude = FG_Runway_altitude + 3.758099;
}
- printf("Updated position is: (%.4f, %.4f, %.2f)\n",
+ printf("Updated position (after elevation adj): (%.4f, %.4f, %.2f)\n",
FG_Latitude * RAD_TO_DEG, FG_Longitude * RAD_TO_DEG,
FG_Altitude * FEET_TO_METER);
/* end of thing that I just stuck in that I should probably move */
fgFlightModelInit( FG_LARCSIM, f, 1.0 / DEFAULT_MODEL_HZ );
/* To HUD or not to HUD */
- show_hud = 1;
+ show_hud = 0;
/* Let's show the instrument panel */
- displayInstruments = 1;
+ displayInstruments = 0;
/* Joystick support */
fgJoystickInit( 0 );
+
+ printf("\n");
}
/* $Log$
-/* Revision 1.23 1997/12/30 16:36:50 curt
-/* Merged in Durk's changes ...
+/* Revision 1.24 1997/12/30 20:47:44 curt
+/* Integrated new event manager with subsystem initializations.
/*
+ * Revision 1.23 1997/12/30 16:36:50 curt
+ * Merged in Durk's changes ...
+ *
* Revision 1.22 1997/12/19 23:34:05 curt
* Lot's of tweaking with sky rendering and lighting.
*
/* Initialize a view structure */
void fgViewInit(struct fgVIEW *v) {
+ printf("Initializing View parameters\n");
+
v->view_offset = 0.0;
v->goal_view_offset = 0.0;
}
/* $Log$
-/* Revision 1.6 1997/12/22 04:14:32 curt
-/* Aligned sky with sun so dusk/dawn effects can be correct relative to the sun.
+/* Revision 1.7 1997/12/30 20:47:45 curt
+/* Integrated new event manager with subsystem initializations.
/*
+ * Revision 1.6 1997/12/22 04:14:32 curt
+ * Aligned sky with sun so dusk/dawn effects can be correct relative to the sun.
+ *
* Revision 1.5 1997/12/18 04:07:02 curt
* Worked on properly translating and positioning the sky dome.
*
struct fgLIGHT *l;
static int dl_exists = 0;
+ printf("Initializing the Moon\n");
+
l = &cur_light_params;
/* position the moon */
/* $Log$
-/* Revision 1.13 1997/12/30 16:41:00 curt
-/* Added log at end of file.
+/* Revision 1.14 1997/12/30 20:47:50 curt
+/* Integrated new event manager with subsystem initializations.
/*
+ * Revision 1.13 1997/12/30 16:41:00 curt
+ * Added log at end of file.
+ *
*/
while ( fgets(line, 250, f) != NULL ) {
if ( line[0] == '#' ) {
/* comment -- ignore */
+ } else if ( line[0] == '\n' ) {
+ /* empty line -- ignore */
} else if ( strncmp(line, "v ", 2) == 0 ) {
/* node (vertex) */
if ( ncount < MAXNODES ) {
}
} else if ( strncmp(line, "winding ", 8) == 0 ) {
sscanf(line+8, "%s", winding_str);
- printf("WINDING = %s\n", winding_str);
+ printf(" WINDING = %s\n", winding_str);
/* can't call xglFrontFace() between xglBegin() & xglEnd() */
xglEnd();
first = 0;
}
- printf("new tri strip = %s", line);
+ /* printf(" new tri strip = %s", line); */
sscanf(line, "t %d %d %d %d\n", &n1, &n2, &n3, &n4);
/* printf("(t) = "); */
/* $Log$
-/* Revision 1.14 1997/12/30 01:38:46 curt
-/* Switched back to per vertex normals and smooth shading for terrain.
+/* Revision 1.15 1997/12/30 20:47:51 curt
+/* Integrated new event manager with subsystem initializations.
/*
+ * Revision 1.14 1997/12/30 01:38:46 curt
+ * Switched back to per vertex normals and smooth shading for terrain.
+ *
* Revision 1.13 1997/12/18 23:32:36 curt
* First stab at sky dome actually starting to look reasonable. :-)
*
actTime += (UT / 24.0);
#define DEBUG 1
#ifdef DEBUG
- printf("Actual Time:\n");
- printf("current day = %f\t", actTime);
- printf("GMT = %d, %d, %d, %d, %d, %d\n", year, t.gmt->tm_mon, t.gmt->tm_mday,
- t.gmt->tm_hour, t.gmt->tm_min, t.gmt->tm_sec);
+ /* printf(" Actual Time:\n"); */
+ /* printf(" current day = %f\t", actTime); */
+ /* printf(" GMT = %d, %d, %d, %d, %d, %d\n",
+ year, t.gmt->tm_mon, t.gmt->tm_mday,
+ t.gmt->tm_hour, t.gmt->tm_min, t.gmt->tm_sec); */
#endif
return actTime;
}
int i;
FILE *data;
+ printf("Initializing solar system\n");
+
/* build the full path name to the orbital elements database file */
g = &general;
path[0] = '\0';
return;
}
#ifdef DEBUG
- printf("reading datafile %s", path);
+ printf(" reading datafile %s\n", path);
#endif
/* for all the objects... */
/* $Log$
-/* Revision 1.5 1997/12/15 23:55:02 curt
-/* Add xgl wrappers for debugging.
-/* Generate terrain normals on the fly.
+/* Revision 1.6 1997/12/30 20:47:52 curt
+/* Integrated new event manager with subsystem initializations.
/*
+ * Revision 1.5 1997/12/15 23:55:02 curt
+ * Add xgl wrappers for debugging.
+ * Generate terrain normals on the fly.
+ *
* Revision 1.4 1997/12/10 22:37:51 curt
* Prepended "fg" on the name of all global structures that didn't have it yet.
* i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
default:
printf("index %d out of range !!!!\n", idx);
}
- printf("Geocentric dist %f\n"
- "Heliocentric dist %f\n"
- "Distance to the sun %f\n"
- "Phase angle %f\n"
- "Brightness %f\n", R, r, s, FV, result.magnitude);
+ printf(" Planet found at %f (ra), %f (dec)\n",
+ result.RightAscension, result.Declination);
+ printf(" Geocentric dist %f\n"
+ " Heliocentric dist %f\n"
+ " Distance to the sun %f\n"
+ " Phase angle %f\n"
+ " Brightness %f\n", R, r, s, FV, result.magnitude);
return result;
}
/* $Log$
-/* Revision 1.3 1997/12/30 16:36:52 curt
-/* Merged in Durk's changes ...
+/* Revision 1.4 1997/12/30 20:47:52 curt
+/* Integrated new event manager with subsystem initializations.
/*
+ * Revision 1.3 1997/12/30 16:36:52 curt
+ * Merged in Durk's changes ...
+ *
* Revision 1.2 1997/12/12 21:41:29 curt
* More light/material property tweaking ... still a ways off.
*
/* Initialize the Scenery Management system */
void fgSceneryInit() {
+ printf("Initializing scenery subsystem\n");
+
/* set the default terrain detail level */
scenery.terrain_skip = 6;
}
strcat(path, "/Scenery/");
strcat(path, "mesa-e.obj");
- printf("Loading Scenery: %s\n", path);
+ printf(" Loading Scenery: %s\n", path);
area_terrain = fgObjLoad(path);
}
/* $Log$
-/* Revision 1.28 1997/12/15 23:55:02 curt
-/* Add xgl wrappers for debugging.
-/* Generate terrain normals on the fly.
+/* Revision 1.29 1997/12/30 20:47:52 curt
+/* Integrated new event manager with subsystem initializations.
/*
+ * Revision 1.28 1997/12/15 23:55:02 curt
+ * Add xgl wrappers for debugging.
+ * Generate terrain normals on the fly.
+ *
* Revision 1.27 1997/12/12 21:41:30 curt
* More light/material property tweaking ... still a ways off.
*
#include "sky.h"
+#include "../Time/event.h"
#include "../Time/fg_time.h"
#include "../Aircraft/aircraft.h"
float theta;
int i;
- printf("Generating the sky dome vertices.\n");
+ printf(" Generating the sky dome vertices.\n");
for ( i = 0; i < 12; i++ ) {
theta = (i * 30.0) * DEG_TO_RAD;
inner_vertex[i][1] = sin(theta) * INNER_RADIUS;
inner_vertex[i][2] = INNER_ELEV;
- printf(" %.2f %.2f\n", cos(theta) * INNER_RADIUS,
- sin(theta) * INNER_RADIUS);
+ /* printf(" %.2f %.2f\n", cos(theta) * INNER_RADIUS,
+ sin(theta) * INNER_RADIUS); */
middle_vertex[i][0] = cos((double)theta) * MIDDLE_RADIUS;
middle_vertex[i][1] = sin((double)theta) * MIDDLE_RADIUS;
l = &cur_light_params;
- printf("Generating the sky colors for each vertex.\n");
+ printf(" Generating the sky colors for each vertex.\n");
/* setup for the possibility of sunset effects */
sun_angle = l->sun_angle * RAD_TO_DEG;
middle_amt[j] -= middle_diff[j];
}
+ /*
printf("inner_color[%d] = %.2f %.2f %.2f %.2f\n", i, inner_color[i][0],
inner_color[i][1], inner_color[i][2], inner_color[i][3]);
printf("middle_color[%d] = %.2f %.2f %.2f %.2f\n", i,
printf("outer_color[%d] = %.2f %.2f %.2f %.2f\n", i,
outer_color[i][0], outer_color[i][1], outer_color[i][2],
outer_color[i][3]);
+ */
}
for ( j = 0; j < 3; j++ ) {
middle_amt[j] += middle_diff[j];
}
+ /*
printf("inner_color[%d] = %.2f %.2f %.2f %.2f\n", i, inner_color[i][0],
inner_color[i][1], inner_color[i][2], inner_color[i][3]);
printf("middle_color[%d] = %.2f %.2f %.2f %.2f\n", i,
printf("outer_color[%d] = %.2f %.2f %.2f %.2f\n", i,
outer_color[i][0], outer_color[i][1], outer_color[i][2],
outer_color[i][3]);
+ */
}
}
/* Initialize the sky structure and colors */
void fgSkyInit() {
+ printf("Initializing the sky\n");
+
fgSkyVerticesInit();
- fgSkyColorsInit();
+
+ /* regester fgSkyColorsInit() as an event to be run periodically */
+ fgEventRegister("fgSkyColorsInit()", fgSkyColorsInit,
+ FG_EVENT_READY, 30000);
}
/* $Log$
-/* Revision 1.9 1997/12/30 13:06:57 curt
-/* A couple lighting tweaks ...
+/* Revision 1.10 1997/12/30 20:47:53 curt
+/* Integrated new event manager with subsystem initializations.
/*
+ * Revision 1.9 1997/12/30 13:06:57 curt
+ * A couple lighting tweaks ...
+ *
* Revision 1.8 1997/12/23 04:58:38 curt
* Tweaked the sky coloring a bit to build in structures to allow finer rgb
* control.
double ra_save1, decl_save1;
int count, i, j, max_stars;
+ printf("Initializing stars\n");
+
g = &general;
/* build the full path name to the stars data base file */
max_stars = FG_MAX_STARS;
for ( i = 0; i < FG_STAR_LEVELS; i++ ) {
- printf("Loading %d Stars: %s\n", max_stars, path);
+ printf(" Loading %d Stars: %s\n", max_stars, path);
if ( (fd = fopen(path, "r")) == NULL ) {
printf("Cannot open star file: '%s'\n", path);
while ( (fgets(line, 256, fd) != NULL) && (count < max_stars) ) {
front = line;
- /* printf("Read line = %s", front); */
+ /* printf(" Read line = %s", front); */
/* advance to first non-whitespace character */
while ( (front[0] == ' ') || (front[0] == '\t') ) {
front++;
}
- /* printf("Line length (after trimming) = %d\n", strlen(front)); */
+ /* printf(" Line length (after trimming) = %d\n", strlen(front));*/
if ( front[0] == '#' ) {
/* comment */
if ( magnitude < 0.0 ) { magnitude = 0.0; }
magnitude =
magnitude * 0.7 + (((FG_STAR_LEVELS - 1) - i) * 0.1);
- /* printf("Found star: %d %s, %.3f %.3f %.3f\n", count,
+ /* printf(" Found star: %d %s, %.3f %.3f %.3f\n", count,
name, right_ascension, declination, magnitude); */
xglColor3f( magnitude, magnitude, magnitude );
for ( j = 2; j < 9; j++ ) {
pltPos = fgCalculatePlanet(pltOrbElements[j],
pltOrbElements[0], cur_time_params, j);
- printf("Planet found at %f (ra), %f (dec)\n",
- pltPos.RightAscension, pltPos.Declination);
/* give the planets a temporary color, for testing purposes */
/* xglColor3f( 1.0, 0.0, 0.0); */
/* $Log$
-/* Revision 1.22 1997/12/30 16:36:53 curt
-/* Merged in Durk's changes ...
+/* Revision 1.23 1997/12/30 20:47:53 curt
+/* Integrated new event manager with subsystem initializations.
/*
+ * Revision 1.22 1997/12/30 16:36:53 curt
+ * Merged in Durk's changes ...
+ *
* Revision 1.21 1997/12/19 23:35:00 curt
* Lot's of tweaking with sky rendering and lighting.
*
void fgSunInit() {
static int dl_exists = 0;
+ printf("Initializing the Sun\n");
+
fgSolarSystemUpdate(&(pltOrbElements[0]), cur_time_params);
sunPos = fgCalculateSun(pltOrbElements[0], cur_time_params);
#ifdef DEBUG
/* $Log$
-/* Revision 1.9 1997/12/30 16:36:54 curt
-/* Merged in Durk's changes ...
+/* Revision 1.10 1997/12/30 20:47:54 curt
+/* Integrated new event manager with subsystem initializations.
/*
+ * Revision 1.9 1997/12/30 16:36:54 curt
+ * Merged in Durk's changes ...
+ *
* Revision 1.8 1997/12/19 23:35:00 curt
* Lot's of tweaking with sky rendering and lighting.
*
e = &events[ptr];
+ printf("Running %s\n", e->description);
+
/* record starting time */
#ifdef USE_FTIME
ftime(&e->last_run);
/* Initialize the scheduling subsystem */
void fgEventInit() {
+ printf("Initializing event manager\n");
event_ptr = 0;
initq();
}
e = &events[event_ptr];
+ printf("Registering event: %s\n", desc);
+
if ( strlen(desc) < 256 ) {
strcpy(e->description, desc);
} else {
void fgEventPrintStats() {
int i;
- printf("Event Stats\n");
+ if ( event_ptr > 0 ) {
+ printf("\n");
+ printf("Event Stats\n");
+ printf("----- -----\n");
- for ( i = 0; i < event_ptr; i++ ) {
- printf(" %s cum=%d min=%d max=%d count=%d ave=%.2f\n",
- events[i].description, events[i].cum_time, events[i].min_time,
- events[i].max_time, events[i].count,
- events[i].cum_time / (double)events[i].count);
+ for ( i = 0; i < event_ptr; i++ ) {
+ printf(" %s cum=%d min=%d max=%d count=%d ave=%.2f\n",
+ events[i].description, events[i].cum_time,
+ events[i].min_time, events[i].max_time, events[i].count,
+ events[i].cum_time / (double)events[i].count);
+ }
}
}
#endif /* USE_FTIME */
int i;
- /* printf("Processing events\n"); */
+ printf("Processing events\n");
/* get the current time */
#ifdef USE_FTIME
/* $Log$
-/* Revision 1.1 1997/12/30 04:19:22 curt
-/* Initial revision.
+/* Revision 1.2 1997/12/30 20:47:58 curt
+/* Integrated new event manager with subsystem initializations.
/*
+ * Revision 1.1 1997/12/30 04:19:22 curt
+ * Initial revision.
+ *
*/
/* Initialize the time dependent variables */
void fgTimeInit(struct fgTIME *t) {
+ printf("Initializing Time\n");
+
t->gst_diff = -9999.0;
}
x /= 3600.0;
gst = (1.0/SIDRATE)*hr + x;
- printf("gst => %.4f\n", gst);
+ printf(" gst => %.4f\n", gst);
return(gst);
}
struct timezone tz;
#endif
- printf("COURSE: GMT = %d/%d/%2d %d:%02d:%02d\n",
+ /*
+ printf(" COURSE: GMT = %d/%d/%2d %d:%02d:%02d\n",
gmt->tm_mon, gmt->tm_mday, gmt->tm_year,
gmt->tm_hour, gmt->tm_min, gmt->tm_sec);
+ */
mt.tm_mon = 2;
mt.tm_mday = 21;
offset = -(timezone / 3600 - daylight);
- printf("Raw time zone offset = %ld\n", timezone);
- printf("Daylight Savings = %d\n", daylight);
+ /* printf(" Raw time zone offset = %ld\n", timezone); */
+ /* printf(" Daylight Savings = %d\n", daylight); */
- printf("Local hours from GMT = %ld\n", offset);
+ /* printf(" Local hours from GMT = %ld\n", offset); */
start_gmt = start - timezone + (daylight * 3600);
- printf("March 21 noon (CST) = %ld\n", start);
- printf("March 21 noon (GMT) = %ld\n", start_gmt);
+ /* printf(" March 21 noon (CST) = %ld\n", start); */
+ /* printf(" March 21 noon (GMT) = %ld\n", start_gmt); */
diff = (now - start_gmt) / (3600.0 * 24.0);
- printf("Time since 3/21/%2d GMT = %.2f\n", gmt->tm_year, diff);
+ /* printf(" Time since 3/21/%2d GMT = %.2f\n", gmt->tm_year, diff); */
part = fmod(diff, 1.0);
days = diff - part;
lst += 24.0;
}
- printf("days = %.1f hours = %.2f lon = %.2f lst = %.2f\n",
- days, hours, lng, lst);
+ /* printf(" days = %.1f hours = %.2f lon = %.2f lst = %.2f\n",
+ days, hours, lng, lst); */
return(lst);
}
warp += 0;
t->cur_time = time(NULL) + (0) * 60 * 60;
t->cur_time += warp;
- printf("Current Unix calendar time = %ld warp = %ld\n", t->cur_time, warp);
+ printf(" Current Unix calendar time = %ld warp = %ld\n",
+ t->cur_time, warp);
/* get GMT break down for current time */
t->gmt = gmtime(&t->cur_time);
- printf("Current GMT = %d/%d/%2d %d:%02d:%02d\n",
+ printf(" Current GMT = %d/%d/%2d %d:%02d:%02d\n",
t->gmt->tm_mon+1, t->gmt->tm_mday, t->gmt->tm_year,
t->gmt->tm_hour, t->gmt->tm_min, t->gmt->tm_sec);
/* convert "back" to Julian date + partial day (as a fraction of one) */
t->jd = t->mjd + MJD0;
- printf("Current Julian Date = %.5f\n", t->jd);
+ printf(" Current Julian Date = %.5f\n", t->jd);
- printf("Current Longitude = %.3f\n", FG_Longitude * RAD_TO_DEG);
+ /* printf(" Current Longitude = %.3f\n", FG_Longitude * RAD_TO_DEG); */
/* Calculate local side real time */
if ( t->gst_diff < -100.0 ) {
/* first time through do the expensive calculation & cheap
calculation to get the difference. */
- printf("First time, doing precise gst\n");
+ printf(" First time, doing precise gst\n");
t->gst = gst_precise = sidereal_precise(t->mjd, 0.00);
gst_course = sidereal_course(t->gmt, t->cur_time, 0.00);
t->gst_diff = gst_precise - gst_course;
sidereal_course(t->gmt, t->cur_time, -(FG_Longitude * RAD_TO_DEG))
+ t->gst_diff;
}
- /* printf("Current lon=0.00 Sidereal Time = %.3f\n", t->gst); */
- /* printf("Current LOCAL Sidereal Time = %.3f (%.3f) (diff = %.3f)\n",
+ /* printf(" Current lon=0.00 Sidereal Time = %.3f\n", t->gst); */
+ /* printf(" Current LOCAL Sidereal Time = %.3f (%.3f) (diff = %.3f)\n",
t->lst, sidereal_precise(t->mjd, -(FG_Longitude * RAD_TO_DEG)),
t->gst_diff); */
}
/* $Log$
-/* Revision 1.22 1997/12/30 01:38:47 curt
-/* Switched back to per vertex normals and smooth shading for terrain.
+/* Revision 1.23 1997/12/30 20:47:58 curt
+/* Integrated new event manager with subsystem initializations.
/*
+ * Revision 1.22 1997/12/30 01:38:47 curt
+ * Switched back to per vertex normals and smooth shading for terrain.
+ *
* Revision 1.21 1997/12/23 04:58:39 curt
* Tweaked the sky coloring a bit to build in structures to allow finer rgb
* control.
#include "../Math/mat3.h"
#include "../Math/polar.h"
+
#undef E
/* update the cur_time_params structure with the current sun position */
-void fgUpdateSunPos(struct fgCartesianPoint scenery_center) {
+void fgUpdateSunPos() {
struct fgLIGHT *l;
struct fgTIME *t;
struct fgVIEW *v;
t = &cur_time_params;
v = ¤t_view;
+ printf(" Updating Sun position\n");
+
time_warp += 0; /* increase this to make the world spin real fast */
fgSunPosition(t->cur_time + time_warp, &l->sun_lon, &sun_gd_lat);
l->fg_sunpos = fgPolarToCart(l->sun_lon, l->sun_gc_lat, sl_radius);
- /* printf("Geodetic lat = %.5f Geocentric lat = %.5f\n", sun_gd_lat,
+ /* printf(" Geodetic lat = %.5f Geocentric lat = %.5f\n", sun_gd_lat,
t->sun_gc_lat); */
/* FALSE! (?> the sun position has to be translated just like
MAT3_NORMALIZE_VEC(nsun, temp);
l->sun_angle = acos(MAT3_DOT_PRODUCT(nup, nsun));
- printf("SUN ANGLE relative to current location = %.3f rads.\n",
+ printf(" SUN ANGLE relative to current location = %.3f rads.\n",
l->sun_angle);
}
/* $Log$
-/* Revision 1.18 1997/12/23 04:58:40 curt
-/* Tweaked the sky coloring a bit to build in structures to allow finer rgb
-/* control.
+/* Revision 1.19 1997/12/30 20:47:59 curt
+/* Integrated new event manager with subsystem initializations.
/*
+ * Revision 1.18 1997/12/23 04:58:40 curt
+ * Tweaked the sky coloring a bit to build in structures to allow finer rgb
+ * control.
+ *
* Revision 1.17 1997/12/15 23:55:08 curt
* Add xgl wrappers for debugging.
* Generate terrain normals on the fly.
#include "../Include/types.h"
/* update the cur_time_params structure with the current sun position */
-void fgUpdateSunPos(struct fgCartesianPoint scenery_center);
+void fgUpdateSunPos();
void fgSunPosition(time_t ssue, double *lon, double *lat);
w = ¤t_weather;
+ printf("Initializing weather subsystem\n");
+
/* Configure some wind */
/* FG_V_north_airmass = 15; */ /* ft/s =~ 10mph */
/* $Log$
-/* Revision 1.8 1997/12/11 04:43:58 curt
-/* Fixed sun vector and lighting problems. I thing the moon is now lit
-/* correctly.
+/* Revision 1.9 1997/12/30 20:48:03 curt
+/* Integrated new event manager with subsystem initializations.
/*
+ * Revision 1.8 1997/12/11 04:43:58 curt
+ * Fixed sun vector and lighting problems. I thing the moon is now lit
+ * correctly.
+ *
* Revision 1.7 1997/12/10 22:37:56 curt
* Prepended "fg" on the name of all global structures that didn't have it yet.
* i.e. "struct WEATHER {}" became "struct fgWEATHER {}"