Fix some deprecation warnings

Namely:

 - [[deprecated("Use DrawPixel/BlendPixel")]]
 - [[deprecated("Use DrawLine/BlendLine")]]
 - [[deprecated("Use DrawRect/BlendRect")]]
 - [[deprecated("Use DrawFilledRect/BlendFilledRect")]]
This commit is contained in:
Tamás Bálint Misius 2023-04-30 12:19:02 +02:00
parent 9fbb780728
commit 410dc71f42
No known key found for this signature in database
GPG Key ID: 5B472A12F6ECA9F2
47 changed files with 316 additions and 344 deletions

View File

@ -62,7 +62,7 @@ int main(int argc, char *argv[])
else
{
int w = Graphics::TextSize("Save file invalid").X + 15, x = (XRES-w)/2, y = (YRES-24)/2;
ren->drawrect(x, y, w, 24, 192, 192, 192, 255);
ren->DrawRect(RectSized(Vec2{ x, y }, Vec2{ w, 24 }), RGB<uint8_t>(192, 192, 192));
ren->BlendText({ x+8, y+8 }, "Save file invalid", RGBA<uint8_t>(192, 192, 240, 255));
}

View File

@ -21,13 +21,12 @@ void DebugLines::Draw()
ui::Point drawPoint1 = controller->PointTranslate(view->GetLineStartCoords()), drawPoint2 = controller->PointTranslate(view->GetLineFinishCoords());
if (view->GetDrawSnap())
drawPoint2 = view->lineSnapCoords(drawPoint1, drawPoint2);
//g->draw_line(drawPoint1.X, drawPoint1.Y, drawPoint2.X, drawPoint2.Y, 255, 0, 255, 255);
g->draw_line(0, drawPoint1.Y, XRES, drawPoint1.Y, 255, 255, 255, 120);
g->draw_line(drawPoint1.X, 0, drawPoint1.X, YRES, 255, 255, 255, 120);
g->BlendLine({ 0, drawPoint1.Y }, { XRES, drawPoint1.Y }, RGBA<uint8_t>(255, 255, 255, 120));
g->BlendLine({ drawPoint1.X, 0 }, { drawPoint1.X, YRES }, RGBA<uint8_t>(255, 255, 255, 120));
g->draw_line(0, drawPoint2.Y, XRES, drawPoint2.Y, 255, 255, 255, 120);
g->draw_line(drawPoint2.X, 0, drawPoint2.X, YRES, 255, 255, 255, 120);
g->BlendLine({ 0, drawPoint2.Y }, { XRES, drawPoint2.Y }, RGBA<uint8_t>(255, 255, 255, 120));
g->BlendLine({ drawPoint2.X, 0 }, { drawPoint2.X, YRES }, RGBA<uint8_t>(255, 255, 255, 120));
String info;
info = String::Build(drawPoint2.X, " x ", drawPoint2.Y);

View File

@ -38,8 +38,8 @@ void DebugParts::Draw()
x = 0;
}
}
g->draw_line(0, lpy, XRES, lpy, 0, 255, 120, 255);
g->draw_line(lpx, 0, lpx, YRES, 0, 255, 120, 255);
g->DrawLine({ 0, lpy }, { XRES, lpy }, RGB<uint8_t>(0, 255, 120));
g->DrawLine({ lpx, 0 }, { lpx, YRES }, RGB<uint8_t>(0, 255, 120));
g->AddPixel({ lpx, lpy }, RGBA<uint8_t>(255, 50, 50, 220));
g->AddPixel({ lpx+1, lpy }, RGBA<uint8_t>(255, 50, 50, 120));
@ -47,7 +47,7 @@ void DebugParts::Draw()
g->AddPixel({ lpx, lpy+1 }, RGBA<uint8_t>(255, 50, 50, 120));
g->AddPixel({ lpx, lpy-1 }, RGBA<uint8_t>(255, 50, 50, 120));
g->fillrect(7, YRES-26, g->TextSize(info).X + 4, 14, 0, 0, 0, 180);
g->BlendFilledRect(RectSized(Vec2{ 7, YRES-26}, Vec2{ g->TextSize(info).X + 4, 14}), RGBA<uint8_t>(0, 0, 0, 180));
g->BlendText({ 10, YRES-22 }, info, RGBA<uint8_t>(255, 255, 255, 255));
}

View File

@ -44,7 +44,7 @@ void ElementPopulationDebug::Draw()
halfValString = String::Build(maxAverage/2);
g->fillrect(xStart-5, yBottom - 263, bars+10+Graphics::TextSize(maxValString).X+9, 255 + 13, 0, 0, 0, 180);
g->BlendFilledRect(RectSized(Vec2{ xStart-5, yBottom - 263 }, Vec2{ bars+10+Graphics::TextSize(maxValString).X+9, 255 + 13 }), RGBA<uint8_t>(0, 0, 0, 180));
bars = 0;
for(int i = 0; i < PT_NUM; i++)
@ -57,20 +57,20 @@ void ElementPopulationDebug::Draw()
RGB<uint8_t> colour = sim->elements[i].Colour;
g->draw_line(xStart+barX, yBottom+3, xStart+barX, yBottom+2, colour.Red, colour.Green, colour.Blue, 255);
g->DrawLine({ xStart+barX, yBottom+3 }, { xStart+barX, yBottom+2 }, colour);
if(sim->elementCount[i])
{
if(barSize > 256)
{
barSize = 256;
g->blendpixel(xStart+barX, yBottom-barSize-3, colour.Red, colour.Green, colour.Blue, 255);
g->blendpixel(xStart+barX, yBottom-barSize-5, colour.Red, colour.Green, colour.Blue, 255);
g->blendpixel(xStart+barX, yBottom-barSize-7, colour.Red, colour.Green, colour.Blue, 255);
g->DrawPixel({ xStart+barX, yBottom-barSize-3 }, colour);
g->DrawPixel({ xStart+barX, yBottom-barSize-5 }, colour);
g->DrawPixel({ xStart+barX, yBottom-barSize-7 }, colour);
} else {
g->draw_line(xStart+barX, yBottom-barSize-3, xStart+barX, yBottom-barSize-2, 255, 255, 255, 180);
g->BlendLine({ xStart+barX, yBottom-barSize-3 }, { xStart+barX, yBottom-barSize-2 }, RGBA<uint8_t>(255, 255, 255, 180));
}
g->draw_line(xStart+barX, yBottom-barSize, xStart+barX, yBottom, colour.Red, colour.Green, colour.Blue, 255);
g->DrawLine({ xStart+barX, yBottom-barSize }, { xStart+barX, yBottom }, colour);
}
bars++;
}

View File

@ -59,13 +59,4 @@ struct RasterDrawMethods
static String::const_iterator TextFit(String const &, int width);
void Clear();
[[deprecated("Use DrawPixel/BlendPixel")]]
void blendpixel(int x, int y, int r, int g, int b, int a);
[[deprecated("Use DrawLine/BlendLine")]]
void draw_line(int x1, int y1, int x2, int y2, int r, int g, int b, int a);
[[deprecated("Use DrawRect/BlendRect")]]
void drawrect(int x, int y, int w, int h, int r, int g, int b, int a);
[[deprecated("Use DrawFilledRect/BlendFilledRect")]]
void fillrect(int x, int y, int w, int h, int r, int g, int b, int a);
};

View File

@ -400,40 +400,4 @@ String::const_iterator RasterDrawMethods<Derived>::TextFit(String const &str, in
return str.end();
}
template<typename Derived>
void RasterDrawMethods<Derived>::blendpixel(int x, int y, int r, int g, int b, int a)
{
if (a == 0xFF)
DrawPixel(Vec2(x, y), RGB<uint8_t>(r, g, b));
else
BlendPixel(Vec2(x, y), RGBA<uint8_t>(r, g, b, a));
}
template<typename Derived>
void RasterDrawMethods<Derived>::draw_line(int x1, int y1, int x2, int y2, int r, int g, int b, int a)
{
if (a == 0xFF)
DrawLine(Vec2(x1, y1), Vec2(x2, y2), RGB<uint8_t>(r, g, b));
else
BlendLine(Vec2(x1, y1), Vec2(x2, y2), RGBA<uint8_t>(r, g, b, a));
}
template<typename Derived>
void RasterDrawMethods<Derived>::drawrect(int x, int y, int w, int h, int r, int g, int b, int a)
{
if (a == 0xFF)
DrawRect(RectSized(Vec2(x, y), Vec2(w, h)), RGB<uint8_t>(r, g, b));
else
BlendRect(RectSized(Vec2(x, y), Vec2(w, h)), RGBA<uint8_t>(r, g, b, a));
}
template<typename Derived>
void RasterDrawMethods<Derived>::fillrect(int x, int y, int w, int h, int r, int g, int b, int a)
{
if (a == 0xFF)
DrawFilledRect(RectSized(Vec2(x, y), Vec2(w, h)), RGB<uint8_t>(r, g, b));
else
BlendFilledRect(RectSized(Vec2(x, y), Vec2(w, h)), RGBA<uint8_t>(r, g, b, a));
}
#undef clipRect

View File

