public override void Draw(HouseRenderState state, HouseBatch batch)
        {
            //ZBuffer

            batch.Draw(Sprite);
            //batch.DrawZ(Texture, ZBuffer, new Microsoft.Xna.Framework.Rectangle(0, 0, Texture.Width, Texture.Height), Color.White);
        }
        public override void Draw(HouseRenderState state, HouseBatch batch)
        {
            //ZBuffer

            batch.Draw(Sprite);
            //batch.DrawZ(Texture, ZBuffer, new Microsoft.Xna.Framework.Rectangle(0, 0, Texture.Width, Texture.Height), Color.White);
        }
        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);
        }
Exemple #4
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);
        }