Esempio n. 1
0
 public World(Viewer viewer)
 {
     Viewer = viewer;
     PerformanceInitialViewingDistance = Viewer.Settings.ViewingDistance;
     PerformanceInitialLODBias         = Viewer.Settings.LODBias;
     // Control stuff first.
     WeatherControl = new WeatherControl(viewer);
     // Then drawers.
     if (viewer.Settings.UseMSTSEnv)
     {
         MSTSSky = new MSTSSkyDrawer(viewer);
     }
     else
     {
         Sky = new SkyViewer(viewer);
     }
     Precipitation = new PrecipitationViewer(viewer, WeatherControl);
     Terrain       = new TerrainViewer(viewer);
     Scenery       = new SceneryDrawer(viewer);
     Trains        = new TrainDrawer(viewer);
     RoadCars      = new RoadCarViewer(viewer);
     // Then sound.
     if (viewer.Settings.SoundDetailLevel > 0)
     {
         // Keep it silent while loading.
         ALSoundSource.MuteAll();
         // TODO: This looks kinda evil; do something about it.
         GameSounds = new SoundSource(viewer, Events.Source.MSTSInGame, viewer.Simulator.RoutePath + "\\Sound\\ingame.sms", true);
         Viewer.SoundProcess.AddSoundSources(GameSounds.SMSFolder + "\\" + GameSounds.SMSFileName, new List <SoundSourceBase>()
         {
             GameSounds
         });
         Sounds = new WorldSounds(viewer);
     }
 }
Esempio n. 2
0
 public World(Viewer viewer, double gameTime)
 {
     Viewer = viewer;
     PerformanceInitialViewingDistance = Viewer.Settings.ViewingDistance;
     PerformanceInitialLODBias         = Viewer.Settings.LODBias;
     // Control stuff first.
     // check if weather file is defined
     if (string.IsNullOrEmpty(viewer.Simulator.UserWeatherFile))
     {
         WeatherControl = new WeatherControl(viewer);
     }
     else
     {
         WeatherControl = new AutomaticWeather(viewer, viewer.Simulator.UserWeatherFile, gameTime);
     }
     // Then drawers.
     if (viewer.Settings.UseMSTSEnv)
     {
         MSTSSky = new MSTSSkyDrawer(viewer);
     }
     else
     {
         Sky = new SkyViewer(viewer);
     }
     Precipitation = new PrecipitationViewer(viewer, WeatherControl);
     Terrain       = new TerrainViewer(viewer);
     Scenery       = new SceneryDrawer(viewer);
     Trains        = new TrainDrawer(viewer);
     RoadCars      = new RoadCarViewer(viewer);
     // Then sound.
     if (viewer.Settings.SoundDetailLevel > 0)
     {
         // Keep it silent while loading.
         ALSoundSource.MuteAll();
         // TODO: This looks kinda evil; do something about it.
         GameSounds = new SoundSource(viewer, SoundEventSource.InGame, viewer.Simulator.RouteFolder.SoundFile("ingame.sms"), true);
         Viewer.SoundProcess.AddSoundSources(GameSounds.SMSFolder + "\\" + GameSounds.SMSFileName, new List <SoundSourceBase>()
         {
             GameSounds
         });
         Sounds = new WorldSounds(viewer);
     }
 }