public DynamicRangeChunkVolume(GraphicsDevice device, GameDataProvider provider)
        {
            chunkWishList = new HashSet<WorldPosition>();
            this.provider = provider;
            volume = new Chunk[16, 16, 16];
            vertexBuffers = new CDictionary<Chunk, VBuffer7>();
            this.device = device;
            this.effect = Static.Effect;
            MiniMap = new Texture2D(Static.Device, 64, 64);
            MiniMapBuffer = new Color[64 * 64];
            MiniMapLayer = new Layer(MiniMap, 1, 0.7f, LayerDock.Far, LayerDock.Far,
                () =>
                {
                    return true;
                }
                );
            MiniMapLayer.Push(new LayerCell
            {
                SourceTexture = new Rectangle(0, 0, 64, 64),
                DestinationScreen = new Rectangle(-270, -270, 256, 256)
            });

            redrawWorker = new Timer(doRedraw);
            redrawWorker.Change(50, 50);

            hoverBoxMesh = HelpfulStuff.getCube(0.51f, GraphicsHelper.TextureCoord(36));
        }
Esempio n. 2
0
 public void AmbientLightColorTest()
 {
     AwesomeEffect target = new AwesomeEffect(); // TODO: Passenden Wert initialisieren
     Vector4 expected = new Vector4(); // TODO: Passenden Wert initialisieren
     target.AmbientLightColor = expected;
     Assert.Inconclusive("Lesegeschützte Eigenschaften können nicht überprüft werden.");
 }
 public DynamicRangeChunkVolume(GraphicsDevice device, GameDataProvider provider)
 {
     chunkWishList = new HashSet<WorldPosition>();
     this.provider = provider;
     volume = new Chunk[16, 16, 16];
     vertexBuffers = new CDictionary<Chunk, VertexBuffer[]>();
     this.device = device;
     this.effect = Static.Effect;
 }
Esempio n. 4
0
        public Renderer()
        {
            this.gd = Static.Device;
            var window = Static.Window;
            var control = Static.RenderTarget;
            window.Move += Renderer_Move;
            window.Shown += Renderer_Move;
            control.Move += Renderer_Move;
            control.SizeChanged += control_Resize;

            effect = Static.Effect;
            AdjustDevice();

            volume = Static.Volume;

            Pen2D pen = new Pen2D(System.Drawing.Color.White, 3);
            var lineCross = new Bitmap2D(40, 40);
            Graphics2D glc = Graphics2D.FromImage(lineCross);
            glc.DrawLine(pen, 20, 0, 20, 16);
            glc.DrawLine(pen, 20, 24, 20, 40);
            glc.DrawLine(pen, 0, 20, 16, 20);
            glc.DrawLine(pen, 24, 20, 40, 20);

            layerLineCross = new Layer(GraphicsHelper.Convert(lineCross, gd), 1, 0.7f, LayerDock.Center, LayerDock.Center, () => true);
            layerLineCross.Push(new LayerCell
            {
                SourceTexture = new Rectangle(0, 0, 40, 40),
                DestinationScreen = new Rectangle(-18, -18, 36, 36)
            });
            layerCurrentChatLine = new TextLayer("> ", 0.7f, LayerDock.Near, LayerDock.Near, () => Static.GameManager.chat);
            layerCurrentChatLine.Translation = () => new Vector2(10, 10 + layerCurrentChatLine.Height - 30);

            chatHistory = new Queue<Layer>();
            debug1 = new TextLayer("", 0.7f, LayerDock.Near, LayerDock.Far, () => true);
            debug1.Translation = () => new Vector2(0, -30);
            debug2 = new TextLayer("", 0.7f, LayerDock.Near, LayerDock.Far, () => true);
            debug2.Translation = () => new Vector2(0, -60);
            debug3 = new TextLayer("", 0.7f, LayerDock.Near, LayerDock.Far, () => true);
            debug3.Translation = () => new Vector2(0, -90);
            currentMat = new TextLayer("", 0.7f, LayerDock.Near, LayerDock.Far, () => true);
            currentMat.Translation = () => new Vector2(0, -120);

            hoverBox = HelpfulStuff.getCube(0.51f, GraphicsHelper.TextureCoord(36));
        }