@ -151,7 +151,7 @@ void Renderer::DrawSigns()
{
String text = currentSign.getDisplayText(sim, x, y, w, h);
DrawFilledRect(RectSized(Vec2{ x + 1, y + 1 }, Vec2{ w, h - 1 }), 0x000000_rgb);
drawrect(x, y, w+1, h, 192, 192, 192, 255);
DrawRect(RectSized(Vec2{ x, y }, Vec2{ w+1, h }), RGB<uint8_t>(192, 192, 192));
BlendText({ x+3, y+4 }, text, RGBA<uint8_t>(255, 255, 255, 255));
if (currentSign.ju != sign::None)
@ -162,7 +162,7 @@ void Renderer::DrawSigns()
int dy = (currentSign.y > 18) ? -1 : 1;
for (int j = 0; j < 4; j++)
{
blendpixel(x, y, 192, 192, 192, 255);
DrawPixel({ x, y }, RGB<uint8_t>(192, 192, 192));
x += dx;
y += dy;
}
@ -188,9 +188,9 @@ void Renderer::render_parts()
for (nx=0; nx<XRES; nx++)
{
if (ny%(4*gridSize) == 0)
blendpixel(nx, ny, 100, 100, 100, 80);
BlendPixel({ nx, ny }, RGBA<uint8_t>(100, 100, 100, 80));
if (nx%(4*gridSize) == 0 && ny%(4*gridSize) != 0)
blendpixel(nx, ny, 100, 100, 100, 80);
BlendPixel({ nx, ny }, RGBA<uint8_t>(100, 100, 100, 80));
}
}
foundElements = 0;
@ -398,7 +398,7 @@ void Renderer::render_parts()
if (t==PT_SOAP)
{
if ((parts[i].ctype&3) == 3 && parts[i].tmp >= 0 && parts[i].tmp < NPART)
draw_line(nx, ny, (int)(parts[parts[i].tmp].x+0.5f), (int)(parts[parts[i].tmp].y+0.5f), colr, colg, colb, cola);
BlendLine({ nx, ny }, { int(parts[parts[i].tmp].x+0.5f), int(parts[parts[i].tmp].y+0.5f) }, RGBA<uint8_t>(colr, colg, colb, cola));
}
}
if(pixel_mode & PSPEC_STICKMAN)
@ -486,23 +486,23 @@ void Renderer::render_parts()
//head
if(t==PT_FIGH)
{
draw_line(nx, ny+2, nx+2, ny, colr, colg, colb, 255);
draw_line(nx+2, ny, nx, ny-2, colr, colg, colb, 255);
draw_line(nx, ny-2, nx-2, ny, colr, colg, colb, 255);
draw_line(nx-2, ny, nx, ny+2, colr, colg, colb, 255);
DrawLine({ nx, ny+2 }, { nx+2, ny }, RGB<uint8_t>(colr, colg, colb));
DrawLine({ nx+2, ny }, { nx, ny-2 }, RGB<uint8_t>(colr, colg, colb));
DrawLine({ nx, ny-2 }, { nx-2, ny }, RGB<uint8_t>(colr, colg, colb));
DrawLine({ nx-2, ny }, { nx, ny+2 }, RGB<uint8_t>(colr, colg, colb));
}
else
{
draw_line(nx-2, ny+2, nx+2, ny+2, colr, colg, colb, 255);
draw_line(nx-2, ny-2, nx+2, ny-2, colr, colg, colb, 255);
draw_line(nx-2, ny-2, nx-2, ny+2, colr, colg, colb, 255);
draw_line(nx+2, ny-2, nx+2, ny+2, colr, colg, colb, 255);
DrawLine({ nx-2, ny+2 }, { nx+2, ny+2 }, RGB<uint8_t>(colr, colg, colb));
DrawLine({ nx-2, ny-2 }, { nx+2, ny-2 }, RGB<uint8_t>(colr, colg, colb));
DrawLine({ nx-2, ny-2 }, { nx-2, ny+2 }, RGB<uint8_t>(colr, colg, colb));
DrawLine({ nx+2, ny-2 }, { nx+2, ny+2 }, RGB<uint8_t>(colr, colg, colb));
}
//legs
draw_line(nx, ny+3, int(cplayer->legs[0]), int(cplayer->legs[1]), legr, legg, legb, 255);
draw_line(int(cplayer->legs[0]), int(cplayer->legs[1]), int(cplayer->legs[4]), int(cplayer->legs[5]), legr, legg, legb, 255);
draw_line(nx, ny+3, int(cplayer->legs[8]), int(cplayer->legs[9]), legr, legg, legb, 255);
draw_line(int(cplayer->legs[8]), int(cplayer->legs[9]), int(cplayer->legs[12]), int(cplayer->legs[13]), legr, legg, legb, 255);
DrawLine({ nx, ny+3 }, { int(cplayer->legs[ 0]), int(cplayer->legs[ 1]) }, RGB<uint8_t>(legr, legg, legb));
DrawLine({ int(cplayer->legs[0]), int(cplayer->legs[1]) }, { int(cplayer->legs[ 4]), int(cplayer->legs[ 5]) }, RGB<uint8_t>(legr, legg, legb));
DrawLine({ nx, ny+3 }, { int(cplayer->legs[ 8]), int(cplayer->legs[ 9]) }, RGB<uint8_t>(legr, legg, legb));
DrawLine({ int(cplayer->legs[8]), int(cplayer->legs[9]) }, { int(cplayer->legs[12]), int(cplayer->legs[13]) }, RGB<uint8_t>(legr, legg, legb));
if (cplayer->rocketBoots)
{
for (int leg=0; leg<2; leg++)
@ -510,18 +510,18 @@ void Renderer::render_parts()
int nx = int(cplayer->legs[leg*8+4]), ny = int(cplayer->legs[leg*8+5]);
int colr = 255, colg = 0, colb = 255;
if (((int)(cplayer->comm)&0x04) == 0x04 || (((int)(cplayer->comm)&0x01) == 0x01 && leg==0) || (((int)(cplayer->comm)&0x02) == 0x02 && leg==1))
blendpixel(nx, ny, 0, 255, 0, 255);
DrawPixel({ nx, ny }, RGB<uint8_t>(0, 255, 0));
else
blendpixel(nx, ny, 255, 0, 0, 255);
blendpixel(nx+1, ny, colr, colg, colb, 223);
blendpixel(nx-1, ny, colr, colg, colb, 223);
blendpixel(nx, ny+1, colr, colg, colb, 223);
blendpixel(nx, ny-1, colr, colg, colb, 223);
DrawPixel({ nx, ny }, RGB<uint8_t>(255, 0, 0));
BlendPixel({ nx+1, ny }, RGBA<uint8_t>(colr, colg, colb, 223));
BlendPixel({ nx-1, ny }, RGBA<uint8_t>(colr, colg, colb, 223));
BlendPixel({ nx, ny+1 }, RGBA<uint8_t>(colr, colg, colb, 223));
BlendPixel({ nx, ny-1 }, RGBA<uint8_t>(colr, colg, colb, 223));
blendpixel(nx+1, ny-1, colr, colg, colb, 112);
blendpixel(nx-1, ny-1, colr, colg, colb, 112);
blendpixel(nx+1, ny+1, colr, colg, colb, 112);
blendpixel(nx-1, ny+1, colr, colg, colb, 112);
BlendPixel({ nx+1, ny-1 }, RGBA<uint8_t>(colr, colg, colb, 112));
BlendPixel({ nx-1, ny-1 }, RGBA<uint8_t>(colr, colg, colb, 112));
BlendPixel({ nx+1, ny+1 }, RGBA<uint8_t>(colr, colg, colb, 112));
BlendPixel({ nx-1, ny+1 }, RGBA<uint8_t>(colr, colg, colb, 112));
}
}
}
@ -531,7 +531,7 @@ void Renderer::render_parts()
}
if(pixel_mode & PMODE_BLEND)
{
blendpixel(nx, ny, colr, colg, colb, cola);
BlendPixel({ nx, ny }, RGBA<uint8_t>(colr, colg, colb, cola));
}
if(pixel_mode & PMODE_ADD)
{
@ -541,15 +541,15 @@ void Renderer::render_parts()
{
video[{ nx, ny }] = RGB<uint8_t>(colr, colg, colb).Pack();
blendpixel(nx+1, ny, colr, colg, colb, 223);
blendpixel(nx-1, ny, colr, colg, colb, 223);
blendpixel(nx, ny+1, colr, colg, colb, 223);
blendpixel(nx, ny-1, colr, colg, colb, 223);
BlendPixel({ nx+1, ny }, RGBA<uint8_t>(colr, colg, colb, 223));
BlendPixel({ nx-1, ny }, RGBA<uint8_t>(colr, colg, colb, 223));
BlendPixel({ nx, ny+1 }, RGBA<uint8_t>(colr, colg, colb, 223));
BlendPixel({ nx, ny-1 }, RGBA<uint8_t>(colr, colg, colb, 223));
blendpixel(nx+1, ny-1, colr, colg, colb, 112);
blendpixel(nx-1, ny-1, colr, colg, colb, 112);
blendpixel(nx+1, ny+1, colr, colg, colb, 112);
blendpixel(nx-1, ny+1, colr, colg, colb, 112);
BlendPixel({ nx+1, ny-1 }, RGBA<uint8_t>(colr, colg, colb, 112));
BlendPixel({ nx-1, ny-1 }, RGBA<uint8_t>(colr, colg, colb, 112));
BlendPixel({ nx+1, ny+1 }, RGBA<uint8_t>(colr, colg, colb, 112));
BlendPixel({ nx-1, ny+1 }, RGBA<uint8_t>(colr, colg, colb, 112));
}
if(pixel_mode & PMODE_GLOW)
{
@ -582,11 +582,11 @@ void Renderer::render_parts()
for (y=-3; y<4; y++)
{
if (abs(x)+abs(y) <2 && !(abs(x)==2||abs(y)==2))
blendpixel(x+nx, y+ny, colr, colg, colb, 30);
BlendPixel({ x+nx, y+ny }, RGBA<uint8_t>(colr, colg, colb, 30));
if (abs(x)+abs(y) <=3 && abs(x)+abs(y))
blendpixel(x+nx, y+ny, colr, colg, colb, 20);
BlendPixel({ x+nx, y+ny }, RGBA<uint8_t>(colr, colg, colb, 20));
if (abs(x)+abs(y) == 2)
blendpixel(x+nx, y+ny, colr, colg, colb, 10);
BlendPixel({ x+nx, y+ny }, RGBA<uint8_t>(colr, colg, colb, 10));
}
}
}
@ -606,16 +606,16 @@ void Renderer::render_parts()
{
flicker = float(rng()%20);
gradv = flicker + fabs(parts[i].vx)*17 + fabs(sim->parts[i].vy)*17;
blendpixel(nx, ny, colr, colg, colb, int((gradv*4)>255?255:(gradv*4)) );
blendpixel(nx+1, ny, colr, colg, colb,int( (gradv*2)>255?255:(gradv*2)) );
blendpixel(nx-1, ny, colr, colg, colb, int((gradv*2)>255?255:(gradv*2)) );
blendpixel(nx, ny+1, colr, colg, colb, int((gradv*2)>255?255:(gradv*2)) );
blendpixel(nx, ny-1, colr, colg, colb, int((gradv*2)>255?255:(gradv*2)) );
BlendPixel({ nx, ny }, RGBA<uint8_t>(colr, colg, colb, int((gradv*4)>255?255:(gradv*4)) ));
BlendPixel({ nx+1, ny }, RGBA<uint8_t>(colr, colg, colb,int( (gradv*2)>255?255:(gradv*2)) ));
BlendPixel({ nx-1, ny }, RGBA<uint8_t>(colr, colg, colb, int((gradv*2)>255?255:(gradv*2)) ));
BlendPixel({ nx, ny+1 }, RGBA<uint8_t>(colr, colg, colb, int((gradv*2)>255?255:(gradv*2)) ));
BlendPixel({ nx, ny-1 }, RGBA<uint8_t>(colr, colg, colb, int((gradv*2)>255?255:(gradv*2)) ));
if (gradv>255) gradv=255;
blendpixel(nx+1, ny-1, colr, colg, colb, int(gradv));
blendpixel(nx-1, ny-1, colr, colg, colb, int(gradv));
blendpixel(nx+1, ny+1, colr, colg, colb, int(gradv));
blendpixel(nx-1, ny+1, colr, colg, colb, int(gradv));
BlendPixel({ nx+1, ny-1 }, RGBA<uint8_t>(colr, colg, colb, int(gradv)));
BlendPixel({ nx-1, ny-1 }, RGBA<uint8_t>(colr, colg, colb, int(gradv)));
BlendPixel({ nx+1, ny+1 }, RGBA<uint8_t>(colr, colg, colb, int(gradv)));
BlendPixel({ nx-1, ny+1 }, RGBA<uint8_t>(colr, colg, colb, int(gradv)));
for (x = 1; gradv>0.5; x++) {
AddPixel({ nx+x, ny }, RGBA<uint8_t>(colr, colg, colb, int(gradv)));
AddPixel({ nx-x, ny }, RGBA<uint8_t>(colr, colg, colb, int(gradv)));
@ -628,16 +628,16 @@ void Renderer::render_parts()
{
flicker = float(rng()%20);
gradv = flicker + fabs(parts[i].vx)*17 + fabs(parts[i].vy)*17;
blendpixel(nx, ny, colr, colg, colb, int((gradv*4)>255?255:(gradv*4)) );
blendpixel(nx+1, ny, colr, colg, colb, int((gradv*2)>255?255:(gradv*2)) );
blendpixel(nx-1, ny, colr, colg, colb, int((gradv*2)>255?255:(gradv*2)) );
blendpixel(nx, ny+1, colr, colg, colb, int((gradv*2)>255?255:(gradv*2)) );
blendpixel(nx, ny-1, colr, colg, colb, int((gradv*2)>255?255:(gradv*2)) );
BlendPixel({ nx, ny }, RGBA<uint8_t>(colr, colg, colb, int((gradv*4)>255?255:(gradv*4)) ));
BlendPixel({ nx+1, ny }, RGBA<uint8_t>(colr, colg, colb, int((gradv*2)>255?255:(gradv*2)) ));
BlendPixel({ nx-1, ny }, RGBA<uint8_t>(colr, colg, colb, int((gradv*2)>255?255:(gradv*2)) ));
BlendPixel({ nx, ny+1 }, RGBA<uint8_t>(colr, colg, colb, int((gradv*2)>255?255:(gradv*2)) ));
BlendPixel({ nx, ny-1 }, RGBA<uint8_t>(colr, colg, colb, int((gradv*2)>255?255:(gradv*2)) ));
if (gradv>255) gradv=255;
blendpixel(nx+1, ny-1, colr, colg, colb, int(gradv));
blendpixel(nx-1, ny-1, colr, colg, colb, int(gradv));
blendpixel(nx+1, ny+1, colr, colg, colb, int(gradv));
blendpixel(nx-1, ny+1, colr, colg, colb, int(gradv));
BlendPixel({ nx+1, ny-1 }, RGBA<uint8_t>(colr, colg, colb, int(gradv)));
BlendPixel({ nx-1, ny-1 }, RGBA<uint8_t>(colr, colg, colb, int(gradv)));
BlendPixel({ nx+1, ny+1 }, RGBA<uint8_t>(colr, colg, colb, int(gradv)));
BlendPixel({ nx-1, ny+1 }, RGBA<uint8_t>(colr, colg, colb, int(gradv)));
for (x = 1; gradv>0.5; x++) {
AddPixel({ nx+x, ny }, RGBA<uint8_t>(colr, colg, colb, int(gradv)));
AddPixel({ nx-x, ny }, RGBA<uint8_t>(colr, colg, colb, int(gradv)));
@ -758,7 +758,7 @@ void Renderer::draw_other() // EMP effect
for (j=0; j<YRES; j++)
for (i=0; i<XRES; i++)
{
blendpixel(i, j, r, g, b, a);
BlendPixel({ i, j }, RGBA<uint8_t>(r, g, b, a));
}
}
}
@ -778,9 +778,9 @@ void Renderer::draw_grav_zones()
for (j=0; j<CELL; j++)//draws the colors
for (i=0; i<CELL; i++)
if(i == j)
blendpixel(x*CELL+i, y*CELL+j, 255, 200, 0, 120);
BlendPixel({ x*CELL+i, y*CELL+j }, RGBA<uint8_t>(255, 200, 0, 120));
else
blendpixel(x*CELL+i, y*CELL+j, 32, 32, 32, 120);
BlendPixel({ x*CELL+i, y*CELL+j }, RGBA<uint8_t>(32, 32, 32, 120));
}
}
}
@ -1054,14 +1054,14 @@ void Renderer::DrawWalls()
for (int j = 0; j < CELL; j++)
for (int i =0; i < CELL; i++)
if (i&j&1)
drawblob((x*CELL+i), (y*CELL+j), prgb.Red, prgb.Green, prgb.Blue);
DrawBlob({ x*CELL+i, y*CELL+j }, prgb);
}
else
{
for (int j = 0; j < CELL; j++)
for (int i = 0; i < CELL; i++)
if (!(i&j&1))
drawblob((x*CELL+i), (y*CELL+j), prgb.Red, prgb.Green, prgb.Blue);
DrawBlob({ x*CELL+i, y*CELL+j }, prgb);
}
}
else if (wt == WL_WALLELEC)
@ -1070,9 +1070,9 @@ void Renderer::DrawWalls()
for (int i =0; i < CELL; i++)
{
if (!((y*CELL+j)%2) && !((x*CELL+i)%2))
drawblob((x*CELL+i), (y*CELL+j), prgb.Red, prgb.Green, prgb.Blue);
DrawBlob({ x*CELL+i, y*CELL+j }, prgb);
else
drawblob((x*CELL+i), (y*CELL+j), 0x80, 0x80, 0x80);
DrawBlob({ x*CELL+i, y*CELL+j }, 0x808080_rgb);
}
}
else if (wt == WL_EHOLE)
@ -1081,7 +1081,7 @@ void Renderer::DrawWalls()
{
for (int j = 0; j < CELL; j++)
for (int i = 0; i < CELL; i++)
drawblob((x*CELL+i), (y*CELL+j), 0x24, 0x24, 0x24);
DrawBlob({ x*CELL+i, y*CELL+j }, 0x242424_rgb);
for (int j = 0; j < CELL; j += 2)
for (int i = 0; i < CELL; i += 2)
// looks bad if drawing black blobs
@ -1091,30 +1091,30 @@ void Renderer::DrawWalls()
{
for (int j = 0; j < CELL; j += 2)
for (int i = 0; i < CELL; i += 2)
drawblob((x*CELL+i), (y*CELL+j), 0x24, 0x24, 0x24);
DrawBlob({ x*CELL+i, y*CELL+j }, 0x242424_rgb);
}
}
break;
case 1:
for (int j = 0; j < CELL; j += 2)
for (int i = (j>>1)&1; i < CELL; i += 2)
drawblob((x*CELL+i), (y*CELL+j), prgb.Red, prgb.Green, prgb.Blue);
DrawBlob({ x*CELL+i, y*CELL+j }, prgb);
break;
case 2:
for (int j = 0; j < CELL; j += 2)
for (int i = 0; i < CELL; i+=2)
drawblob((x*CELL+i), (y*CELL+j), prgb.Red, prgb.Green, prgb.Blue);
DrawBlob({ x*CELL+i, y*CELL+j }, prgb);
break;
case 3:
for (int j = 0; j < CELL; j++)
for (int i = 0; i < CELL; i++)
drawblob((x*CELL+i), (y*CELL+j), prgb.Red, prgb.Green, prgb.Blue);
DrawBlob({ x*CELL+i, y*CELL+j }, prgb);
break;
case 4:
for (int j = 0; j < CELL; j++)
for (int i = 0; i < CELL; i++)
if (i == j)
drawblob((x*CELL+i), (y*CELL+j), prgb.Red, prgb.Green, prgb.Blue);
DrawBlob({ x*CELL+i, y*CELL+j }, prgb);
else if (i == j+1 || (i == 0 && j == CELL-1))
video[{ x * CELL + i, y * CELL + j }] = gc;
else

