Ejemplo n.º 1
0
        protected override void Load()
        {
            //Move to stop _TSGetMainThread error on OSX
            MinimumWindowSize = new Point(640, 480);
            SetVSync(Config.VSync);
            new IdentityCamera(this);
            uithread       = Thread.CurrentThread.ManagedThreadId;
            useintromovies = _cfg.IntroMovies;
            FLLog.Info("Platform", Platform.RunningOS.ToString() + (IntPtr.Size == 4 ? " 32-bit" : " 64-bit"));
            FLLog.Info("Available Threads", Environment.ProcessorCount.ToString());
            //Cache
            ResourceManager = new ResourceManager(this);
            //Init Audio
            FLLog.Info("Audio", "Initialising Audio");
            Audio = new AudioManager(this);
            if (_cfg.MuteMusic)
            {
                Audio.Music.Volume = 0f;
            }
            //Load data
            FLLog.Info("Game", "Loading game data");
            GameData    = new LegacyGameData(_cfg.FreelancerPath, ResourceManager);
            IntroMovies = GameData.GetIntroMovies();
            MpvOverride = _cfg.MpvOverride;
            Thread GameDataLoaderThread = new Thread(() =>
            {
                GameData.LoadData();
                Sound = new SoundManager(GameData, Audio);
                FLLog.Info("Game", "Finished loading game data");
                InitialLoadComplete = true;
            });

            GameDataLoaderThread.Name = "GamedataLoader";
            GameDataLoaderThread.Start();
            //
            Renderer2D = new Renderer2D(RenderState);
            Fonts      = new FontManager(this);
            Billboards = new Billboards();
            Nebulae    = new NebulaVertices();
            var vp = new ViewportManager(RenderState);

            vp.Push(0, 0, Width, Height);
            Screenshots = new ScreenshotManager(this);
            if (useintromovies && IntroMovies.Count > 0)
            {
                ChangeState(new IntroMovie(this, 0));
            }
            else
            {
                ChangeState(new LoadingDataState(this));
            }
        }
Ejemplo n.º 2
0
        public SystemRenderer(ICamera camera, LegacyGameData data, ResourceManager rescache, FreelancerGame game)
        {
            this.camera      = camera;
            AsteroidFields   = new List <AsteroidFieldRenderer>();
            Nebulae          = new List <NebulaRenderer>();
            StarSphereModels = new IDrawable[0];
            Polyline         = new PolylineRender(commands);
            cache            = rescache;
            rstate           = cache.Game.RenderState;
            this.game        = game;
            dot           = (Texture2D)rescache.FindTexture(ResourceManager.WhiteTextureName);
            DebugRenderer = new PhysicsDebugRenderer();

            if (GLExtensions.Features430)
            {
                pointLightBuffer = new ShaderStorageBuffer(MAX_POINTS * (16 * sizeof(float)));
                if (pointLightCull != null)
                {
                    pointLightCull = new ComputeShader(Resources.LoadString("LibreLancer.Shaders.lightingcull.glcompute"));
                }
            }
        }
Ejemplo n.º 3
0
 public ServerDatabase(string connectionString, LegacyGameData gameData)
 {
     FLLog.Info("MySQL", "Connecting to database");
     connection = new MySqlConnection(connectionString);
     connection.Open();
 }
Ejemplo n.º 4
0
 public GameServer(string fldir)
 {
     GameData = new LegacyGameData(fldir, null);
 }
Ejemplo n.º 5
0
 public SoundManager(LegacyGameData gameData, AudioManager audio)
 {
     data       = gameData;
     this.audio = audio;
 }