Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="batch"></param>
        /// <param name="field"></param>
        /// <param name="position"></param>
        /// <param name="direction"></param>
        public override void Draw(SpriteBatch batch, ViewField field, ViewFieldPosition position, CardinalPoint direction)
        {
            // Foreach wall side
            foreach (TileDrawing td in DisplayCoordinates.GetWalls(position))
            {
                // Not the good side
                if (Compass.GetDirectionFromView(direction, td.Side) != Side)
                {
                    continue;
                }

                DecorationSet decoset = field.Maze.Decoration;
                if (decoset == null)
                {
                    return;
                }

                Decoration deco = decoset.GetDecoration(IsActivated ? ActivatedDecoration : DeactivatedDecoration);
                if (deco == null)
                {
                    return;
                }

                deco.DrawDecoration(batch, decoset, position, Compass.IsSideFacing(direction, Side));
            }
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        void RenderActivated()
        {
            ActivatedGLBox.MakeCurrent();
            Display.ClearBuffers();

            Batch.Begin();

            // Background
            Batch.DrawTile(Maze.WallTileset, 0, Point.Empty);

            // Render the walls
            foreach (TileDrawing tmp in DisplayCoordinates.GetWalls(ViewFieldPosition.L))
            {
                Batch.DrawTile(Maze.WallTileset, tmp.ID, tmp.Location);
            }

            // Draw decoration
            if (DecorationSet != null)
            {
                DecorationSet.Draw(Batch, (int)ActivatedIdBox.Value, ViewFieldPosition.L);
            }

            Batch.End();

            ActivatedGLBox.SwapBuffers();
        }