View File

@ -101,7 +101,7 @@ public:
void RenderEnd();
void RenderZoom();
void DrawBlob(int x, int y, unsigned char cr, unsigned char cg, unsigned char cb);
void DrawBlob(Vec2<int> pos, RGB<uint8_t> colour);
void DrawWalls();
void DrawSigns();
void render_gravlensing(const Video &source);
@ -122,8 +122,6 @@ public:
VideoBuffer DumpFrame();
void drawblob(int x, int y, unsigned char cr, unsigned char cg, unsigned char cb);
pixel GetPixel(Vec2<int> pos) const;
//...
//Display mode modifiers

View File

@ -71,8 +71,8 @@ void Renderer::RenderZoom()
pixel pix;
DrawFilledRect(RectSized(zoomWindowPosition, { zoomScopeSize * ZFACTOR, zoomScopeSize * ZFACTOR }), 0x000000_rgb);
drawrect(zoomWindowPosition.X-2, zoomWindowPosition.Y-2, zoomScopeSize*ZFACTOR+3, zoomScopeSize*ZFACTOR+3, 192, 192, 192, 255);
drawrect(zoomWindowPosition.X-1, zoomWindowPosition.Y-1, zoomScopeSize*ZFACTOR+1, zoomScopeSize*ZFACTOR+1, 0, 0, 0, 255);
DrawRect(RectSized(zoomWindowPosition - Vec2{ 2, 2 }, Vec2{ zoomScopeSize*ZFACTOR+3, zoomScopeSize*ZFACTOR+3 }), RGB<uint8_t>(192, 192, 192));
DrawRect(RectSized(zoomWindowPosition - Vec2{ 1, 1 }, Vec2{ zoomScopeSize*ZFACTOR+1, zoomScopeSize*ZFACTOR+1 }), RGB<uint8_t>(0, 0, 0));
for (j=0; j<zoomScopeSize; j++)
for (i=0; i<zoomScopeSize; i++)
{
@ -97,17 +97,16 @@ void Renderer::RenderZoom()
}
}
void Renderer::DrawBlob(int x, int y, unsigned char cr, unsigned char cg, unsigned char cb)
void Renderer::DrawBlob(Vec2<int> pos, RGB<uint8_t> colour)
{
blendpixel(x+1, y, cr, cg, cb, 112);
blendpixel(x-1, y, cr, cg, cb, 112);
blendpixel(x, y+1, cr, cg, cb, 112);
blendpixel(x, y-1, cr, cg, cb, 112);
blendpixel(x+1, y-1, cr, cg, cb, 64);
blendpixel(x-1, y-1, cr, cg, cb, 64);
blendpixel(x+1, y+1, cr, cg, cb, 64);
blendpixel(x-1, y+1, cr, cg, cb, 64);
BlendPixel(pos + Vec2{ +1, 0 }, colour.WithAlpha(112));
BlendPixel(pos + Vec2{ -1, 0 }, colour.WithAlpha(112));
BlendPixel(pos + Vec2{ 0, 1 }, colour.WithAlpha(112));
BlendPixel(pos + Vec2{ 0, -1 }, colour.WithAlpha(112));
BlendPixel(pos + Vec2{ 1, -1 }, colour.WithAlpha(64));
BlendPixel(pos + Vec2{ -1, -1 }, colour.WithAlpha(64));
BlendPixel(pos + Vec2{ 1, 1 }, colour.WithAlpha(64));
BlendPixel(pos + Vec2{ -1, +1 }, colour.WithAlpha(64));
}
@ -159,19 +158,6 @@ void Renderer::prepare_alpha(int size, float intensity)
}
void Renderer::drawblob(int x, int y, unsigned char cr, unsigned char cg, unsigned char cb)
{
blendpixel(x+1, y, cr, cg, cb, 112);
blendpixel(x-1, y, cr, cg, cb, 112);
blendpixel(x, y+1, cr, cg, cb, 112);
blendpixel(x, y-1, cr, cg, cb, 112);
blendpixel(x+1, y-1, cr, cg, cb, 64);
blendpixel(x-1, y-1, cr, cg, cb, 64);
blendpixel(x+1, y+1, cr, cg, cb, 64);
blendpixel(x-1, y+1, cr, cg, cb, 64);
}
pixel Renderer::GetPixel(Vec2<int> pos) const
{
if (pos.X<0 || pos.Y<0 || pos.X>=VIDXRES || pos.Y>=VIDYRES)

View File

@ -255,10 +255,10 @@ void ColourPickerActivity::OnKeyPress(int key, int scan, bool repeat, bool shift
void ColourPickerActivity::OnDraw()
{
Graphics * g = GetGraphics();
g->fillrect(Position.X-2, Position.Y-2, Size.X+3, Size.Y+3, 0, 0, 0, currentAlpha);
g->drawrect(Position.X, Position.Y, Size.X, Size.Y, 255, 255, 255, 255);
g->BlendFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), RGBA<uint8_t>(0, 0, 0, currentAlpha));
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(255, 255, 255));
g->drawrect(Position.X+4, Position.Y+4, 258, 130, 180, 180, 180, 255);
g->DrawRect(RectSized(Position + Vec2{ 4, 4 }, Vec2{ 258, 130 }), RGB<uint8_t>(180, 180, 180));
auto offset = Position + Vec2{ 5, 5 };
@ -278,7 +278,7 @@ void ColourPickerActivity::OnDraw()
int cg = 0;
int cb = 0;
HSV_to_RGB(hue, 255-saturation, currentValue, &cr, &cg, &cb);
g->blendpixel(currx, (saturation/2)+offset.Y, cr, cg, cb, currentAlpha);
g->BlendPixel({ currx, (saturation/2)+offset.Y }, RGBA<uint8_t>(cr, cg, cb, currentAlpha));
}
}
@ -291,10 +291,9 @@ void ColourPickerActivity::OnDraw()
HSV_to_RGB(hue, currentSaturation, currentValue, &red, &green, &blue);
for (int ry = 0; ry < (hSlider->Size.Y / 2) - 1; ry++)
{
g->blendpixel(
rx + offset.X + hSlider->Position.X,
ry + offset.Y + hSlider->Position.Y,
red, green, blue, currentAlpha
g->BlendPixel(
offset + hSlider->Position + Vec2{ rx, ry },
RGBA<uint8_t>(red, green, blue, currentAlpha)
);
}
}

View File

@ -110,9 +110,9 @@ void ConsoleView::NotifyCurrentCommandChanged(ConsoleModel * sender)
void ConsoleView::OnDraw()
{
Graphics * g = GetGraphics();
g->fillrect(Position.X, Position.Y, Size.X, Size.Y, 0, 0, 0, 110);
g->draw_line(Position.X, Position.Y+Size.Y-16, Position.X+Size.X, Position.Y+Size.Y-16, 255, 255, 255, 160);
g->draw_line(Position.X, Position.Y+Size.Y, Position.X+Size.X, Position.Y+Size.Y, 255, 255, 255, 200);
g->BlendFilledRect(RectSized(Position, Size), RGBA<uint8_t>(0, 0, 0, 110));
g->BlendLine(Position + Vec2{ 0, Size.Y-16 }, Position + Size - Vec2{ 0, 16 }, RGBA<uint8_t>(255, 255, 255, 160));
g->BlendLine(Position + Vec2{ 0, Size.Y }, Position + Size, RGBA<uint8_t>(255, 255, 255, 200));
}
void ConsoleView::OnTick(float dt)

