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; } }
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; } }
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)); }