public static void Draw(IEnumerable <DDCrash> crashes, I3Color color, double a = 1.0) { DDDraw.SetAlpha(a); DDDraw.SetBright(color); Draw(crashes); DDDraw.Reset(); }
public void Draw(IEnumerable <DDCrash> crashes, I3Color color) { DDDraw.SetBright(color); using (this.MyScreen.Section()) { Queue <IEnumerable <DDCrash> > q = new Queue <IEnumerable <DDCrash> >(); q.Enqueue(crashes); while (1 <= q.Count) { foreach (DDCrash crash in q.Dequeue()) { switch (crash.Kind) { case DDCrashUtils.Kind_e.NONE: break; case DDCrashUtils.Kind_e.POINT: DDDraw.DrawBegin(Ground.I.Picture.WhiteBox, crash.Pt.X - DDGround.ICamera.X, crash.Pt.Y - DDGround.ICamera.Y); DDDraw.DrawSetSize(POINT_WH, POINT_WH); DDDraw.DrawEnd(); break; case DDCrashUtils.Kind_e.CIRCLE: DDDraw.DrawBegin(Ground.I.Picture.WhiteCircle, crash.Pt.X - DDGround.ICamera.X, crash.Pt.Y - DDGround.ICamera.Y); DDDraw.DrawSetSize(crash.R * 2.0, crash.R * 2.0); DDDraw.DrawEnd(); break; case DDCrashUtils.Kind_e.RECT: DDDraw.DrawRect( Ground.I.Picture.WhiteBox, crash.Rect.L - DDGround.ICamera.X, crash.Rect.T - DDGround.ICamera.Y, crash.Rect.W, crash.Rect.H ); break; case DDCrashUtils.Kind_e.MULTI: q.Enqueue(crash.Crashes); break; default: throw null; // never } } } } DDDraw.Reset(); }
public static void DrawCurtain(double whiteLevel = -1.0) { if (whiteLevel == 0.0) { return; } whiteLevel = SCommon.ToRange(whiteLevel, -1.0, 1.0); if (whiteLevel < 0.0) { DDDraw.SetAlpha(-whiteLevel); DDDraw.SetBright(0.0, 0.0, 0.0); } else { DDDraw.SetAlpha(whiteLevel); } DDDraw.DrawRect(Ground.I.Picture.WhiteBox, 0, 0, DDConsts.Screen_W, DDConsts.Screen_H); DDDraw.Reset(); }