View File

@ -83,5 +83,5 @@ void ConfirmPrompt::OnDraw()
Graphics * g = GetGraphics();
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
g->drawrect(Position.X, Position.Y, Size.X, Size.Y, 200, 200, 200, 255);
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(200, 200, 200));
}

View File

@ -59,5 +59,5 @@ void ErrorMessage::OnDraw()
Graphics * g = GetGraphics();
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
g->drawrect(Position.X, Position.Y, Size.X, Size.Y, 200, 200, 200, 255);
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(200, 200, 200));
}

View File

@ -75,5 +75,5 @@ void InformationMessage::OnDraw()
Graphics * g = GetGraphics();
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
g->drawrect(Position.X, Position.Y, Size.X, Size.Y, 200, 200, 200, 255);
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(200, 200, 200));
}

View File

@ -53,7 +53,7 @@ void SaveIDMessage::OnDraw()
Graphics * g = GetGraphics();
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
g->drawrect(Position.X, Position.Y, Size.X, Size.Y, 200, 200, 200, 255);
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(200, 200, 200));
}
void SaveIDMessage::OnTryExit(ExitMethod method)

View File

@ -94,5 +94,5 @@ void TextPrompt::OnDraw()
Graphics * g = GetGraphics();
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
g->drawrect(Position.X, Position.Y, Size.X, Size.Y, 200, 200, 200, 255);
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(200, 200, 200));
}

View File

@ -213,9 +213,12 @@ void ElementSearchActivity::OnDraw()
{
Graphics * g = GetGraphics();
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
g->drawrect(Position.X, Position.Y, Size.X, Size.Y, 255, 255, 255, 255);
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(255, 255, 255));
g->drawrect(Position.X+searchField->Position.X, Position.Y+searchField->Position.Y+searchField->Size.Y+8, searchField->Size.X, Size.Y-(searchField->Position.Y+searchField->Size.Y+8)-23, 255, 255, 255, 180);
g->BlendRect(
RectSized(Position + searchField->Position + Vec2{ 0, searchField->Size.Y+8 },
{ searchField->Size.X, Size.Y-(searchField->Position.Y+searchField->Size.Y+8)-23 }),
RGBA<uint8_t>(255, 255, 255, 180));
if (toolTipPresence && toolTip.length())
{
g->BlendText({ 10, Size.Y+70 }, toolTip, RGBA<uint8_t>(255, 255, 255, toolTipPresence>51?255:toolTipPresence*5));

View File

@ -304,7 +304,7 @@ void FileBrowserActivity::OnDraw()
//Window Background+Outline
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
g->drawrect(Position.X, Position.Y, Size.X, Size.Y, 255, 255, 255, 255);
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(255, 255, 255));
}
FileBrowserActivity::~FileBrowserActivity()

View File

@ -479,26 +479,26 @@ void FontEditor::OnDraw()
std::array<std::array<char, MAX_WIDTH>, FONT_H> const &pixels = fontPixels[currentChar];
int areaWidth = 8 + width * FONT_SCALE + 8;
g->fillrect(0, 0, areaWidth, 8 + FONT_H * FONT_SCALE + 4 + FONT_H + 4, bgR, bgG, bgB, 255);
g->DrawFilledRect(RectSized(Vec2{ 0, 0 }, Vec2{ areaWidth, 8 + FONT_H * FONT_SCALE + 4 + FONT_H + 4 }), RGB<uint8_t>(bgR, bgG, bgB));
for(int j = 0; j < FONT_H; j++)
for(int i = 0; i < width; i++)
g->fillrect(8 + i * FONT_SCALE, 8 + j * FONT_SCALE, FONT_SCALE - grid, FONT_SCALE - grid, fgR, fgG, fgB, pixels[j][i] * 255 / 3);
g->BlendFilledRect(RectSized(Vec2{ 8 + i * FONT_SCALE, 8 + j * FONT_SCALE }, Vec2{ FONT_SCALE - grid, FONT_SCALE - grid }), RGBA<uint8_t>(fgR, fgG, fgB, pixels[j][i] * 255 / 3));
for(int j = 0; j < FONT_H; j++)
for(int i = 0; i < width; i++)
g->blendpixel(8 + i, 8 + FONT_H * FONT_SCALE + 4 + j, fgR, fgG, fgB, pixels[j][i] * 255 / 3);
g->BlendPixel({ 8 + i, 8 + FONT_H * FONT_SCALE + 4 + j }, RGBA<uint8_t>(fgR, fgG, fgB, pixels[j][i] * 255 / 3));
if(rulers)
{
g->draw_line(0, 7 + 0 * FONT_SCALE , areaWidth - 1, 7 + 0 * FONT_SCALE, 128, 128, 128, 255);
g->draw_line(0, 7 + 2 * FONT_SCALE , areaWidth - 1, 7 + 2 * FONT_SCALE, 128, 128, 128, 255);
g->draw_line(0, 7 + 4 * FONT_SCALE , areaWidth - 1, 7 + 4 * FONT_SCALE, 128, 128, 128, 255);
g->draw_line(0, 7 + 9 * FONT_SCALE , areaWidth - 1, 7 + 9 * FONT_SCALE, 128, 128, 128, 255);
g->draw_line(0, 7 + 12 * FONT_SCALE , areaWidth - 1, 7 + 12 * FONT_SCALE, 128, 128, 128, 255);
g->DrawLine({ 0, 7 + 0 * FONT_SCALE }, { areaWidth - 1, 7 + 0 * FONT_SCALE }, RGB<uint8_t>(128, 128, 128));
g->DrawLine({ 0, 7 + 2 * FONT_SCALE }, { areaWidth - 1, 7 + 2 * FONT_SCALE }, RGB<uint8_t>(128, 128, 128));
g->DrawLine({ 0, 7 + 4 * FONT_SCALE }, { areaWidth - 1, 7 + 4 * FONT_SCALE }, RGB<uint8_t>(128, 128, 128));
g->DrawLine({ 0, 7 + 9 * FONT_SCALE }, { areaWidth - 1, 7 + 9 * FONT_SCALE }, RGB<uint8_t>(128, 128, 128));
g->DrawLine({ 0, 7 + 12 * FONT_SCALE }, { areaWidth - 1, 7 + 12 * FONT_SCALE }, RGB<uint8_t>(128, 128, 128));
g->draw_line(7, 8, 7, 7 + FONT_H * FONT_SCALE, 128, 128, 128, 255);
g->draw_line(7 + width * FONT_SCALE, 8, 7 + width * FONT_SCALE, 7 + FONT_H * FONT_SCALE, 128, 128, 128, 255);
g->DrawLine({ 7, 8 }, { 7, 7 + FONT_H * FONT_SCALE }, RGB<uint8_t>(128, 128, 128));
g->DrawLine({ 7 + width * FONT_SCALE, 8}, { 7 + width * FONT_SCALE, 7 + FONT_H * FONT_SCALE }, RGB<uint8_t>(128, 128, 128));
}
}
else

View File

@ -186,7 +186,7 @@ void GOLWindow::OnDraw()
Graphics * g = GetGraphics();
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
g->drawrect(Position.X, Position.Y, Size.X, Size.Y, 200, 200, 200, 255);
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(200, 200, 200));
int width = Size.X - 60;
for (int xx = 0; xx < width; ++xx)
@ -197,7 +197,7 @@ void GOLWindow::OnDraw()
auto rr = int(highColour.Red * (1.f - f) + lowColour.Red * f);
auto gg = int(highColour.Green * (1.f - f) + lowColour.Green * f);
auto bb = int(highColour.Blue * (1.f - f) + lowColour.Blue * f);
g->blendpixel(Position.X + xx + 30, Position.Y + yy + 67, rr, gg, bb, 255);
g->DrawPixel(Position + Vec2{ xx + 30, yy + 67 }, RGB<uint8_t>(rr, gg, bb));
}
}
}

View File