Esempio n. 5
0
        public static void InitGame(Control renderTarget, string ip, string username, string password)
        {
            indices = new ushort[16384 * 6];
            for (ushort i = 0; i < 16384; i++)
            {
                indices[6 * i + 0] = (ushort)(4 * i + 0);
                indices[6 * i + 1] = (ushort)(4 * i + 1);
                indices[6 * i + 2] = (ushort)(4 * i + 2);
                indices[6 * i + 3] = (ushort)(4 * i + 2);
                indices[6 * i + 4] = (ushort)(4 * i + 1);
                indices[6 * i + 5] = (ushort)(4 * i + 3);
            }

            //PREPARE PHASE
            //DataProvider
            DataProvider = new MultiPlayerDataProvider(() =>
            {
                TcpClient tc = new TcpClient();
                tc.Connect(ip, 8080);
                return tc;
            }, username, "joch");

            //UserData: DataProvider
            UserData = DataProvider.Login();

            //RenderTarget
            RenderTarget = renderTarget;
            
            //Window
            Window = renderTarget.TopLevelControl as Form;

            //SoundManager: Window
            //SoundManager.PlayForever();

            //Device: RenderTarget
            Device = Renderer.CreateDevice();

            var ib = new IndexBuffer(Device, IndexElementSize.SixteenBits, indices.Length, BufferUsage.WriteOnly);
            ib.SetData<ushort>(indices);
            Indices = ib;

            //DPerson: Device
            DPerson.Init();

            //GraphicsHelper: Device
            GraphicsHelper.Init();

            //Effect: Device
            Effect = new AwesomeEffect();

            //Volume: Device, DataProvider, Effect
            Volume = new DynamicRangeChunkVolume(Device, DataProvider);

            //Renderer: Window, Effect, RenderTarget, Device, Volume
            Renderer = new Renderer();

            //GameManager: RenderTarget, Window, Renderer, Volume
            GameManager = new GameManager();

            //RUN PHASE
            DataProvider.Start();
            Renderer.Start();
            Paused = false;
        }
Esempio n. 6
0
 public void BeginTest()
 {
     AwesomeEffect target = new AwesomeEffect(); // TODO: Passenden Wert initialisieren
     target.Begin();
     Assert.Inconclusive("Eine Methode, die keinen Wert zurückgibt, kann nicht überprüft werden.");
 }
Esempio n. 7
0
 public void AwesomeEffectConstructorTest()
 {
     AwesomeEffect target = new AwesomeEffect();
     Assert.Inconclusive("TODO: Code zum Überprüfen des Ziels implementieren");
 }
Esempio n. 8
0
 public void WMatrixTest()
 {
     AwesomeEffect target = new AwesomeEffect(); // TODO: Passenden Wert initialisieren
     Matrix expected = new Matrix(); // TODO: Passenden Wert initialisieren
     target.WMatrix = expected;
     Assert.Inconclusive("Lesegeschützte Eigenschaften können nicht überprüft werden.");
 }
Esempio n. 9
0
 public void TextureTest()
 {
     AwesomeEffect target = new AwesomeEffect(); // TODO: Passenden Wert initialisieren
     Texture2D expected = null; // TODO: Passenden Wert initialisieren
     target.Texture = expected;
     Assert.Inconclusive("Lesegeschützte Eigenschaften können nicht überprüft werden.");
 }
Esempio n. 10
0
 public void LightDirectionTest()
 {
     AwesomeEffect target = new AwesomeEffect(); // TODO: Passenden Wert initialisieren
     Vector3 expected = new Vector3(); // TODO: Passenden Wert initialisieren
     target.LightDirection = expected;
     Assert.Inconclusive("Lesegeschützte Eigenschaften können nicht überprüft werden.");
 }
Esempio n. 11
0
 public void FogEndTest()
 {
     AwesomeEffect target = new AwesomeEffect(); // TODO: Passenden Wert initialisieren
     float expected = 0F; // TODO: Passenden Wert initialisieren
     target.FogEnd = expected;
     Assert.Inconclusive("Lesegeschützte Eigenschaften können nicht überprüft werden.");
 }
Esempio n. 12
0
        public static void InitGame(Control renderTarget, string ip, string username, string password)
        {
            //PREPARE PHASE
            //DataProvider
            DataProvider = new MultiPlayerDataProvider(() =>
            {
                TcpClient tc = new TcpClient();
                tc.Connect(ip, 8080);
                return tc;
            }, username, "joch");

            //UserData: DataProvider
            UserData = DataProvider.Login();

            //RenderTarget
            RenderTarget = renderTarget;

            //Window
            Window = renderTarget.TopLevelControl as Form;

            //SoundManager: Window
            SoundManager.PlayForever();

            //Device: RenderTarget
            Device = Renderer.CreateDevice();

            //DPerson: Device
            DPerson.Init();

            //GraphicsHelper: Device
            GraphicsHelper.Init();

            //Effect: Device
            Effect = new AwesomeEffect();

            //Volume: Device, DataProvider, Effect
            Volume = new DynamicRangeChunkVolume(Device, DataProvider);

            //Renderer: Window, Effect, RenderTarget, Device, Volume
            Renderer = new Renderer();

            //GameManager: RenderTarget, Window, Renderer, Volume
            GameManager = new GameManager();

            //RUN PHASE
            DataProvider.Start();
            Renderer.Start();
            Paused = false;
        }