Esempio n. 1
0
        protected override void Initialize()
        {
            consoleHUD = new ConsoleHUD();

            spriteBatch = new SpriteBatch(graphics.GraphicsDevice);

            renderTarget         = new RenderTarget2D(graphics.GraphicsDevice, 800, 600, 1, SurfaceFormat.Color);
            refractionRenderTarg = new RenderTarget2D(graphics.GraphicsDevice, 800, 600, 1, SurfaceFormat.Color);
            reflectionRenderTarg = new RenderTarget2D(graphics.GraphicsDevice, 800, 600, 1, SurfaceFormat.Color);

            camera = new MouseCam();
            camera.SetPosition(new Vector3(1500f, 400f, 1500f));
            camera.rotation = new Vector3(0f, MathHelper.ToRadians(180f), 0f);

            //grid = new Grid(new Vector2(1000f, 1000f), 10, Color.Black, 1f, Vector3.Zero, new Vector3(0f, 0f, 0f));
            //water = new Water(new Vector2(40000f, 40000f), false);

            skybox = new Skybox();
            sun    = new Sun(342f, 335f);
            hud    = new HUD();

            InitFog();

            base.Initialize();

            settings = new HeightmapSettings();
            settings.Show();

            //camera.viewDistance = 6000f;
            //testHeightmap = new Optimized_Heightmap(graphics.GraphicsDevice, new Point(256, 256), new Vector2(50f, 50f), new Point(16, 16));
            //heightmapModifier = new HeightmapModifier(ref testHeightmap, 30);
        }
Esempio n. 2
0
        private void CheckPCInput()
        {
            KeyboardState ks = Keyboard.GetState();

            if ((ks.IsKeyDown(Keys.LeftControl) || ks.IsKeyDown(Keys.RightControl)))
            {
                if (ks.IsKeyDown(Keys.S) && (settings == null || !settings.Visible || !settings.Focused))
                {
                    if (settings == null)
                    {
                        settings         = new HeightmapSettings();
                        settings.Visible = true;
                    }
                    else if (!settings.Visible)
                    {
                        settings.Visible = true;
                    }
                    else if (!settings.Focused)
                    {
                        settings.Focus();
                        settings.BringToFront();
                    }

                    if (camera != null)
                    {
                        camera.SetState(Camera.State.Fixed);
                    }
                }
            }
        }
Esempio n. 3
0
        //HeightmapSettings appSettings;

        public CustomSize(HeightmapSettings settings)
        {
            InitializeComponent();
            //appSettings = settings;
        }