/// <summary> /// Initialize the class /// </summary> /// <param name="content">ContentManager class</param> /// <param name="graphicsDevice">GraphicsDevice class</param> /// <param name="spriteBatch">SpriteBatch class</param> /// <param name="postProcessor">CPostProcessor class</param> public static void LoadContent(ContentManager content, GraphicsDevice graphicsDevice, SpriteBatch spriteBatch, CPostProcessor postProcessor, CRenderCapture renderCapture) { _spriteBatch = spriteBatch; _graphicsDevice = graphicsDevice; _content = content; _postProcessor = postProcessor; _renderCapture = renderCapture; _pixelTexture = content.Load <Texture2D>("Textures/Pixel"); uwWaterfallTexture = content.Load <Texture2D>("Textures/uw_effect"); }
protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); renderCapture = new Display2D.CRenderCapture(GraphicsDevice); postProcessor = new Display2D.CPostProcessor(GraphicsDevice); Display2D.C2DEffect.LoadContent(Content, GraphicsDevice, spriteBatch, postProcessor, renderCapture); Display2D.C2DEffect.isSoftwareEmbedded = isSoftwareEmbedded; Display2D.C2DEffect.renderTarget = (isSoftwareEmbedded) ? em_renderTarget2D : renderCapture.renderTarget; Display3D.Particles.ParticlesManager.LoadContent(GraphicsDevice); Game.Settings.CGameSettings.LoadDatas(GraphicsDevice); Game.CConsole.LoadContent(Content, GraphicsDevice, spriteBatch, true, true /*false*/); Game.CConsole._activationKeys = Game.Settings.CGameSettings._gameSettings.KeyMapping.Console; Game.CConsole._activationKeys = Keys.F1; try { if (!isSoftwareEmbedded) { Game.CGameManagement.ChangeState("CInGame"); } Game.CGameManagement.LoadContent(Content, GraphicsDevice, spriteBatch, graphics); } catch (Exception e) { Game.CGameManagement.ChangeState("CError"); Game.CGameManagement.SendParam("Error encountered\n\nCheck logs for more information"); Game.CConsole.WriteLogs(e.ToString()); } if (!isSoftwareEmbedded) { Game.Script.CLuaVM.Initialize(); if (System.IO.Directory.Exists("Scripts")) { foreach (string file in System.IO.Directory.GetFiles("Scripts", "*.lua").ToList <string>()) { Game.Script.CLuaVM.LoadScript(file); } } else { System.IO.Directory.CreateDirectory("Scripts"); } } }