Use a pointer to a structure instead of a large number of variables when calling a function to keep the stack clean
This commit is contained in:
parent
29dcc1ca1e
commit
62ce453136
1 changed files with 36 additions and 26 deletions
|
@ -580,15 +580,20 @@ void fgRenderFrame() {
|
||||||
" sun_angle = " << cur_light_params.sun_angle
|
" sun_angle = " << cur_light_params.sun_angle
|
||||||
<< " moon_angle = " << cur_light_params.moon_angle );
|
<< " moon_angle = " << cur_light_params.moon_angle );
|
||||||
*/
|
*/
|
||||||
thesky->repaint( cur_light_params.sky_color,
|
|
||||||
cur_light_params.adj_fog_color,
|
static SGSkyColor scolor;
|
||||||
cur_light_params.cloud_color,
|
|
||||||
cur_light_params.sun_angle,
|
scolor.sky_color = cur_light_params.sky_color;
|
||||||
cur_light_params.moon_angle,
|
scolor.fog_color = cur_light_params.adj_fog_color;
|
||||||
globals->get_ephem()->getNumPlanets(),
|
scolor.cloud_color = cur_light_params.cloud_color;
|
||||||
globals->get_ephem()->getPlanets(),
|
scolor.sun_angle = cur_light_params.sun_angle;
|
||||||
globals->get_ephem()->getNumStars(),
|
scolor.moon_angle = cur_light_params.moon_angle;
|
||||||
globals->get_ephem()->getStars() );
|
scolor.nplanets = globals->get_ephem()->getNumPlanets();
|
||||||
|
scolor.nstars = globals->get_ephem()->getNumStars();
|
||||||
|
scolor.planet_data = globals->get_ephem()->getPlanets();
|
||||||
|
scolor.star_data = globals->get_ephem()->getStars();
|
||||||
|
|
||||||
|
thesky->repaint( scolor );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
SG_LOG( SG_GENERAL, SG_BULK,
|
SG_LOG( SG_GENERAL, SG_BULK,
|
||||||
|
@ -621,23 +626,28 @@ void fgRenderFrame() {
|
||||||
} else {
|
} else {
|
||||||
sun_horiz_eff = moon_horiz_eff = 1.0;
|
sun_horiz_eff = moon_horiz_eff = 1.0;
|
||||||
}
|
}
|
||||||
thesky->reposition( current__view->get_view_pos(),
|
|
||||||
current__view->get_zero_elev(),
|
static SGSkyState sstate;
|
||||||
current__view->get_world_up(),
|
|
||||||
current__view->getLongitude_deg()
|
sstate.view_pos = current__view->get_view_pos();
|
||||||
* SGD_DEGREES_TO_RADIANS,
|
sstate.zero_elev = current__view->get_zero_elev();
|
||||||
current__view->getLatitude_deg()
|
sstate.view_up = current__view->get_world_up();
|
||||||
* SGD_DEGREES_TO_RADIANS,
|
sstate.lon = current__view->getLongitude_deg()
|
||||||
current__view->getAltitudeASL_ft()
|
* SGD_DEGREES_TO_RADIANS;
|
||||||
* SG_FEET_TO_METER,
|
sstate.lat = current__view->getLatitude_deg()
|
||||||
cur_light_params.sun_rotation,
|
* SGD_DEGREES_TO_RADIANS;
|
||||||
globals->get_time_params()->getGst(),
|
sstate.alt = current__view->getAltitudeASL_ft()
|
||||||
globals->get_ephem()->getSunRightAscension(),
|
* SG_FEET_TO_METER;
|
||||||
globals->get_ephem()->getSunDeclination(),
|
sstate.spin = cur_light_params.sun_rotation;
|
||||||
50000.0 * sun_horiz_eff,
|
sstate.gst = globals->get_time_params()->getGst();
|
||||||
globals->get_ephem()->getMoonRightAscension(),
|
sstate.sun_ra = globals->get_ephem()->getSunRightAscension();
|
||||||
globals->get_ephem()->getMoonDeclination(),
|
sstate.sun_dec = globals->get_ephem()->getSunDeclination();
|
||||||
40000.0 * moon_horiz_eff );
|
sstate.sun_dist = 50000.0 * sun_horiz_eff;
|
||||||
|
sstate.moon_ra = globals->get_ephem()->getMoonRightAscension();
|
||||||
|
sstate.moon_dec = globals->get_ephem()->getMoonDeclination();
|
||||||
|
sstate.moon_dist = 40000.0 * moon_horiz_eff;
|
||||||
|
|
||||||
|
thesky->reposition( sstate );
|
||||||
}
|
}
|
||||||
|
|
||||||
glEnable( GL_DEPTH_TEST );
|
glEnable( GL_DEPTH_TEST );
|
||||||
|
|
Loading…
Reference in a new issue