@ -153,7 +153,7 @@ public:
drawn = true;
if(showSplit)
g->draw_line(splitPosition+screenPos.X, screenPos.Y+1, splitPosition+screenPos.X, screenPos.Y+Size.Y-2, 180, 180, 180, 255);
g->DrawLine(screenPos + Vec2{ splitPosition, 1 }, screenPos + Vec2{ splitPosition, Size.Y-2 }, RGB<uint8_t>(180, 180, 180));
}
};
@ -1837,10 +1837,10 @@ void GameView::DoDraw()
255, 195, 145, 103, 69, 42, 23, 10, 3
} };
auto *g = GetGraphics();
for (auto x = 0U; x < fadeout.size(); ++x)
for (auto x = 0; x < int(fadeout.size()); ++x)
{
g->draw_line(x, YRES + 1, x, YRES + 18, 0, 0, 0, fadeout[x]);
g->draw_line(XRES - x, YRES + 1, XRES - x, YRES + 18, 0, 0, 0, fadeout[x]);
g->BlendLine({ x, YRES + 1 }, { x, YRES + 18 }, 0x000000_rgb .WithAlpha(fadeout[x]));
g->BlendLine({ XRES - x, YRES + 1 }, { XRES - x, YRES + 18 }, 0x000000_rgb .WithAlpha(fadeout[x]));
}
c->Tick();
@ -2139,7 +2139,7 @@ void GameView::OnDraw()
{
if(selectPoint1.X==-1)
{
ren->fillrect(0, 0, XRES, YRES, 0, 0, 0, 100);
ren->BlendFilledRect(RectSized(Vec2{ 0, 0 }, Vec2{ XRES, YRES }), RGBA<uint8_t>(0, 0, 0, 100));
}
else
{
@ -2153,11 +2153,11 @@ void GameView::OnDraw()
if(y2>YRES-1)
y2 = YRES-1;
ren->fillrect(0, 0, XRES, y1, 0, 0, 0, 100);
ren->fillrect(0, y2+1, XRES, YRES-y2-1, 0, 0, 0, 100);
ren->BlendFilledRect(RectSized(Vec2{ 0, 0 }, Vec2{ XRES, y1 }), RGBA<uint8_t>(0, 0, 0, 100));
ren->BlendFilledRect(RectSized(Vec2{ 0, y2+1 }, Vec2{ XRES, YRES-y2-1 }), RGBA<uint8_t>(0, 0, 0, 100));
ren->fillrect(0, y1, x1, (y2-y1)+1, 0, 0, 0, 100);
ren->fillrect(x2+1, y1, XRES-x2-1, (y2-y1)+1, 0, 0, 0, 100);
ren->BlendFilledRect(RectSized(Vec2{ 0, y1 }, Vec2{ x1, (y2-y1)+1 }), RGBA<uint8_t>(0, 0, 0, 100));
ren->BlendFilledRect(RectSized(Vec2{ x2+1, y1 }, Vec2{ XRES-x2-1, (y2-y1)+1 }), RGBA<uint8_t>(0, 0, 0, 100));
ren->XorDottedRect(RectBetween(Vec2{ x1, y1 }, Vec2{ x2, y2 }));
}
@ -2198,7 +2198,7 @@ void GameView::OnDraw()
break;
}
startY -= 14;
g->fillrect(startX-3, startY-3, Graphics::TextSize(message).X + 5, 14, 0, 0, 0, std::min(100, alpha));
g->BlendFilledRect(RectSized(Vec2{ startX-3, startY-3 }, Vec2{ Graphics::TextSize(message).X + 5, 14 }), RGBA<uint8_t>(0, 0, 0, std::min(100, alpha)));
g->BlendText({ startX, startY }, message, RGBA<uint8_t>(255, 255, 255, alpha));
(*iter).second -= 3;
}
@ -2210,7 +2210,7 @@ void GameView::OnDraw()
String sampleInfo = String::Build("#", screenshotIndex, " ", String(0xE00E), " REC");
int textWidth = Graphics::TextSize(sampleInfo).X - 1;
g->fillrect(XRES-20-textWidth, 12, textWidth+8, 15, 0, 0, 0, 127);
g->BlendFilledRect(RectSized(Vec2{ XRES-20-textWidth, 12 }, Vec2{ textWidth+8, 15 }), RGBA<uint8_t>(0, 0, 0, 127));
g->BlendText({ XRES-16-textWidth, 16 }, sampleInfo, RGBA<uint8_t>(255, 50, 20, 255));
}
else if(showHud)
@ -2331,14 +2331,14 @@ void GameView::OnDraw()
}
int textWidth = Graphics::TextSize(sampleInfo.Build()).X - 1;
g->fillrect(XRES-20-textWidth, 12, textWidth+8, 15, 0, 0, 0, int(alpha*0.5f));
g->BlendFilledRect(RectSized(Vec2{ XRES-20-textWidth, 12 }, Vec2{ textWidth+8, 15 }), RGBA<uint8_t>(0, 0, 0, int(alpha*0.5f)));
g->BlendText({ XRES-16-textWidth, 16 }, sampleInfo.Build(), RGBA<uint8_t>(255, 255, 255, int(alpha*0.75f)));
if (wavelengthGfx)
{
int i, cr, cg, cb, j, h = 3, x = XRES-19-textWidth, y = 10;
int tmp;
g->fillrect(x, y, 30, h, 64, 64, 64, alpha); // coords -1 size +1 to work around bug in fillrect - TODO: fix fillrect
g->BlendFilledRect(RectSized(Vec2{ x, y }, Vec2{ 30, h }), RGBA<uint8_t>(64, 64, 64, alpha));
for (i = 0; i < 30; i++)
{
if ((wavelengthGfx >> i)&1)
@ -2364,7 +2364,7 @@ void GameView::OnDraw()
cg *= tmp;
cb *= tmp;
for (j=0; j<h; j++)
g->blendpixel(x+29-i, y+j, cr>255?255:cr, cg>255?255:cg, cb>255?255:cb, alpha);
g->BlendPixel({ x+29-i, y+j }, RGBA<uint8_t>(cr>255?255:cr, cg>255?255:cg, cb>255?255:cb, alpha));
}
}
}
@ -2389,7 +2389,7 @@ void GameView::OnDraw()
}
auto textWidth = Graphics::TextSize(sampleInfo.Build()).X - 1;
g->fillrect(XRES-20-textWidth, 27, textWidth+8, 14, 0, 0, 0, int(alpha*0.5f));
g->BlendFilledRect(RectSized(Vec2{ XRES-20-textWidth, 27 }, Vec2{ textWidth+8, 14 }), RGBA<uint8_t>(0, 0, 0, int(alpha*0.5f)));
g->BlendText({ XRES-16-textWidth, 30 }, sampleInfo.Build(), RGBA<uint8_t>(255, 255, 255, int(alpha*0.75f)));
}
}
@ -2418,7 +2418,7 @@ void GameView::OnDraw()
int textWidth = Graphics::TextSize(fpsInfo.Build()).X - 1;
int alpha = 255-introText*5;
g->fillrect(12, 12, textWidth+8, 15, 0, 0, 0, int(alpha*0.5));
g->BlendFilledRect(RectSized(Vec2{ 12, 12 }, Vec2{ textWidth+8, 15 }), RGBA<uint8_t>(0, 0, 0, int(alpha*0.5)));
g->BlendText({ 16, 16 }, fpsInfo.Build(), RGBA<uint8_t>(32, 216, 255, int(alpha*0.75)));
}
@ -2445,7 +2445,7 @@ void GameView::OnDraw()
//Introduction text
if(introText && showHud)
{
g->fillrect(0, 0, WINDOWW, WINDOWH, 0, 0, 0, introText>51?102:introText*2);
g->BlendFilledRect(RectSized(Vec2{ 0, 0 }, WINDOW), RGBA<uint8_t>(0, 0, 0, introText>51?102:introText*2));
g->BlendText({ 16, 16 }, introTextMessage, RGBA<uint8_t>(255, 255, 255, introText>51?255:introText*5));
}
}

View File

@ -239,7 +239,7 @@ void PropertyWindow::OnDraw()
Graphics * g = GetGraphics();
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
g->drawrect(Position.X, Position.Y, Size.X, Size.Y, 200, 200, 200, 255);
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(200, 200, 200));
}
void PropertyWindow::OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt)

View File

@ -169,7 +169,7 @@ void SignWindow::DoDraw()
String text = currentSign.getDisplayText(sim, x, y, w, h);
g->DrawFilledRect(RectSized(Vec2{ x + 1, y + 1 }, Vec2{ w, h - 1 }), 0x000000_rgb);
g->drawrect(x, y, w+1, h, 192, 192, 192, 255);
g->DrawRect(RectSized(Vec2{ x, y }, Vec2{ w+1, h }), RGB<uint8_t>(192, 192, 192));
g->BlendText({ x+3, y+4 }, text, RGBA<uint8_t>(255, 255, 255, 255));
if (currentSign.ju != sign::None)
@ -180,7 +180,7 @@ void SignWindow::DoDraw()
dy = (currentSign.y > 18) ? -1 : 1;
for (int j=0; j<4; j++)
{
g->blendpixel(x, y, 192, 192, 192, 255);
g->DrawPixel({ x, y }, RGB<uint8_t>(192, 192, 192));
x+=dx;
y+=dy;
}
@ -223,7 +223,7 @@ void SignWindow::OnDraw()
Graphics * g = GetGraphics();
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
g->drawrect(Position.X, Position.Y, Size.X, Size.Y, 200, 200, 200, 255);
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(200, 200, 200));
}
std::unique_ptr<VideoBuffer> SignTool::GetIcon(int toolID, Vec2<int> size)

View File

@ -58,16 +58,16 @@ void ToolButton::Draw(const ui::Point& screenPos)
}
else
{
g->fillrect(screenPos.X+2, screenPos.Y+2, Size.X-4, Size.Y-4, Appearance.BackgroundInactive.Red, Appearance.BackgroundInactive.Green, Appearance.BackgroundInactive.Blue, Appearance.BackgroundInactive.Alpha);
g->BlendFilledRect(RectSized(screenPos + Vec2{ 2, 2 }, Size - Vec2{ 4, 4 }), Appearance.BackgroundInactive);
}
if (isMouseInside && currentSelection == -1)
{
g->drawrect(screenPos.X, screenPos.Y, Size.X, Size.Y, Appearance.BorderActive.Red, Appearance.BorderActive.Green, Appearance.BorderActive.Blue, Appearance.BorderActive.Alpha);
g->BlendRect(RectSized(screenPos, Size), Appearance.BorderActive);
}
else
{
g->drawrect(screenPos.X, screenPos.Y, Size.X, Size.Y, Appearance.BorderInactive.Red, Appearance.BorderInactive.Green, Appearance.BorderInactive.Blue, Appearance.BorderInactive.Alpha);
g->BlendRect(RectSized(screenPos, Size), Appearance.BorderInactive);
}
if (Favorite::Ref().IsFavorite(toolIdentifier))
{

View File

@ -113,19 +113,19 @@ void Button::Draw(const Point& screenPos)
}
bgColour = Appearance.BackgroundInactive;
g->fillrect(Position.X+1, Position.Y+1, Size.X-2, Size.Y-2, backgroundColour.Red, backgroundColour.Green, backgroundColour.Blue, backgroundColour.Alpha);
g->BlendFilledRect(RectSized(Position + Vec2{ 1, 1 }, Size - Vec2{ 2, 2 }), backgroundColour);
if(Appearance.Border == 1)
g->drawrect(Position.X, Position.Y, Size.X, Size.Y, borderColour.Red, borderColour.Green, borderColour.Blue, borderColour.Alpha);
g->BlendRect(RectSized(Position, Size), borderColour);
else
{
if(Appearance.Border.Top)
g->draw_line(Position.X, Position.Y, Position.X+Size.X-1, Position.Y, borderColour.Red, borderColour.Green, borderColour.Blue, borderColour.Alpha);
g->BlendLine(Position + Vec2{ 0 , 0 }, Position + Vec2{ Size.X-1, 0 }, borderColour);
if(Appearance.Border.Bottom)
g->draw_line(Position.X, Position.Y+Size.Y-1, Position.X+Size.X-1, Position.Y+Size.Y-1, borderColour.Red, borderColour.Green, borderColour.Blue, borderColour.Alpha);
g->BlendLine(Position + Vec2{ 0 , Size.Y-1 }, Position + Vec2{ Size.X-1, Size.Y-1 }, borderColour);
if(Appearance.Border.Left)
g->draw_line(Position.X, Position.Y, Position.X, Position.Y+Size.Y-1, borderColour.Red, borderColour.Green, borderColour.Blue, borderColour.Alpha);
g->BlendLine(Position + Vec2{ 0 , 0 }, Position + Vec2{ 0, Size.Y-1 }, borderColour);
if(Appearance.Border.Right)
g->draw_line(Position.X+Size.X-1, Position.Y, Position.X+Size.X-1, Position.Y+Size.Y-1, borderColour.Red, borderColour.Green, borderColour.Blue, borderColour.Alpha);
g->BlendLine(Position + Vec2{ Size.X-1, 0 }, Position + Vec2{ Size.X-1, Size.Y-1 }, borderColour);
}
g->BlendText(Position + textPosition, buttonDisplayText, textColour);

View File

@ -76,12 +76,12 @@ void Checkbox::Draw(const Point& screenPos)
Graphics * g = GetGraphics();
if(checked)
{
g->fillrect(screenPos.X+5, screenPos.Y+5, 6, 6, 255, 255, 255, 255);
g->DrawFilledRect(RectSized(screenPos + Vec2{ 5, 5 }, Vec2{ 6, 6 }), RGB<uint8_t>(255, 255, 255));
}
if(isMouseOver)
{
g->drawrect(screenPos.X+2, screenPos.Y+2, 12, 12, 255, 255, 255, 255);
g->fillrect(screenPos.X+5, screenPos.Y+5, 6, 6, 255, 255, 255, 170);
g->DrawRect(RectSized(screenPos + Vec2{ 2, 2 }, Vec2{ 12, 12 }), RGB<uint8_t>(255, 255, 255));
g->BlendFilledRect(RectSized(screenPos + Vec2{ 5, 5 }, Vec2{ 6, 6 }), RGBA<uint8_t>(255, 255, 255, 170));
if (!Appearance.icon)
g->BlendText(screenPos + Vec2{ 18, 4 }, text, RGBA<uint8_t>(255, 255, 255, 255));
else
@ -89,7 +89,7 @@ void Checkbox::Draw(const Point& screenPos)
}
else
{
g->drawrect(screenPos.X+2, screenPos.Y+2, 12, 12, 255, 255, 255, 200);
g->BlendRect(RectSized(screenPos + Vec2{ 2, 2 }, Vec2{ 12, 12 }), RGBA<uint8_t>(255, 255, 255, 200));
if (!Appearance.icon)
g->BlendText(screenPos + Vec2{ 18, 4 }, text, RGBA<uint8_t>(255, 255, 255, 200));
else

View File

@ -94,6 +94,6 @@ void ContextMenu::AddItem(ContextMenuItem item)
void ContextMenu::OnDraw()
{
Graphics * g = GetGraphics();
g->fillrect(Position.X, Position.Y, Size.X, Size.Y, 100, 100, 100, 255);
g->drawrect(Position.X, Position.Y, Size.X, Size.Y, Appearance.BackgroundInactive.Red, Appearance.BackgroundInactive.Green, Appearance.BackgroundInactive.Blue, Appearance.BackgroundInactive.Alpha);
g->DrawFilledRect(RectSized(Position, Size), RGB<uint8_t>(100, 100, 100));
g->BlendRect(RectSized(Position, Size), Appearance.BackgroundInactive);
}

View File

@ -120,11 +120,12 @@ void DirectionSelector::Draw(const ui::Point& screenPos)
for (auto &point : snapPoints)
{
g->fillrect(
(center.X + point.offset.X) - snapPointRadius,
(center.Y + point.offset.Y) - snapPointRadius,
snapPointRadius * 2 + 1, snapPointRadius * 2 + 1,
snapPointColor.Red, snapPointColor.Green, snapPointColor.Blue, altDown ? (int)(snapPointColor.Alpha / 2) : snapPointColor.Alpha
g->BlendFilledRect(
RectBetween(
center + point.offset - Vec2{ snapPointRadius, snapPointRadius },
center + point.offset + Vec2{ snapPointRadius, snapPointRadius }
),
RGBA<uint8_t>(snapPointColor.Red, snapPointColor.Green, snapPointColor.Blue, altDown ? (int)(snapPointColor.Alpha / 2) : snapPointColor.Alpha)
);
}

View File

@ -98,8 +98,8 @@ void DropDown::Draw(const Point& screenPos)
backgroundColour = Appearance.BackgroundInactive;
}
g->fillrect(Position.X-1, Position.Y-1, Size.X+2, Size.Y+2, backgroundColour.Red, backgroundColour.Green, backgroundColour.Blue, backgroundColour.Alpha);
g->drawrect(Position.X, Position.Y, Size.X, Size.Y, borderColour.Red, borderColour.Green, borderColour.Blue, borderColour.Alpha);
g->BlendFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), backgroundColour);
g->BlendRect(RectSized(Position, Size), borderColour);
if(optionIndex!=-1)
g->BlendText(Position + textPosition, options[optionIndex].first, textColour);
}

