/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { AIParams.SetUpAIParams(Path.Combine(Directory.GetCurrentDirectory(), "AIConfig.txt")); device = graphics.GraphicsDevice; spriteBatch = new SpriteBatch(device); world = new World(this); _windowWidth = 1000; // GraphicsDevice.DisplayMode.Width / 2; _windowHeight = 600; // GraphicsDevice.DisplayMode.Height / 2; // Setup frame buffer. graphics.SynchronizeWithVerticalRetrace = false; graphics.PreferredBackBufferWidth = _windowWidth; graphics.PreferredBackBufferHeight = _windowHeight; graphics.PreferMultiSampling = true; graphics.ApplyChanges(); // Setup the initial input states. currentKeyboardState = Keyboard.GetState(); // Setup Fog // NOTE: migration to XNA 4.0 // NOTE: graphics.GraphicsDevice.RenderState.FogStart = Settings.FOG_START; // NOTE: graphics.GraphicsDevice.RenderState.FogEnd = Settings.FOG_END; // NOTE: graphics.GraphicsDevice.RenderState.FogDensity = Settings.FOG_DENSITY; // NOTE: graphics.GraphicsDevice.RenderState.FogColor = Settings.FOG_COLOR; // NOTE: graphics.GraphicsDevice.RenderState.FogTableMode = Settings.FOG_MODE; // NOTE: graphics.GraphicsDevice.RenderState.FogVertexMode = Settings.FOG_MODE; HUD = new ScreenOutput.HUD(); _console = new ScreenOutput.Console(); cursor = new Cursor(this, device, spriteBatch); Components.Add(cursor); camera = new CameraComponent(this); Components.Add(camera); // NOTE: migration to XNA 4.0 basicEffect = new BasicEffect(graphics.GraphicsDevice, null); basicEffect = new BasicEffect(graphics.GraphicsDevice); base.Initialize(); }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { AIParams.SetUpAIParams(Path.Combine(Directory.GetCurrentDirectory(), "AIConfig.txt")); device = graphics.GraphicsDevice; spriteBatch = new SpriteBatch(device); world = new World(this); _windowWidth = 1000;// GraphicsDevice.DisplayMode.Width / 2; _windowHeight = 600;// GraphicsDevice.DisplayMode.Height / 2; // Setup frame buffer. graphics.SynchronizeWithVerticalRetrace = false; graphics.PreferredBackBufferWidth = _windowWidth; graphics.PreferredBackBufferHeight = _windowHeight; graphics.PreferMultiSampling = true; graphics.ApplyChanges(); // Setup the initial input states. currentKeyboardState = Keyboard.GetState(); // Setup Fog // NOTE: migration to XNA 4.0 // NOTE: graphics.GraphicsDevice.RenderState.FogStart = Settings.FOG_START; // NOTE: graphics.GraphicsDevice.RenderState.FogEnd = Settings.FOG_END; // NOTE: graphics.GraphicsDevice.RenderState.FogDensity = Settings.FOG_DENSITY; // NOTE: graphics.GraphicsDevice.RenderState.FogColor = Settings.FOG_COLOR; // NOTE: graphics.GraphicsDevice.RenderState.FogTableMode = Settings.FOG_MODE; // NOTE: graphics.GraphicsDevice.RenderState.FogVertexMode = Settings.FOG_MODE; HUD = new ScreenOutput.HUD(); _console = new ScreenOutput.Console(); cursor = new Cursor(this, device, spriteBatch); Components.Add(cursor); camera = new CameraComponent(this); Components.Add(camera); // NOTE: migration to XNA 4.0 basicEffect = new BasicEffect(graphics.GraphicsDevice, null); basicEffect = new BasicEffect(graphics.GraphicsDevice); base.Initialize(); }