~ubuntu-branches/ubuntu/oneiric/flightgear/oneiric

« back to all changes in this revision

Viewing changes to src/Environment/environment_mgr.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T Chen
  • Date: 2006-01-05 12:48:11 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060105124811-xsr6rtcrb88w19c8
Tags: 0.9.9-1ubuntu1
Resynchronise with Debian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
// along with this program; if not, write to the Free Software
19
19
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
20
//
21
 
// $Id: environment_mgr.cxx,v 1.11 2004/02/21 14:04:40 ehofman Exp $
 
21
// $Id: environment_mgr.cxx,v 1.18 2005/10/22 11:22:06 ehofman Exp $
 
22
 
 
23
#ifdef HAVE_CONFIG_H
 
24
#  include <config.h>
 
25
#endif
22
26
 
23
27
#include <simgear/debug/logstream.hxx>
24
28
#include <simgear/scene/sky/sky.hxx>
 
29
#include <simgear/environment/visual_enviro.hxx>
25
30
 
26
31
#include <Main/main.hxx>
27
32
#include <Main/fg_props.hxx>
30
35
#include "environment.hxx"
31
36
#include "environment_ctrl.hxx"
32
37
#include "environment_mgr.hxx"
 
38
#include "fgclouds.hxx"
 
39
 
 
40
class SGSky;
 
41
extern SGSky *thesky;
 
42
 
33
43
 
34
44
 
35
45
FGEnvironmentMgr::FGEnvironmentMgr ()
43
53
 
44
54
  _controller->setEnvironment(_environment);
45
55
  set_subsystem("controller", _controller, 0.5);
 
56
  fgClouds = new FGClouds( _controller );
46
57
}
47
58
 
48
59
FGEnvironmentMgr::~FGEnvironmentMgr ()
49
60
{
50
61
  delete _environment;
51
62
  delete _controller;
 
63
  delete fgClouds;
52
64
}
53
65
 
54
66
void
79
91
  fgSetArchivable("/environment/temperature-sea-level-degc");
80
92
  fgTie("/environment/temperature-degc", _environment,
81
93
        &FGEnvironment::get_temperature_degc); // FIXME: read-only for now
 
94
  fgTie("/environment/temperature-degf", _environment,
 
95
        &FGEnvironment::get_temperature_degf); // FIXME: read-only for now
82
96
  fgTie("/environment/dewpoint-sea-level-degc", _environment,
83
97
        &FGEnvironment::get_dewpoint_sea_level_degc,
84
98
        &FGEnvironment::set_dewpoint_sea_level_degc);
147
161
          &FGEnvironmentMgr::set_cloud_layer_coverage);
148
162
    fgSetArchivable(buf);
149
163
  }
 
164
  fgTie("/sim/rendering/clouds3d-enable", &sgEnviro,
 
165
          &SGEnviro::get_clouds_enable_state,
 
166
          &SGEnviro::set_clouds_enable_state);
 
167
  fgTie("/sim/rendering/clouds3d-vis-range", &sgEnviro,
 
168
          &SGEnviro::get_clouds_visibility,
 
169
          &SGEnviro::set_clouds_visibility);
 
170
  fgTie("/sim/rendering/clouds3d-density", &sgEnviro,
 
171
          &SGEnviro::get_clouds_density,
 
172
          &SGEnviro::set_clouds_density);
 
173
  fgTie("/sim/rendering/clouds3d-cache-size", &sgEnviro,
 
174
          &SGEnviro::get_clouds_CacheSize,
 
175
          &SGEnviro::set_clouds_CacheSize);
 
176
  fgTie("/sim/rendering/clouds3d-cache-resolution", &sgEnviro,
 
177
          &SGEnviro::get_CacheResolution,
 
178
          &SGEnviro::set_CacheResolution);
 
179
  fgTie("/sim/rendering/precipitation-enable", &sgEnviro,
 
180
          &SGEnviro::get_precipitation_enable_state,
 
181
          &SGEnviro::set_precipitation_enable_state);
 
182
  fgTie("/environment/rebuild_layers", fgClouds,
 
183
      &FGClouds::get_update_event,
 
184
      &FGClouds::set_update_event);
 
185
  fgTie("/sim/rendering/lightning-enable", &sgEnviro,
 
186
      &SGEnviro::get_lightning_enable_state,
 
187
      &SGEnviro::set_lightning_enable_state);
 
188
  fgTie("/environment/turbulence/use-cloud-turbulence", &sgEnviro,
 
189
      &SGEnviro::get_turbulence_enable_state,
 
190
      &SGEnviro::set_turbulence_enable_state);
150
191
}
151
192
 
152
193
void
176
217
    sprintf(buf, "/environment/clouds/layer[%d]/type", i);
177
218
    fgUntie(buf);
178
219
  }
 
220
  fgUntie("/sim/rendering/clouds3d-enable");
 
221
  fgUntie("/sim/rendering/clouds3d-vis-range");
 
222
  fgUntie("/sim/rendering/clouds3d-density");
 
223
  fgUntie("/sim/rendering/clouds3d-cache-size");
 
224
  fgUntie("/sim/rendering/clouds3d-cache-resolution");
 
225
  fgUntie("/sim/rendering/precipitation-enable");
 
226
  fgUntie("/environment/rebuild_layers");
 
227
  fgUntie("/sim/rendering/lightning-enable");
 
228
  fgUntie("/environment/turbulence/use-cloud-turbulence");
179
229
}
180
230
 
181
231
void