View File

@ -248,39 +248,39 @@ void Label::Draw(const Point& screenPos)
{
if (selectionLineH == selectionLineL)
{
g->fillrect(
screenPos.X + textPosition.X + selectionXL - 1,
screenPos.Y + textPosition.Y + selectionYL - 2,
selectionXH - selectionXL + 1,
FONT_H,
255, 255, 255, 255
g->DrawFilledRect(
RectSized(
screenPos + textPosition + Vec2{ selectionXL - 1, selectionYL - 2 },
Vec2{ selectionXH - selectionXL + 1, FONT_H }
),
RGB<uint8_t>(255, 255, 255)
);
}
else
{
g->fillrect(
screenPos.X + textPosition.X + selectionXL - 1,
screenPos.Y + textPosition.Y + selectionYL - 2,
textSize.X - selectionXL + 1,
FONT_H,
255, 255, 255, 255
g->DrawFilledRect(
RectSized(
screenPos + textPosition + Vec2{ selectionXL - 1, selectionYL - 2 },
Vec2{ textSize.X - selectionXL + 1, FONT_H }
),
RGB<uint8_t>(255, 255, 255)
);
for (int i = 1; i < selectionLineH - selectionLineL; ++i)
{
g->fillrect(
screenPos.X + textPosition.X - 1,
screenPos.Y + textPosition.Y + selectionYL - 2 + i * FONT_H,
textSize.X + 1,
FONT_H,
255, 255, 255, 255
g->DrawFilledRect(
RectSized(
screenPos + textPosition + Vec2{ -1, selectionYL - 2 + i * FONT_H },
Vec2{ textSize.X + 1, FONT_H }
),
RGB<uint8_t>(255, 255, 255)
);
}
g->fillrect(
screenPos.X + textPosition.X - 1,
screenPos.Y + textPosition.Y + selectionYH - 2,
selectionXH + 1,
FONT_H,
255, 255, 255, 255
g->DrawFilledRect(
RectSized(
screenPos + textPosition + Vec2{ -1, selectionYH - 2 },
Vec2{ selectionXH + 1, FONT_H }
),
RGB<uint8_t>(255, 255, 255)
);
}
}

View File

@ -46,7 +46,7 @@ void ProgressBar::Draw(const Point & screenPos)
ui::Colour progressBarColour = style::Colour::WarningTitle;
g->drawrect(screenPos.X, screenPos.Y, Size.X, Size.Y, 255, 255, 255, 255);
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(255, 255, 255));
if(progress!=-1)
{
@ -56,7 +56,7 @@ void ProgressBar::Draw(const Point & screenPos)
progress = 100;
float size = float(Size.X-4)*(float(progress)/100.0f); // TIL...
size = std::min(std::max(size, 0.0f), float(Size.X-4));
g->fillrect(screenPos.X + 2, screenPos.Y + 2, int(size), Size.Y-4, progressBarColour.Red, progressBarColour.Green, progressBarColour.Blue, 255);
g->DrawFilledRect(RectSized(screenPos + Vec2{ 2, 2 }, Vec2{ int(size), Size.Y-4 }), progressBarColour.NoAlpha());
}
} else {
int size = 40, rsize = 0;
@ -66,10 +66,10 @@ void ProgressBar::Draw(const Point & screenPos)
size = int((Size.X-4)-position+1);
rsize = 40-size;
}
g->fillrect(screenPos.X + 2 + int(position), screenPos.Y + 2, size, Size.Y-4, progressBarColour.Red, progressBarColour.Green, progressBarColour.Blue, 255);
g->DrawFilledRect(RectSized(screenPos + Vec2{ 2 + int(position), 2 }, Vec2{ size, Size.Y-4 }), progressBarColour.NoAlpha());
if(rsize)
{
g->fillrect(screenPos.X + 2, screenPos.Y + 2, rsize, Size.Y-4, progressBarColour.Red, progressBarColour.Green, progressBarColour.Blue, 255);
g->DrawFilledRect(RectSized(screenPos + Vec2{ 2, 2 }, Vec2{ rsize, Size.Y-4 }), progressBarColour.NoAlpha());
}
}
g->BlendText(screenPos + Vec2{ ((Size.X-(Graphics::TextSize(progressStatus).X - 1))/2), (Size.Y-8)/2 }, progressStatus, progress<50 ? RGBA<uint8_t>(255, 255, 255, 255) : RGBA<uint8_t>(0, 0, 0, 255));

View File

@ -188,7 +188,7 @@ void SaveButton::Draw(const Point& screenPos)
if(selected && selectable)
{
g->fillrect(screenPos.X, screenPos.Y, Size.X, Size.Y, 100, 170, 255, 100);
g->BlendFilledRect(RectSized(screenPos, Size), RGBA<uint8_t>(100, 170, 255, 100));
}
if (thumbnail)
@ -204,29 +204,18 @@ void SaveButton::Draw(const Point& screenPos)
{
if(save->id)
{
if(isMouseInside)
{
g->drawrect(screenPos.X-3+(Size.X-thumbBoxSize.X)/2, screenPos.Y+(Size.Y-21-thumbBoxSize.Y)/2, thumbBoxSize.X, thumbBoxSize.Y, 210, 230, 255, 255);
g->drawrect(screenPos.X-4+thumbBoxSize.X+(Size.X-thumbBoxSize.X)/2, screenPos.Y+(Size.Y-21-thumbBoxSize.Y)/2, 7, thumbBoxSize.Y, 210, 230, 255, 255);
}
else
{
g->drawrect(screenPos.X-3+(Size.X-thumbBoxSize.X)/2, screenPos.Y+(Size.Y-21-thumbBoxSize.Y)/2, thumbBoxSize.X, thumbBoxSize.Y, 180, 180, 180, 255);
g->drawrect(screenPos.X-4+thumbBoxSize.X+(Size.X-thumbBoxSize.X)/2, screenPos.Y+(Size.Y-21-thumbBoxSize.Y)/2, 7, thumbBoxSize.Y, 180, 180, 180, 255);
}
g->DrawRect(RectSized(screenPos + Vec2{ - 3, 0 } + (Size - thumbBoxSize - Vec2{ 0, 21 }) / 2, thumbBoxSize), isMouseInside ? RGB<uint8_t>(210, 230, 255) : RGB<uint8_t>(180, 180, 180));
g->DrawRect(RectSized(screenPos + Vec2{ thumbBoxSize.X - 4, 0 } + (Size - thumbBoxSize - Vec2{ 0, 21 }) / 2, Vec2{ 7, thumbBoxSize.Y }), isMouseInside ? RGB<uint8_t>(210, 230, 255) : RGB<uint8_t>(180, 180, 180));
g->fillrect(screenPos.X-3+thumbBoxSize.X+(Size.X-thumbBoxSize.X)/2, screenPos.Y+1+(Size.Y-20-thumbBoxSize.Y)/2, 5, (thumbBoxSize.Y+1)/2-1, 0, 107, 10, 255);
g->fillrect(screenPos.X-3+thumbBoxSize.X+(Size.X-thumbBoxSize.X)/2, screenPos.Y+(Size.Y-20)/2, 5, thumbBoxSize.Y/2-1, 107, 10, 0, 255);
g->DrawFilledRect(RectSized(screenPos + Vec2{ -3+thumbBoxSize.X+(Size.X-thumbBoxSize.X)/2, 1+(Size.Y-20-thumbBoxSize.Y)/2 }, Vec2{ 5, (thumbBoxSize.Y+1)/2-1 }), RGB<uint8_t>(0, 107, 10));
g->DrawFilledRect(RectSized(screenPos + Vec2{ -3+thumbBoxSize.X+(Size.X-thumbBoxSize.X)/2, (Size.Y-20)/2 }, Vec2{ 5, thumbBoxSize.Y/2-1 }), RGB<uint8_t>(107, 10, 0));
g->fillrect(screenPos.X-2+thumbBoxSize.X+(Size.X-thumbBoxSize.X)/2, screenPos.Y+(Size.Y-20)/2-voteBarHeightUp, 3, voteBarHeightUp, 57, 187, 57, 255); //green
g->fillrect(screenPos.X-2+thumbBoxSize.X+(Size.X-thumbBoxSize.X)/2, screenPos.Y+(Size.Y-20)/2, 3, voteBarHeightDown, 187, 57, 57, 255); //red
g->DrawFilledRect(RectSized(screenPos + Vec2{ -2+thumbBoxSize.X+(Size.X-thumbBoxSize.X)/2, (Size.Y-20)/2-voteBarHeightUp }, Vec2{ 3, voteBarHeightUp }), RGB<uint8_t>(57, 187, 57)); //green
g->DrawFilledRect(RectSized(screenPos + Vec2{ -2+thumbBoxSize.X+(Size.X-thumbBoxSize.X)/2, (Size.Y-20)/2 }, Vec2{ 3, voteBarHeightDown }), RGB<uint8_t>(187, 57, 57)); //red
}
else
{
if(isMouseInside)
g->drawrect(screenPos.X+(Size.X-thumbBoxSize.X)/2, screenPos.Y+(Size.Y-21-thumbBoxSize.Y)/2, thumbBoxSize.X, thumbBoxSize.Y, 210, 230, 255, 255);
else
g->drawrect(screenPos.X+(Size.X-thumbBoxSize.X)/2, screenPos.Y+(Size.Y-21-thumbBoxSize.Y)/2, thumbBoxSize.X, thumbBoxSize.Y, 180, 180, 180, 255);
g->DrawRect(RectSized(screenPos + (Size - thumbBoxSize - Vec2{ 0, 21 }) / 2, thumbBoxSize), isMouseInside ? RGB<uint8_t>(210, 230, 255) : RGB<uint8_t>(180, 180, 180));
}
g->BlendText(screenPos + Vec2{ (Size.X-(Graphics::TextSize(name).X - 1))/2, Size.Y - 21 }, name, (isMouseInside && !isMouseInsideAuthor) ? RGBA<uint8_t>(255, 255, 255, 255) : RGBA<uint8_t>(180, 180, 180, 255));
@ -243,7 +232,7 @@ void SaveButton::Draw(const Point& screenPos)
{
int x = screenPos.X;
int y = screenPos.Y-15+(Size.Y-thumbBoxSize.Y)/2+thumbBoxSize.Y;
g->fillrect(x+1, y+1, 7, 8, 255, 255, 255, 255);
g->DrawFilledRect(RectSized(Vec2{ x+1, y+1 }, Vec2{ 7, 8 }), RGB<uint8_t>(255, 255, 255));
g->BlendText({ x, y }, 0xE026, isMouseInsideHistory ? RGBA<uint8_t>(200, 100, 80, 255) : RGBA<uint8_t>(160, 70, 50, 255));
}
if (!save->GetPublished())
@ -254,10 +243,7 @@ void SaveButton::Draw(const Point& screenPos)
}
else if (file)
{
if (isMouseInside)
g->drawrect(screenPos.X+(Size.X-thumbBoxSize.X)/2, screenPos.Y+(Size.Y-21-thumbBoxSize.Y)/2, thumbBoxSize.X, thumbBoxSize.Y, 210, 230, 255, 255);
else
g->drawrect(screenPos.X+(Size.X-thumbBoxSize.X)/2, screenPos.Y+(Size.Y-21-thumbBoxSize.Y)/2, thumbBoxSize.X, thumbBoxSize.Y, 180, 180, 180, 255);
g->DrawRect(RectSized(screenPos + (Size - thumbBoxSize- Vec2{ 0, 21 }) / 2, thumbBoxSize), isMouseInside ? RGB<uint8_t>(210, 230, 255) : RGB<uint8_t>(180, 180, 180));
if (thumbSize.X)
g->XorDottedRect(RectSized(screenPos + (Size - thumbSize - Vec2{ 0, 21 }) / 2, thumbSize));
@ -267,9 +253,9 @@ void SaveButton::Draw(const Point& screenPos)
if(isMouseInside && selectable)
{
g->DrawFilledRect(RectSized(screenPos + Vec2{ Size.X - 19, 7 }, Vec2{ 13, 13 }), 0x000000_rgb);
g->drawrect(screenPos.X+(Size.X-20), screenPos.Y+6, 14, 14, 255, 255, 255, 255);
g->DrawRect(RectSized(screenPos + Vec2{ Size.X-20, 6 }, Vec2{ 14, 14 }), RGB<uint8_t>(255, 255, 255));
if(selected)
g->fillrect(screenPos.X+(Size.X-18), screenPos.Y+8, 10, 10, 255, 255, 255, 255);
g->DrawFilledRect(RectSized(screenPos + Vec2{ Size.X-18, 8 }, Vec2{ 10, 10 }), RGB<uint8_t>(255, 255, 255));
}
}

View File

@ -65,8 +65,8 @@ void ScrollPanel::Draw(const Point& screenPos)
scrollPos = float(Size.Y-scrollHeight)*(float(offsetY)/float(maxOffset.Y));
}
g->fillrect(screenPos.X+(Size.X-scrollBarWidth), screenPos.Y, scrollBarWidth, Size.Y, 125, 125, 125, 100);
g->fillrect(screenPos.X+(Size.X-scrollBarWidth), screenPos.Y+int(scrollPos), scrollBarWidth, int(scrollHeight)+1, 255, 255, 255, 255);
g->BlendFilledRect(RectSized(screenPos + Vec2{ Size.X - scrollBarWidth, 0 }, { scrollBarWidth, Size.Y }), RGBA<uint8_t>(125, 125, 125, 100));
g->DrawFilledRect(RectSized(screenPos + Vec2{ Size.X - scrollBarWidth, int(scrollPos) }, { scrollBarWidth, int(scrollHeight)+1 }), RGB<uint8_t>(255, 255, 255));
}
}

