예제 #1
0
        public override void Draw(HouseRenderState state, HouseBatch batch)
        {
            var position = state.TileToScreen(Position);



            if ((WallInfo.Segments & WallSegments.BottomLeft) == WallSegments.BottomLeft)
            {
                var wall = ArchitectureCatalog.GetWallPattern(WallInfo.BottomLeftPattern);
                if (wall != null)
                {
                    var tx = wall.Far.RightTexture;

                    //batch.Draw(tx, new Rectangle((int)position.X, (int)position.Y - 49, 16, 67), Color.White);
                    //batch.Draw(tx, new Rectangle((int)position.X, (int)position.Y - 49, 16, 67), Color.White);
                }
            }

            if ((WallInfo.Segments & WallSegments.BottomRight) == WallSegments.BottomRight)
            {
                var wall = ArchitectureCatalog.GetWallPattern(WallInfo.BottomRightPattern);
                if (wall != null)
                {
                    var tx = wall.Far.LeftTexture;

                    //batch.Draw(tx, new Rectangle((int)position.X, (int)position.Y - 49, 16, 67), Color.White);
                    //batch.Draw(tx, new Rectangle((int)position.X + 16, (int)position.Y - 49, 16, 67), Color.White);
                }
            }



            //if ((WallInfo.Segments & WallSegments.BottomRight) == WallSegments.BottomRight)
            //{
            //    var wall = ArchitectureCatalog.GetWallPattern(WallInfo.BottomRightPattern);
            //    if (wall != null)
            //    {
            //        var tx = wall.Far.LeftTexture;

            //        //batch.Draw(tx, new Rectangle((int)position.X, (int)position.Y - 49, 16, 67), Color.White);
            //        batch.Draw(tx, new Rectangle((int)position.X + 16, (int)position.Y - 49, 16, 67), Color.White);
            //    }
            //}


            //if ((WallInfo.Segments & WallSegments.BottomRight) == WallSegments.BottomRight)
            //{
            //    var wall = ArchitectureCatalog.GetWallPattern(WallInfo.BottomLeftPattern);
            //    if (wall != null)
            //    {
            //        var tx = wall.Far.LeftTexture;
            //        batch.Draw(tx, new Rectangle((int)position.X, (int)position.Y - 58, 16, 67), Color.White);
            //    }
            //}
        }
예제 #2
0
        public override void Draw(HouseRenderState state, HouseBatch batch)
        {
            if (!m_Active)
            {
                return;
            }

            if (m_Dirty)
            {
                if (FloorStyle == 0)
                {
                    m_Active = false; return;
                }

                var floorStyle = ArchitectureCatalog.GetFloor(FloorStyle);
                if (floorStyle == null)
                {
                    m_Active = false; return;
                }


                var position = state.TileToScreen(Position);
                PaintCoords = new Rectangle((int)position.X, (int)position.Y, state.CellWidth, state.CellHeight);
                Texture     = floorStyle.GetTexture(state.Zoom, state.Rotation);
                m_Dirty     = false;
            }



            batch.Draw(new HouseBatchSprite {
                Pixel      = Texture,
                DestRect   = PaintCoords,
                SrcRect    = new Rectangle(0, 0, Texture.Width, Texture.Height),
                RenderMode = HouseBatchRenderMode.NO_DEPTH
            });
            //batch.Draw(Texture, PaintCoords, Color.White);
        }
예제 #3
0
        public LotScreen()
        {
            ArchitectureCatalog.Init();

            var lotInfo = HouseData.Parse(GameFacade.GameFilePath("housedata/blueprints/restaurant00_00.xml"));

            //var lotInfo = HouseData.Parse("C:\\restaurant00_00_small.xml");
            //for (int i = 1; i < 64; i++)
            //{
            //    lotInfo.World.Floors.Add(new HouseDataFloor {
            //         X = 1,
            //         Y = i,
            //         Level = 0,
            //         Value = 9
            //    });
            //}

            //lotInfo.World.Floors.Add(new HouseDataFloor {
            //    X = 0, Y = 0,
            //    Level = 0, Value = 20
            //});

            //lotInfo.World.Floors.Add(new HouseDataFloor
            //{
            //    X = 63,
            //    Y = 63,
            //    Level = 0,
            //    Value = 40
            //});

            //lotInfo.World.Floors.Add(new HouseDataFloor
            //{
            //    X = 0,
            //    Y = 63,
            //    Level = 0,
            //    Value = 20
            //});

            //lotInfo.World.Floors.Add(new HouseDataFloor
            //{
            //    X = 63,
            //    Y = 0,
            //    Level = 0,
            //    Value = 20
            //});

            Scene = new HouseScene();
            Scene.LoadHouse(lotInfo);
            GameFacade.Scenes.Add(Scene);


            //Renderer = new HouseRenderer();
            //Renderer.SetModel(lotInfo);
            ////Renderer.Position = new Microsoft.Xna.Framework.Vector3(-32.0f, -40.0f, 0.0f);

            //var scene = new ThreeDScene();
            //var focusPoint = Vector3.Zero;

            //var yValue = (float)Math.Cos(MathHelper.ToRadians(30.0f)) * 96.0f;
            //var cameraOffset = new Vector3(-96.0f, yValue, 96.0f);
            //var rotatedOffset = Vector3.Transform(cameraOffset, Microsoft.Xna.Framework.Matrix.CreateRotationY(MathHelper.PiOver2 * 0.5f));

            ////rotatedOffset = Vector3.Transform(rotatedOffset, Microsoft.Xna.Framework.Matrix.CreateScale(3f));
            ////Renderer.Position = new Vector3(-96.0f, 0.0f, -96.0f);

            //scene.Camera.Position = cameraOffset;// new Microsoft.Xna.Framework.Vector3(0, 0, 80);
            //scene.Add(Renderer);
            //Renderer.Scale = new Vector3(0.005f);

            //GameFacade.Scenes.AddScene(scene);


            ucp   = new UIUCP();
            ucp.Y = ScreenHeight - 210;
            //ucp.OnZoomChanged += new UCPZoomChangeEvent(ucp_OnZoomChanged);
            ucp.OnRotateChanged += new UCPRotateChangeEvent(ucp_OnRotateChanged);
            this.Add(ucp);
        }