Пример #1
0
        public void GifStuff(GameTime gameTime)
        {
            if (Keyboard.GetState().IsKeyDown(Keys.F4))
            {
                //only send a frame every 250ms
                lastUpdate += gameTime.ElapsedGameTime.TotalMilliseconds;
                if (lastUpdate > 30)
                {
                    gifSaveRequested = true;
                    gif.AddFrame(30);
                    Debug.Log("added frame", Debug.LogType.Warning);
                    lastUpdate = 0;
                }
            }
            else if (gifSaveRequested)
            {
                Debug.Log("Saving gif", Debug.LogType.Warning);
                gifThread = new Thread(() => gif.WriteAllFrames());

                if (!gifThread.IsAlive)
                {
                    gifThread.Start();
                }
                else
                {
                    gifThread.Join();
                    Debug.Log("Saved Gif", Debug.LogType.Error);
                }

                gifSaveRequested = false;
            }
        }
Пример #2
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            bloom          = new Bloom(GraphicsDevice, spriteBatch);
            bloom.Settings = BloomSettings.PresetSettings[3];
            renderTarget1  = new RenderTarget2D(GraphicsDevice, width, height, false, pp.BackBufferFormat, pp.DepthStencilFormat, pp.MultiSampleCount, RenderTargetUsage.DiscardContents);
            renderTarget2  = new RenderTarget2D(GraphicsDevice, width, height, false, pp.BackBufferFormat, pp.DepthStencilFormat, pp.MultiSampleCount, RenderTargetUsage.DiscardContents);

            TextureManager.LoadContent(Content);
            ParticleSystem.Init(50000);
            ItemDictionary.LoadItemDatabase();
            bloom.LoadContent(Content, pp);
            // GUI.GUI.Init();
            Reset();
            Debug.Log($"Entities: {MarauderEngine.Entity.Entity.nextAvailibleID:N}");
        }