View File

@ -104,7 +104,6 @@ void Slider::SetSteps(int steps)
void Slider::Draw(const Point& screenPos)
{
Graphics * g = GetGraphics();
//g->drawrect(screenPos.X, screenPos.Y, Size.X, Size.Y, 255, 255, 255, 255);
if (bgGradient.size())
{
@ -112,13 +111,12 @@ void Slider::Draw(const Point& screenPos)
{
for (int i = 3; i < Size.X-7; i++)
{
RGB<uint8_t> color = bgGradient[i - 3];
g->blendpixel(screenPos.X+i+2, screenPos.Y+j+2, color.Red, color.Green, color.Blue, 255);
g->DrawPixel(screenPos + Vec2{ i + 2, j + 2 }, bgGradient[i - 3]);
}
}
}
g->drawrect(screenPos.X+3, screenPos.Y+3, Size.X-6, Size.Y-6, 255, 255, 255, 255);
g->DrawRect(RectSized(screenPos + Vec2{ 3, 3 }, Size - Vec2{ 6, 6 }), RGB<uint8_t>(255, 255, 255));
auto fPosition = float(sliderPosition);
auto fSize = float(Size.X-6);
@ -128,8 +126,8 @@ void Slider::Draw(const Point& screenPos)
auto sliderX = int(fSliderX);
sliderX += 3;
g->fillrect(screenPos.X+sliderX-2, screenPos.Y+1, 4, Size.Y-2, 20, 20, 20, 255);
g->drawrect(screenPos.X+sliderX-2, screenPos.Y+1, 4, Size.Y-2, 200, 200, 200, 255);
g->DrawFilledRect(RectSized(screenPos + Vec2{ sliderX-2, 1 }, Vec2{ 4, Size.Y-2 }), RGB<uint8_t>(20, 20, 20));
g->DrawRect(RectSized(screenPos + Vec2{ sliderX-2, 1 }, Vec2{ 4, Size.Y-2 }), RGB<uint8_t>(200, 200, 200));
}
} /* namespace ui */

View File

@ -27,8 +27,10 @@ void Spinner::Draw(const Point& screenPos)
int lineOuter = (Size.X/2)+3;
for(float t = 0.0f; t < 6.0f; t+=0.25f)
{
//g->drawblob(baseX+(sin(cValue+t)*(Size.X/2)), baseY+(cos(cValue+t)*(Size.X/2)), t*255, t*255, t*255);
g->draw_line(int(baseX+(sin(cValue+t)*lineInner)), int(baseY+(cos(cValue+t)*lineInner)), int(baseX+(sin(cValue+t)*lineOuter)), int(baseY+(cos(cValue+t)*lineOuter)), int((t/6)*255), int((t/6)*255), int((t/6)*255), 255);
g->DrawLine(
{ int(baseX+(sin(cValue+t)*lineInner)), int(baseY+(cos(cValue+t)*lineInner)) },
{ int(baseX+(sin(cValue+t)*lineOuter)), int(baseY+(cos(cValue+t)*lineOuter)) },
RGB<uint8_t>(int((t/6)*255), int((t/6)*255), int((t/6)*255)));
}
}
Spinner::~Spinner()

View File

@ -613,8 +613,12 @@ void Textbox::Draw(const Point& screenPos)
Graphics * g = GetGraphics();
if(IsFocused())
{
if(border) g->drawrect(screenPos.X, screenPos.Y, Size.X, Size.Y, 255, 255, 255, 255);
g->draw_line(screenPos.X+textPosition.X+cursorPositionX, screenPos.Y-2+textPosition.Y+cursorPositionY, screenPos.X+textPosition.X+cursorPositionX, screenPos.Y+9+textPosition.Y+cursorPositionY, 255, 255, 255, 255);
if(border)
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(255, 255, 255));
g->DrawLine(
screenPos + textPosition + Vec2{ cursorPositionX, cursorPositionY-2 },
screenPos + textPosition + Vec2{ cursorPositionX, cursorPositionY+9 },
RGB<uint8_t>(255, 255, 255));
}
else
{
@ -622,7 +626,8 @@ void Textbox::Draw(const Point& screenPos)
{
g->BlendText(screenPos + textPosition, placeHolder, RGBA<uint8_t>(textColour.Red, textColour.Green, textColour.Blue, 170));
}
if(border) g->drawrect(screenPos.X, screenPos.Y, Size.X, Size.Y, 160, 160, 160, 255);
if(border)
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(160, 160, 160));
}
if(Appearance.icon)
g->draw_icon(screenPos.X+iconPosition.X, screenPos.Y+iconPosition.Y, Appearance.icon);

View File

@ -125,7 +125,7 @@ void LoginView::OnDraw()
{
Graphics * g = GetGraphics();
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
g->drawrect(Position.X, Position.Y, Size.X, Size.Y, 255, 255, 255, 255);
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(255, 255, 255));
}
LoginView::~LoginView() {

View File

@ -46,7 +46,7 @@ OptionsView::OptionsView():
void Draw(const ui::Point& screenPos) override
{
GetGraphics()->drawrect(screenPos.X, screenPos.Y, Size.X, Size.Y, 255, 255, 255, 180);
GetGraphics()->BlendRect(RectSized(screenPos, Size), RGBA<uint8_t>(255, 255, 255, 180));
}
};
@ -159,7 +159,7 @@ OptionsView::OptionsView():
Graphics * g = GetGraphics();
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
g->drawrect(Position.X, Position.Y, Size.X, Size.Y, 200, 200, 200, 255);
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(200, 200, 200));
}
ui::DirectionSelector * gravityDirection;
@ -541,7 +541,7 @@ void OptionsView::OnDraw()
{
Graphics * g = GetGraphics();
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
g->drawrect(Position.X, Position.Y, Size.X, Size.Y, 255, 255, 255, 255);
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(255, 255, 255));
}
void OptionsView::OnTryExit(ExitMethod method)

View File

@ -260,20 +260,18 @@ void PreviewView::DoDraw()
{
int linePos = commentTextComponents[i]->Position.Y+commentsPanel->ViewportPosition.Y+commentTextComponents[i]->Size.Y+4;
if (linePos > 0 && linePos < Size.Y-commentBoxHeight)
g->draw_line(
Position.X+1+XRES/2,
Position.Y+linePos,
Position.X+Size.X-2,
Position.Y+linePos,
255, 255, 255, 100);
g->BlendLine(
Position + Vec2{ 1+XRES/2, linePos },
Position + Vec2{ Size.X-2, linePos },
RGBA<uint8_t>(255, 255, 255, 100));
}
if (c->GetDoOpen())
{
g->fillrect(Position.X+(Size.X/2)-101, Position.Y+(Size.Y/2)-26, 202, 52, 0, 0, 0, 210);
g->drawrect(Position.X+(Size.X/2)-100, Position.Y+(Size.Y/2)-25, 200, 50, 255, 255, 255, 180);
g->BlendFilledRect(RectSized(Position + Size / 2 - Vec2{ 101, 26 }, { 202, 52 }), RGBA<uint8_t>(0, 0, 0, 210));
g->BlendRect(RectSized(Position + Size / 2 - Vec2{ 100, 25 }, Vec2{ 200, 50 }), RGBA<uint8_t>(255, 255, 255, 180));
g->BlendText(Position + Vec2{(Size.X/2)-((Graphics::TextSize("Loading save...").X - 1)/2), (Size.Y/2)-5}, "Loading save...", RGBA<uint8_t>(style::Colour::InformationTitle.Red, style::Colour::InformationTitle.Green, style::Colour::InformationTitle.Blue, 255));
}
g->drawrect(Position.X, Position.Y, Size.X, Size.Y, 255, 255, 255, 255);
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(255, 255, 255));
}
@ -289,8 +287,8 @@ void PreviewView::OnDraw()
{
g->BlendImage(savePreview->Data(), 0xFF, RectSized(Position + Vec2(1, 1) + (RES / 2 - savePreview->Size()) / 2, savePreview->Size()));
}
g->drawrect(Position.X, Position.Y, (XRES/2)+1, (YRES/2)+1, 255, 255, 255, 100);
g->draw_line(Position.X+XRES/2, Position.Y+1, Position.X+XRES/2, Position.Y+Size.Y-2, 200, 200, 200, 255);
g->BlendRect(RectSized(Position, RES / 2 + Vec2{ 1, 1 }), RGBA<uint8_t>(255, 255, 255, 100));
g->DrawLine(Position + Vec2{ XRES/2, 1 }, Position + Vec2{ XRES/2, Size.Y-2 }, RGB<uint8_t>(200, 200, 200));
if(votesUp || votesDown)
{
@ -314,13 +312,13 @@ void PreviewView::OnDraw()
nyu = nyu>50?50:nyu;
nyd = nyd>50?50:nyd;
g->fillrect(Position.X+(XRES/2)-55, Position.Y+(YRES/2)+3, 53, 7, 0, 107, 10, 255);
g->fillrect(Position.X+(XRES/2)-55, Position.Y+(YRES/2)+9, 53, 7, 107, 10, 0, 255);
g->drawrect(Position.X+(XRES/2)-55, Position.Y+(YRES/2)+3, 53, 7, 128, 128, 128, 255);
g->drawrect(Position.X+(XRES/2)-55, Position.Y+(YRES/2)+9, 53, 7, 128, 128, 128, 255);
g->DrawFilledRect(RectSized(Position + RES / 2 + Vec2{ -55, 3 }, Vec2{ 53, 7 }), RGB<uint8_t>(0, 107, 10));
g->DrawFilledRect(RectSized(Position + RES / 2 + Vec2{ -55, 9 }, Vec2{ 53, 7 }), RGB<uint8_t>(107, 10, 0));
g->DrawRect(RectSized(Position + Vec2{ (XRES/2)-55, (YRES/2)+3 }, { 53, 7 }), RGB<uint8_t>(128, 128, 128));
g->DrawRect(RectSized(Position + Vec2{ (XRES/2)-55, (YRES/2)+9 }, { 53, 7 }), RGB<uint8_t>(128, 128, 128));
g->fillrect(Position.X+(XRES/2)-4-nyu, Position.Y+(YRES/2)+5, nyu, 3, 57, 187, 57, 255);
g->fillrect(Position.X+(XRES/2)-4-nyd, Position.Y+(YRES/2)+11, nyd, 3, 187, 57, 57, 255);
g->DrawFilledRect(RectSized(Position + RES / 2 + Vec2{ -4-nyu, 5 }, Vec2{ nyu, 3 }), RGB<uint8_t>(57, 187, 57));
g->DrawFilledRect(RectSized(Position + RES / 2 + Vec2{ -4-nyd, 11 }, Vec2{ nyd, 3 }), RGB<uint8_t>(187, 57, 57));
}
}

