Ejemplo n.º 1
0
        protected override void OnDraw(IBatchRenderer sbatch)
        {
            if (GDOwner.Selection == this)
            {
                sbatch.FillShape(GetArea().AsInflated(GDConstants.TILE_WIDTH / 2, GDConstants.TILE_WIDTH / 2), Color.Black * 0.333f);
            }

            switch (WallType)
            {
            case WallStubType.Void:
                if (_vvCacheKey != EquatableTuple.Create(Point1, Point2))
                {
                    _vvCacheKey   = EquatableTuple.Create(Point1, Point2);
                    _vvCacheRects = CommonWallRenderer.CreateVoidWallRenderRects(FPoint.MiddlePoint(Point1, Point2), (Point1 - Point2).Length(), (Point1 - Point2).ToAngle());
                }
                CommonWallRenderer.DrawVoidWall_BG(sbatch, (Point1 - Point2).Length(), (Point1 - Point2).ToAngle(), _vvCacheRects);
                break;

            case WallStubType.Glass:
                CommonWallRenderer.DrawGlassWall(sbatch, GetArea());
                break;

            case WallStubType.Mirror:
                CommonWallRenderer.DrawMirrorWall(sbatch, GetArea());
                break;

            default:
                SAMLog.Error("LEWS::EnumSwitch_CS_OD", "WallType = " + WallType);
                break;
            }
        }
Ejemplo n.º 2
0
        protected override void OnDrawOrderedForegroundLayer(IBatchRenderer sbatch)
        {
            switch (WallType)
            {
            case WallStubType.Void:
                if (_vvCacheKey != EquatableTuple.Create(Point1, Point2))
                {
                    _vvCacheKey   = EquatableTuple.Create(Point1, Point2);
                    _vvCacheRects = CommonWallRenderer.CreateVoidWallRenderRects(FPoint.MiddlePoint(Point1, Point2), (Point1 - Point2).Length(), (Point1 - Point2).ToAngle());
                }
                CommonWallRenderer.DrawVoidWall_FG(sbatch, (Point1 - Point2).Length(), (Point1 - Point2).ToAngle(), _vvCacheRects);
                break;

            case WallStubType.Glass:
                // NOP
                break;

            case WallStubType.Mirror:
                // NOP
                break;

            default:
                SAMLog.Error("LEWS::EnumSwitch_CS_ODOFL", "WallType = " + WallType);
                break;
            }
        }
Ejemplo n.º 3
0
        protected override void OnDraw(IBatchRenderer sbatch)
        {
            CommonWallRenderer.DrawVoidWall_BG(sbatch, _length, _rotation, _rectsUnrotated);

#if DEBUG
            if (DebugSettings.Get("DebugEntityBoundaries"))
            {
                foreach (var r in _rectsUnrotated)
                {
                    sbatch.DrawRectangleRot(r, Color.Cyan, _rotation);
                }
            }
#endif
        }
Ejemplo n.º 4
0
        public VoidWall(GDGameScreen scrn, VoidWallBlueprint blueprint) : base(scrn, GDConstants.ORDER_GAME_WALL)
        {
            var pos = new FPoint(blueprint.X, blueprint.Y);

            _rotation       = FloatMath.DegreesToRadians * blueprint.Rotation;
            _length         = blueprint.Length;
            _rectsUnrotated = CommonWallRenderer.CreateVoidWallRenderRects(pos, _length, _rotation);

            Position = pos;

            DrawingBoundingBox = new Vector2(_length, 0).Rotate(_rotation).ToAbsFSize().AtLeast(WIDTH, WIDTH);

            this.GDOwner().GDBackground.RegisterBlockedLine(pos - Vector2.UnitX.RotateWithLength(_rotation, _length / 2f), pos + Vector2.UnitX.RotateWithLength(_rotation, _length / 2f));
        }
Ejemplo n.º 5
0
 protected override void OnDrawOrderedForegroundLayer(IBatchRenderer sbatch)
 {
     CommonWallRenderer.DrawVoidWall_FG(sbatch, _length, _rotation, _rectsUnrotated);
 }