From: curt Date: Tue, 30 Dec 1997 23:09:04 +0000 (+0000) Subject: Tweaking initialization sequences. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3b8c0ffcb527197398b5b38cd2ffa9f9a5c3ceed;p=flightgear.git Tweaking initialization sequences. --- diff --git a/Main/fg_init.c b/Main/fg_init.c index 97863ab2e..60bbc65b8 100644 --- a/Main/fg_init.c +++ b/Main/fg_init.c @@ -86,10 +86,12 @@ void fgInitSubsystems( void ) { double cur_elev; struct fgFLIGHT *f; + struct fgLIGHT *l; struct fgTIME *t; struct fgVIEW *v; f = ¤t_aircraft.flight; + l = &cur_light_params; t = &cur_time_params; v = ¤t_view; @@ -179,11 +181,18 @@ void fgInitSubsystems( void ) { fgTimeInit(t); fgTimeUpdate(f, t); - /* Initialize shared sun position and sun_vec */ - fgEventRegister( "fgUpdateSunPos()", fgUpdateSunPos, FG_EVENT_READY, 1000 ); + /* fgViewUpdate() needs the sun in the right place, while + * fgUpdateSunPos() needs to know the view position. I'll get + * around this interdependency for now by calling fgUpdateSunPos() + * once, then moving on with normal initialization. */ + fgUpdateSunPos(); /* Initialize view parameters */ fgViewInit(v); + fgViewUpdate(f, v, l); + + /* Initialize shared sun position and sun_vec */ + fgEventRegister( "fgUpdateSunPos()", fgUpdateSunPos, FG_EVENT_READY, 1000 ); /* Initialize the weather modeling subsystem */ fgWeatherInit(); @@ -258,9 +267,12 @@ void fgInitSubsystems( void ) { /* $Log$ -/* Revision 1.25 1997/12/30 22:22:33 curt -/* Further integration of event manager. +/* Revision 1.26 1997/12/30 23:09:04 curt +/* Tweaking initialization sequences. /* + * Revision 1.25 1997/12/30 22:22:33 curt + * Further integration of event manager. + * * Revision 1.24 1997/12/30 20:47:44 curt * Integrated new event manager with subsystem initializations. *