Beispiel #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;
            }
        }
Beispiel #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;
            }
        }
Beispiel #3
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);
            }

            if (_ppCacheKey != EquatableTuple.Create(Length, Normal, Position))
            {
                _ppCacheKey   = EquatableTuple.Create(Length, Normal, Position);
                _ppCacheRects = CommonObstacleRenderer.CreatePortalRenderRects(Position, Vector2.UnitX.Rotate(Normal), Vector2.UnitX.Rotate(Normal).RotateWithLength(FloatMath.RAD_POS_090, Length / 2f), Length);
            }

            CommonObstacleRenderer.DrawPortal(sbatch, _ppCacheRects, Portal.COLORS[Group], Normal);
        }