예제 #1
0
        /// <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()
        {
            this.IsMouseVisible = true;
            graphics.DeviceResetting += new EventHandler(GraphicsDevice_DeviceResetting);

            CityDataRetriever cityData = new CityDataRetriever();

            m_Terrain = new Terrain(GraphicsDevice, CITY_NUMBER, cityData, Content);
            m_Terrain.Initialize();
            m_Terrain.RegenData = true;


            //Shadow configuration. Very Low quality res: 512, Low quality: 1024, High quality: 2048
            m_Terrain.ShadowsEnabled = true;
            m_Terrain.ShadowRes = 2048;

            base.Initialize();
        }
예제 #2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // TODO: use this.Content to load your game content here
            m_VertexShader = Content.Load<Effect>("VerShader");
            m_PixelShader = Content.Load<Effect>("PixShader");

            m_Terrain = new Terrain(GraphicsDevice, CITY_NUMBER);
            m_Terrain.Initialize();
            m_Terrain.GenerateCityMesh(GraphicsDevice);
            m_Terrain.CreateTextureAtlas(spriteBatch);
            m_Terrain.CreateTransparencyAtlas(spriteBatch);
        }