mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-29 06:12:18 -06:00
.reference: Rainbow example (RM #158)
git-svn-id: svn://ultimatepp.org/upp/trunk@4176 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
7c77584ac9
commit
8beda45e4d
43 changed files with 4961 additions and 0 deletions
71
reference/Framebuffer/Util.cpp
Normal file
71
reference/Framebuffer/Util.cpp
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
#include <CtrlCore/CtrlCore.h>
|
||||
|
||||
#ifdef GUI_FB
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
/*
|
||||
static void sRenderLine(SystemDraw& w, int x, int y, int dx, int dy, int cx, int cy, int len, byte pattern)
|
||||
{
|
||||
DLOG(len);
|
||||
for(int i = 0; i < len; i++)
|
||||
if((128 >> (i & 7)) & pattern)
|
||||
w.DrawRect(x + dx * i, y + dy * i, cx, cy, Black);
|
||||
DDUMP("~sRenderLine");
|
||||
}
|
||||
|
||||
static void sRenderRect(SystemDraw& w, const Rect& r, int n, byte pattern)
|
||||
{
|
||||
sRenderLine(w, r.left, r.top, 1, 0, 1, n, r.GetWidth(), pattern);
|
||||
sRenderLine(w, r.left, r.bottom - 1, 1, 0, 1, n, r.GetWidth(), pattern);
|
||||
sRenderLine(w, r.left, r.top, 0, 1, n, 1, r.GetHeight(), pattern);
|
||||
sRenderLine(w, r.right - 1, r.top, 0, 1, n, 1, r.GetHeight(), pattern);
|
||||
}
|
||||
|
||||
void DrawDragRect(SystemDraw& w, const Rect& rect1, const Rect& rect2,
|
||||
const Rect& clip, int n, Color color, uint64 pattern)
|
||||
{
|
||||
DLOG("@ DrawDragRect " << rect1 << " " << rect2 << ", clip: " << clip << ", pattern: " << pattern);
|
||||
TIMING("DrawDrawRect");
|
||||
w.Clip(clip);
|
||||
w.Invert();
|
||||
sRenderRect(w, rect1, n, (byte)pattern);
|
||||
sRenderRect(w, rect2, n, (byte)pattern);
|
||||
Ctrl::AddUpdate((rect1 | rect2).Offseted(w.GetOffset()));
|
||||
// MemoryProfile mem;
|
||||
// DDUMP(mem);
|
||||
w.End();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static uint64 sGetAniPat(uint64 src, int pos)
|
||||
{
|
||||
uint64 out = 0;
|
||||
pos &= 7;
|
||||
for(int i = 8; --i >= 0;) {
|
||||
byte sr = (byte)(src >> (8 * ((7 - i - pos) & 7)));
|
||||
out = (out << 8) | (byte)((sr | (sr << 8)) >> pos);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
Size GetScreenSize()
|
||||
{
|
||||
return ScreenInfo().GetPageSize();
|
||||
}
|
||||
*/
|
||||
|
||||
void DrawDragRect(Ctrl& q, const Rect& rect1, const Rect& rect2, const Rect& clip, int n,
|
||||
Color color, int type, int animation)
|
||||
{
|
||||
q.DragRectDraw(rect1, rect2, clip, n, color, type, animation);
|
||||
}
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue