MCPcopy Create free account
hub / github.com/HertzDevil/0CC-FamiTracker / GradientRectTriple

Function GradientRectTriple

Source/Graphics.cpp:32–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30namespace details {
31
32void GradientRectTriple(CDC &DC, int x, int y, int r, int b, COLORREF c1, COLORREF c2, COLORREF c3) {
33 // c1 -> c2 -> c3
34 TRIVERTEX Vertices[4];
35 GRADIENT_RECT Rects[2];
36
37 Vertices[0].x = x;
38 Vertices[0].y = y;
39 Vertices[0].Red = GetR(c1) << 8;
40 Vertices[0].Green = GetG(c1) << 8;
41 Vertices[0].Blue = GetB(c1) << 8;
42 Vertices[0].Alpha = 0xFF00;
43
44 Vertices[1].x = r;
45 Vertices[1].y = (2 * y + b) / 3;
46 Vertices[1].Red = GetR(c2) << 8;
47 Vertices[1].Green = GetG(c2) << 8;
48 Vertices[1].Blue = GetB(c2) << 8;
49 Vertices[1].Alpha = 0xFF00;
50
51 Vertices[2].x = x;
52 Vertices[2].y = (2 * y + b) / 3;
53 Vertices[2].Red = GetR(c2) << 8;
54 Vertices[2].Green = GetG(c2) << 8;
55 Vertices[2].Blue = GetB(c2) << 8;
56 Vertices[2].Alpha = 0xFF00;
57
58 Vertices[3].x = r;
59 Vertices[3].y = b;
60 Vertices[3].Red = GetR(c3) << 8;
61 Vertices[3].Green = GetG(c3) << 8;
62 Vertices[3].Blue = GetB(c3) << 8;
63 Vertices[3].Alpha = 0xFF00;
64
65 Rects[0].UpperLeft = 0;
66 Rects[0].LowerRight = 1;
67 Rects[1].UpperLeft = 2;
68 Rects[1].LowerRight = 3;
69
70 DC.GradientFill(Vertices, 4, Rects, 2, GRADIENT_FILL_RECT_V);
71}
72
73void GradientBar(CDC &DC, int x, int y, int r, int b, COLORREF col_fg, COLORREF col_bg) {
74 TRIVERTEX Vertices[2];

Callers 1

DrawHeaderMethod · 0.85

Calls 3

GetRFunction · 0.85
GetGFunction · 0.85
GetBFunction · 0.85

Tested by

no test coverage detected