Set up cloud layers when thesky is allocated, to ensure that they are
created only once.
This commit is contained in:
parent
0387b3a4ec
commit
5bec60a602
1 changed files with 9 additions and 0 deletions
|
@ -1548,7 +1548,16 @@ int mainLoop( int argc, char **argv ) {
|
|||
0.0 );
|
||||
globals->set_ephem( ephem );
|
||||
|
||||
// TODO: move to environment mgr
|
||||
thesky = new SGSky;
|
||||
SGPath texture_path(globals->get_fg_root());
|
||||
texture_path.append("Textures");
|
||||
texture_path.append("Sky");
|
||||
for (int i = 0; i < FGEnvironmentMgr::MAX_CLOUD_LAYERS; i++) {
|
||||
SGCloudLayer * layer = new SGCloudLayer(texture_path.str());
|
||||
thesky->add_cloud_layer(layer);
|
||||
}
|
||||
|
||||
|
||||
SGPath sky_tex_path( globals->get_fg_root() );
|
||||
sky_tex_path.append( "Textures" );
|
||||
|
|
Loading…
Add table
Reference in a new issue