View File

@ -233,7 +233,7 @@ void ProfileActivity::OnDraw()
{
Graphics * g = GetGraphics();
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
g->drawrect(Position.X, Position.Y, Size.X, Size.Y, 255, 255, 255, 255);
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(255, 255, 255));
}
void ProfileActivity::OnTryExit(ExitMethod method)

View File

@ -162,12 +162,12 @@ void RenderView::OnDraw()
ren->RenderBegin();
ren->RenderEnd();
}
g->draw_line(0, YRES, XRES-1, YRES, 200, 200, 200, 255);
g->draw_line(line1, YRES, line1, WINDOWH, 200, 200, 200, 255);
g->draw_line(line2, YRES, line2, WINDOWH, 200, 200, 200, 255);
g->draw_line(line3, YRES, line3, WINDOWH, 200, 200, 200, 255);
g->draw_line(line4, YRES, line4, WINDOWH, 200, 200, 200, 255);
g->draw_line(XRES, 0, XRES, WINDOWH, 255, 255, 255, 255);
g->DrawLine({ 0, YRES }, { XRES-1, YRES }, RGB<uint8_t>(200, 200, 200));
g->DrawLine({ line1, YRES }, { line1, WINDOWH }, RGB<uint8_t>(200, 200, 200));
g->DrawLine({ line2, YRES }, { line2, WINDOWH }, RGB<uint8_t>(200, 200, 200));
g->DrawLine({ line3, YRES }, { line3, WINDOWH }, RGB<uint8_t>(200, 200, 200));
g->DrawLine({ line4, YRES }, { line4, WINDOWH }, RGB<uint8_t>(200, 200, 200));
g->DrawLine({ XRES, 0 }, { XRES, WINDOWH }, RGB<uint8_t>(255, 255, 255));
if(toolTipPresence && toolTip.length())
{
g->BlendText({ 6, Size.Y-MENUSIZE-12 }, toolTip, RGBA<uint8_t>(255, 255, 255, toolTipPresence>51?255:toolTipPresence*5));

View File

@ -206,7 +206,7 @@ void SearchController::OpenSave(int saveID)
{
delete activePreview;
Graphics * g = searchView->GetGraphics();
g->fillrect(XRES/3, WINDOWH-20, XRES/3, 20, 0, 0, 0, 150); //dim the "Page X of Y" a little to make the CopyTextButton more noticeable
g->BlendFilledRect(RectSized(Vec2{ XRES/3, WINDOWH-20 }, Vec2{ XRES/3, 20 }), RGBA<uint8_t>(0, 0, 0, 150)); //dim the "Page X of Y" a little to make the CopyTextButton more noticeable
activePreview = new PreviewController(saveID, 0, instantOpen, [this] { OpenSaveDone(); });
activePreview->GetView()->MakeActiveWindow();
}
@ -215,7 +215,7 @@ void SearchController::OpenSave(int saveID, int saveDate)
{
delete activePreview;
Graphics * g = searchView->GetGraphics();
g->fillrect(XRES/3, WINDOWH-20, XRES/3, 20, 0, 0, 0, 150); //dim the "Page X of Y" a little to make the CopyTextButton more noticeable
g->BlendFilledRect(RectSized(Vec2{ XRES/3, WINDOWH-20 }, Vec2{ XRES/3, 20 }), RGBA<uint8_t>(0, 0, 0, 150)); //dim the "Page X of Y" a little to make the CopyTextButton more noticeable
activePreview = new PreviewController(saveID, saveDate, instantOpen, [this] { OpenSaveDone(); });
activePreview->GetView()->MakeActiveWindow();
}

View File

@ -53,7 +53,7 @@ void TagsView::OnDraw()
{
Graphics * g = GetGraphics();
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
g->drawrect(Position.X, Position.Y, Size.X, Size.Y, 255, 255, 255, 255);
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(255, 255, 255));
}
void TagsView::NotifyTagsChanged(TagsModel * sender)

View File

@ -891,7 +891,7 @@ int luatpt_drawpixel(lua_State* l)
else if (b>255) b = 255;
if (a<0) a = 0;
else if (a>255) a = 255;
luacon_g->blendpixel(x, y, r, g, b, a);
luacon_g->BlendPixel({ x, y }, RGBA<uint8_t>(r, g, b, a));
return 0;
}
@ -921,7 +921,14 @@ int luatpt_drawrect(lua_State* l)
else if (b>255) b = 255;
if (a<0) a = 0;
else if (a>255) a = 255;
luacon_g->drawrect(x, y, w, h, r, g, b, a);
if (a == 255)
{
luacon_g->DrawRect(RectSized(Vec2{ x, y }, Vec2{ w, h }), RGB<uint8_t>(r, g, b));
}
else
{
luacon_g->BlendRect(RectSized(Vec2{ x, y }, Vec2{ w, h }), RGBA<uint8_t>(r, g, b, a));
}
return 0;
}
@ -951,7 +958,14 @@ int luatpt_fillrect(lua_State* l)
else if (b>255) b = 255;
if (a<0) a = 0;
else if (a>255) a = 255;
luacon_g->fillrect(x, y, w, h, r, g, b, a);
if (a == 255)
{
luacon_g->DrawFilledRect(RectSized(Vec2{ x, y }, Vec2{ w, h }), RGB<uint8_t>(r, g, b));
}
else
{
luacon_g->BlendFilledRect(RectSized(Vec2{ x, y }, Vec2{ w, h }), RGBA<uint8_t>(r, g, b, a));
}
return 0;
}
@ -976,7 +990,14 @@ int luatpt_drawline(lua_State* l)
else if (b>255) b = 255;
if (a<0) a = 0;
else if (a>255) a = 255;
luacon_g->draw_line(x1, y1, x2, y2, r, g, b, a);
if (a == 255)
{
luacon_g->DrawLine({ x1, y1 }, { x2, y2 }, RGB<uint8_t>(r, g, b));
}
else
{
luacon_g->BlendLine({ x1, y1 }, { x2, y2 }, RGBA<uint8_t>(r, g, b, a));
}
return 0;
}

View File

@ -3836,7 +3836,14 @@ int LuaScriptInterface::graphics_drawLine(lua_State * l)
if (a<0) a = 0;
else if (a>255) a = 255;
luacon_g->draw_line(x1, y1, x2, y2, r, g, b, a);
if (a == 255)
{
luacon_g->DrawLine({ x1, y1 }, { x2, y2 }, RGB<uint8_t>(r, g, b));
}
else
{
luacon_g->BlendLine({ x1, y1 }, { x2, y2 }, RGBA<uint8_t>(r, g, b, a));
}
return 0;
}
@ -3860,7 +3867,14 @@ int LuaScriptInterface::graphics_drawRect(lua_State * l)
if (a<0) a = 0;
else if (a>255) a = 255;
luacon_g->drawrect(x, y, width, height, r, g, b, a);
if (a == 255)
{
luacon_g->DrawRect(RectSized(Vec2{ x, y }, Vec2{ width, height }), RGB<uint8_t>(r, g, b));
}
else
{
luacon_g->BlendRect(RectSized(Vec2{ x, y }, Vec2{ width, height }), RGBA<uint8_t>(r, g, b, a));
}
return 0;
}
@ -3884,7 +3898,14 @@ int LuaScriptInterface::graphics_fillRect(lua_State * l)
if (a<0) a = 0;
else if (a>255) a = 255;
luacon_g->fillrect(x, y, width, height, r, g, b, a);
if (a == 255)
{
luacon_g->DrawFilledRect(RectSized(Vec2{ x, y }, Vec2{ width, height }), RGB<uint8_t>(r, g, b));
}
else
{
luacon_g->BlendFilledRect(RectSized(Vec2{ x, y }, Vec2{ width, height }), RGBA<uint8_t>(r, g, b, a));
}
return 0;
}

View File

@ -81,7 +81,7 @@ LuaWindow::LuaWindow(lua_State * l) :
{
Graphics * g = ui::Engine::Ref().g;
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
g->drawrect(Position.X, Position.Y, Size.X, Size.Y, 255, 255, 255, 255);
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(255, 255, 255));
luaWindow->triggerOnDraw();
}
void OnInitialized() override { luaWindow->triggerOnInitialized(); }

View File

@ -87,9 +87,9 @@ void TaskWindow::OnDraw()
{
Graphics * g = GetGraphics();
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
g->drawrect(Position.X, Position.Y, Size.X, Size.Y, 255, 255, 255, 255);
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(255, 255, 255));
g->draw_line(Position.X, Position.Y + Size.Y-17, Position.X + Size.X - 1, Position.Y + Size.Y-17, 255, 255, 255, 255);
g->DrawLine(Position + Vec2{ 0, Size.Y-17 }, Position + Vec2{ Size.X - 1, Size.Y-17 }, RGB<uint8_t>(255, 255, 255));
ui::Colour progressBarColour = style::Colour::WarningTitle;
@ -101,7 +101,7 @@ void TaskWindow::OnDraw()
progress = 100;
float size = float(Size.X-4)*(float(progress)/100.0f); // TIL...
size = std::min(std::max(size, 0.0f), float(Size.X-4));
g->fillrect(Position.X + 2, Position.Y + Size.Y-15, int(size), 13, progressBarColour.Red, progressBarColour.Green, progressBarColour.Blue, 255);
g->DrawFilledRect(RectSized(Position + Vec2{ 2, Size.Y-15 }, Vec2{ int(size), 13 }), progressBarColour.NoAlpha());
}
} else {
int size = 40, rsize = 0;
@ -111,10 +111,10 @@ void TaskWindow::OnDraw()
size = (Size.X-4)-int(position)+1;
rsize = 40-size;
}
g->fillrect(Position.X + 2 + int(position), Position.Y + Size.Y-15, size, 13, progressBarColour.Red, progressBarColour.Green, progressBarColour.Blue, 255);
g->DrawFilledRect(RectSized(Position + Vec2{ 2 + int(position), Size.Y-15 }, Vec2{ size, 13 }), progressBarColour.NoAlpha());
if(rsize)
{
g->fillrect(Position.X + 2, Position.Y + Size.Y-15, rsize, 13, progressBarColour.Red, progressBarColour.Green, progressBarColour.Blue, 255);
g->DrawFilledRect(RectSized(Position + Vec2{ 2, Size.Y-15 }, Vec2{ rsize, 13 }), progressBarColour.NoAlpha());
}
}
g->BlendText(Position + Vec2{ ((Size.X-(Graphics::TextSize(progressStatus).X - 1))/2), Size.Y-13 }, progressStatus, progress<50 ? RGBA<uint8_t>(255, 255, 255, 255) : RGBA<uint8_t>(0, 0, 0, 255));