From cd0dc0b7901f918bd8dfe360478e7f53fe543ff0 Mon Sep 17 00:00:00 2001 From: cxl Date: Thu, 17 Sep 2015 09:41:56 +0000 Subject: [PATCH] .reference git-svn-id: svn://ultimatepp.org/upp/trunk@8941 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- reference/CoWork/main.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/reference/CoWork/main.cpp b/reference/CoWork/main.cpp index d61b92358..1d72ff6ef 100644 --- a/reference/CoWork/main.cpp +++ b/reference/CoWork/main.cpp @@ -57,11 +57,27 @@ void DoLine(RGBA *line, int phase, int y, Size sz) void App::Paint(Draw& w) { Size sz = GetSize(); + DLOG("----------------"); + DDUMP(sz); ImageBuffer ib(sz); if(cowork) { CoWork co; - for(int y = 0; y < sz.cy; y++) + for(int y = 0; y < sz.cy; y++) { + #ifdef CPP_11 + RGBA *line = ib[y]; + co & lambda([=] { + Point c = sz / 2; + c = Point(int(sin((double)phase / 131) * c.x + c.x), int(sin((double)phase / 127) * c.y + c.y)); + int yy = (y - c.y) * (y - c.y); + for(int x = 0; x < sz.cx; x++) { + double d = (x - c.x) * (x - c.x) + yy; + line[x] = GrayColor((int)(120 + 120 * sin(d / 1000 - (double)phase / 5))); + } + }); + #else co & callback4(DoLine, ib[y], phase, y, sz); + #endif + } } else for(int y = 0; y < sz.cy; y++)