コード例 #1
0
        public override void LoadContent(bool firstLoad)
        {
            // Check if the current input GUI override is still valid. If so, apply it.
            if (!string.IsNullOrEmpty(Settings.InputGui))
            {
                string inputGuiPath = $"controls/{Settings.InputGui}/";
                if (GFX.Gui.GetTextures().Any(kvp => kvp.Key.StartsWith(inputGuiPath)))
                {
                    Input.OverrideInputPrefix = Settings.InputGui;
                }
                else
                {
                    Settings.InputGui = "";
                }
            }

            if (firstLoad && !Everest.Flags.AvoidRenderTargets)
            {
                SubHudRenderer.Buffer = VirtualContent.CreateRenderTarget("subhud-target", 1922, 1082);
            }
            if (Everest.Flags.AvoidRenderTargets && Celeste.HudTarget != null)
            {
                Celeste.HudTarget.Dispose();
                Celeste.HudTarget = null;
            }

            if (Settings.NonThreadedGL)
            {
                GFX.Load();
                MTN.Load();
                GFX.LoadData();
                MTN.LoadData();
            }
            // Otherwise loaded in GameLoader.LoadThread

            // Celeste 1.3.0.0 gets rid of those.
            for (int i = 0; i <= 29; i++)
            {
                GFX.Game[$"objects/checkpoint/flag{i:D2}"] = GFX.Game["util/pixel"];
            }
            for (int i = 0; i <= 27; i++)
            {
                GFX.Game[$"objects/checkpoint/obelisk{i:D2}"] = GFX.Game["util/pixel"];
            }

            GFX.Gui["fileselect/assist"]    = GFX.Game["util/pixel"];
            GFX.Gui["fileselect/cheatmode"] = GFX.Game["util/pixel"];
        }
コード例 #2
0
        private void LoadThread()
        {
            MInput.Disabled        = true;
            MainThreadHelper.Boost = 25;
            Stopwatch timer = Stopwatch.StartNew();

            Audio.Init();
            // Original code loads audio banks here.
            Settings.Instance.ApplyVolumes();
            audioLoaded = true;
            Console.WriteLine(" - AUDIO LOAD: " + timer.ElapsedMilliseconds + "ms");
            timer.Stop();

            GFX.Load();
            MTN.Load();
            GFX.LoadData();
            MTN.LoadData();

            timer = Stopwatch.StartNew();
            Fonts.Prepare();
            Dialog.Load();
            Fonts.Load(Dialog.Languages["english"].FontFace);
            Fonts.Load(Dialog.Languages[Settings.Instance.Language].FontFace);
            dialogLoaded = true;
            Console.WriteLine(" - DIA/FONT LOAD: " + timer.ElapsedMilliseconds + "ms");
            timer.Stop();
            MInput.Disabled = false;

            timer = Stopwatch.StartNew();
            AreaData.Load();
            Console.WriteLine(" - LEVELS LOAD: " + timer.ElapsedMilliseconds + "ms");
            timer.Stop();

            timer = Stopwatch.StartNew();
            MainThreadHelper.Boost = 50;
            patch_VirtualTexture.WaitFinishFastTextureLoading();
            MainThreadHelper.Get(() => MainThreadHelper.Boost = 0).GetResult();
            // FIXME: There could be ongoing tasks which add to the main thread queue right here.
            Console.WriteLine(" - FASTTEXTURELOADING LOAD: " + timer.ElapsedMilliseconds + "ms");
            timer.Stop();

            Console.WriteLine("DONE LOADING (in " + Celeste.LoadTimer.ElapsedMilliseconds + "ms)");
            Celeste.LoadTimer.Stop();
            Celeste.LoadTimer = null;
            loaded            = true;
        }
コード例 #3
0
        private void LoadThread()
        {
            MInput.Disabled = true;
            Stopwatch timer = Stopwatch.StartNew();

            Audio.Init();
            // Original code loads audio banks here.
            Settings.Instance.ApplyVolumes();
            audioLoaded = true;
            Console.WriteLine(" - AUDIO LOAD: " + timer.ElapsedMilliseconds + "ms");
            timer.Stop();

            if (!CoreModule.Settings.NonThreadedGL)
            {
                GFX.Load();
                MTN.Load();
                GFX.LoadData();
                MTN.LoadData();
            }
            // Otherwise loaded in CoreModule.LoadContent

            timer = Stopwatch.StartNew();
            Fonts.Prepare();
            Dialog.Load();
            Fonts.Load(Dialog.Languages["english"].FontFace);
            Fonts.Load(Dialog.Languages[Settings.Instance.Language].FontFace);
            dialogLoaded = true;
            Console.WriteLine(" - DIA/FONT LOAD: " + timer.ElapsedMilliseconds + "ms");
            timer.Stop();
            MInput.Disabled = false;

            timer = Stopwatch.StartNew();
            AreaData.Load();
            Console.WriteLine(" - LEVELS LOAD: " + timer.ElapsedMilliseconds + "ms");
            timer.Stop();

            Console.WriteLine("DONE LOADING (in " + Celeste.LoadTimer.ElapsedMilliseconds + "ms)");
            Celeste.LoadTimer.Stop();
            Celeste.LoadTimer = null;
            loaded            = true;
        }