Use _rgb literals where possible
This commit is contained in:
parent
410dc71f42
commit
60a7ce1aae
@ -62,8 +62,8 @@ int main(int argc, char *argv[])
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
int w = Graphics::TextSize("Save file invalid").X + 15, x = (XRES-w)/2, y = (YRES-24)/2;
|
int w = Graphics::TextSize("Save file invalid").X + 15, x = (XRES-w)/2, y = (YRES-24)/2;
|
||||||
ren->DrawRect(RectSized(Vec2{ x, y }, Vec2{ w, 24 }), RGB<uint8_t>(192, 192, 192));
|
ren->DrawRect(RectSized(Vec2{ x, y }, Vec2{ w, 24 }), 0xC0C0C0_rgb);
|
||||||
ren->BlendText({ x+8, y+8 }, "Save file invalid", RGBA<uint8_t>(192, 192, 240, 255));
|
ren->BlendText({ x+8, y+8 }, "Save file invalid", 0xC0C0F0_rgb .WithAlpha(255));
|
||||||
}
|
}
|
||||||
|
|
||||||
ren->RenderBegin();
|
ren->RenderBegin();
|
||||||
|
@ -22,24 +22,24 @@ void DebugLines::Draw()
|
|||||||
if (view->GetDrawSnap())
|
if (view->GetDrawSnap())
|
||||||
drawPoint2 = view->lineSnapCoords(drawPoint1, drawPoint2);
|
drawPoint2 = view->lineSnapCoords(drawPoint1, drawPoint2);
|
||||||
|
|
||||||
g->BlendLine({ 0, drawPoint1.Y }, { XRES, drawPoint1.Y }, RGBA<uint8_t>(255, 255, 255, 120));
|
g->BlendLine({ 0, drawPoint1.Y }, { XRES, drawPoint1.Y }, 0xFFFFFF_rgb .WithAlpha(120));
|
||||||
g->BlendLine({ drawPoint1.X, 0 }, { drawPoint1.X, YRES }, RGBA<uint8_t>(255, 255, 255, 120));
|
g->BlendLine({ drawPoint1.X, 0 }, { drawPoint1.X, YRES }, 0xFFFFFF_rgb .WithAlpha(120));
|
||||||
|
|
||||||
g->BlendLine({ 0, drawPoint2.Y }, { XRES, drawPoint2.Y }, RGBA<uint8_t>(255, 255, 255, 120));
|
g->BlendLine({ 0, drawPoint2.Y }, { XRES, drawPoint2.Y }, 0xFFFFFF_rgb .WithAlpha(120));
|
||||||
g->BlendLine({ drawPoint2.X, 0 }, { drawPoint2.X, YRES }, RGBA<uint8_t>(255, 255, 255, 120));
|
g->BlendLine({ drawPoint2.X, 0 }, { drawPoint2.X, YRES }, 0xFFFFFF_rgb .WithAlpha(120));
|
||||||
|
|
||||||
String info;
|
String info;
|
||||||
info = String::Build(drawPoint2.X, " x ", drawPoint2.Y);
|
info = String::Build(drawPoint2.X, " x ", drawPoint2.Y);
|
||||||
g->BlendTextOutline({ drawPoint2.X+(drawPoint2.X>drawPoint1.X?3:-(g->TextSize(info).X-1)-3), drawPoint2.Y+(drawPoint2.Y<drawPoint1.Y?-10:3) }, info, RGBA<uint8_t>(255, 255, 255, 200));
|
g->BlendTextOutline({ drawPoint2.X+(drawPoint2.X>drawPoint1.X?3:-(g->TextSize(info).X-1)-3), drawPoint2.Y+(drawPoint2.Y<drawPoint1.Y?-10:3) }, info, 0xFFFFFF_rgb .WithAlpha(200));
|
||||||
|
|
||||||
info = String::Build(drawPoint1.X, " x ", drawPoint1.Y);
|
info = String::Build(drawPoint1.X, " x ", drawPoint1.Y);
|
||||||
g->BlendTextOutline({ drawPoint1.X+(drawPoint2.X<drawPoint1.X?3:-(g->TextSize(info).X-1)-2), drawPoint1.Y+(drawPoint2.Y>drawPoint1.Y?-10:3) }, info, RGBA<uint8_t>(255, 255, 255, 200));
|
g->BlendTextOutline({ drawPoint1.X+(drawPoint2.X<drawPoint1.X?3:-(g->TextSize(info).X-1)-2), drawPoint1.Y+(drawPoint2.Y>drawPoint1.Y?-10:3) }, info, 0xFFFFFF_rgb .WithAlpha(200));
|
||||||
|
|
||||||
info = String::Build(std::abs(drawPoint2.X-drawPoint1.X));
|
info = String::Build(std::abs(drawPoint2.X-drawPoint1.X));
|
||||||
g->BlendTextOutline({ (drawPoint1.X+drawPoint2.X)/2-(g->TextSize(info).X-1)/2, drawPoint1.Y+(drawPoint2.Y>drawPoint1.Y?-10:3) }, info, RGBA<uint8_t>(255, 255, 255, 200));
|
g->BlendTextOutline({ (drawPoint1.X+drawPoint2.X)/2-(g->TextSize(info).X-1)/2, drawPoint1.Y+(drawPoint2.Y>drawPoint1.Y?-10:3) }, info, 0xFFFFFF_rgb .WithAlpha(200));
|
||||||
|
|
||||||
info = String::Build(std::abs(drawPoint2.Y-drawPoint1.Y));
|
info = String::Build(std::abs(drawPoint2.Y-drawPoint1.Y));
|
||||||
g->BlendTextOutline({ drawPoint1.X+(drawPoint2.X<drawPoint1.X?3:-(g->TextSize(info).X-1)-2), (drawPoint1.Y+drawPoint2.Y)/2-3 }, info, RGBA<uint8_t>(255, 255, 255, 200));
|
g->BlendTextOutline({ drawPoint1.X+(drawPoint2.X<drawPoint1.X?3:-(g->TextSize(info).X-1)-2), (drawPoint1.Y+drawPoint2.Y)/2-3 }, info, 0xFFFFFF_rgb .WithAlpha(200));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,9 +22,9 @@ void DebugParts::Draw()
|
|||||||
for (int i = 0; i < NPART; i++)
|
for (int i = 0; i < NPART; i++)
|
||||||
{
|
{
|
||||||
if (sim->parts[i].type)
|
if (sim->parts[i].type)
|
||||||
g->AddPixel({ x, y }, RGBA<uint8_t>(255, 255, 255, 180));
|
g->AddPixel({ x, y }, 0xFFFFFF_rgb .WithAlpha(180));
|
||||||
else
|
else
|
||||||
g->AddPixel({ x, y }, RGBA<uint8_t>(0, 0, 0, 180));
|
g->AddPixel({ x, y }, 0x000000_rgb .WithAlpha(180));
|
||||||
|
|
||||||
if (i == sim->parts_lastActiveIndex)
|
if (i == sim->parts_lastActiveIndex)
|
||||||
{
|
{
|
||||||
@ -38,17 +38,17 @@ void DebugParts::Draw()
|
|||||||
x = 0;
|
x = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g->DrawLine({ 0, lpy }, { XRES, lpy }, RGB<uint8_t>(0, 255, 120));
|
g->DrawLine({ 0, lpy }, { XRES, lpy }, 0x00FF78_rgb);
|
||||||
g->DrawLine({ lpx, 0 }, { lpx, YRES }, RGB<uint8_t>(0, 255, 120));
|
g->DrawLine({ lpx, 0 }, { lpx, YRES }, 0x00FF78_rgb);
|
||||||
g->AddPixel({ lpx, lpy }, RGBA<uint8_t>(255, 50, 50, 220));
|
g->AddPixel({ lpx, lpy }, 0xFF3232_rgb .WithAlpha(220));
|
||||||
|
|
||||||
g->AddPixel({ lpx+1, lpy }, RGBA<uint8_t>(255, 50, 50, 120));
|
g->AddPixel({ lpx+1, lpy }, 0xFF3232_rgb .WithAlpha(120));
|
||||||
g->AddPixel({ lpx-1, lpy }, RGBA<uint8_t>(255, 50, 50, 120));
|
g->AddPixel({ lpx-1, lpy }, 0xFF3232_rgb .WithAlpha(120));
|
||||||
g->AddPixel({ lpx, lpy+1 }, RGBA<uint8_t>(255, 50, 50, 120));
|
g->AddPixel({ lpx, lpy+1 }, 0xFF3232_rgb .WithAlpha(120));
|
||||||
g->AddPixel({ lpx, lpy-1 }, RGBA<uint8_t>(255, 50, 50, 120));
|
g->AddPixel({ lpx, lpy-1 }, 0xFF3232_rgb .WithAlpha(120));
|
||||||
|
|
||||||
g->BlendFilledRect(RectSized(Vec2{ 7, YRES-26}, Vec2{ g->TextSize(info).X + 4, 14}), RGBA<uint8_t>(0, 0, 0, 180));
|
g->BlendFilledRect(RectSized(Vec2{ 7, YRES-26}, Vec2{ g->TextSize(info).X + 4, 14}), 0x000000_rgb .WithAlpha(180));
|
||||||
g->BlendText({ 10, YRES-22 }, info, RGBA<uint8_t>(255, 255, 255, 255));
|
g->BlendText({ 10, YRES-22 }, info, 0xFFFFFF_rgb .WithAlpha(255));
|
||||||
}
|
}
|
||||||
|
|
||||||
DebugParts::~DebugParts()
|
DebugParts::~DebugParts()
|
||||||
|
@ -44,7 +44,7 @@ void ElementPopulationDebug::Draw()
|
|||||||
halfValString = String::Build(maxAverage/2);
|
halfValString = String::Build(maxAverage/2);
|
||||||
|
|
||||||
|
|
||||||
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));
|
g->BlendFilledRect(RectSized(Vec2{ xStart-5, yBottom - 263 }, Vec2{ bars+10+Graphics::TextSize(maxValString).X+9, 255 + 13 }), 0x000000_rgb .WithAlpha(180));
|
||||||
|
|
||||||
bars = 0;
|
bars = 0;
|
||||||
for(int i = 0; i < PT_NUM; i++)
|
for(int i = 0; i < PT_NUM; i++)
|
||||||
@ -68,7 +68,7 @@ void ElementPopulationDebug::Draw()
|
|||||||
g->DrawPixel({ xStart+barX, yBottom-barSize-7 }, colour);
|
g->DrawPixel({ xStart+barX, yBottom-barSize-7 }, colour);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
g->BlendLine({ xStart+barX, yBottom-barSize-3 }, { xStart+barX, yBottom-barSize-2 }, RGBA<uint8_t>(255, 255, 255, 180));
|
g->BlendLine({ xStart+barX, yBottom-barSize-3 }, { xStart+barX, yBottom-barSize-2 }, 0xFFFFFF_rgb .WithAlpha(180));
|
||||||
}
|
}
|
||||||
g->DrawLine({ xStart+barX, yBottom-barSize }, { xStart+barX, yBottom }, colour);
|
g->DrawLine({ xStart+barX, yBottom-barSize }, { xStart+barX, yBottom }, colour);
|
||||||
}
|
}
|
||||||
@ -76,9 +76,9 @@ void ElementPopulationDebug::Draw()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g->BlendText({ xStart + bars + 5, yBottom-5 }, "0", RGBA<uint8_t>(255, 255, 255, 255));
|
g->BlendText({ xStart + bars + 5, yBottom-5 }, "0", 0xFFFFFF_rgb .WithAlpha(255));
|
||||||
g->BlendText({ xStart + bars + 5, yBottom-132 }, halfValString, RGBA<uint8_t>(255, 255, 255, 255));
|
g->BlendText({ xStart + bars + 5, yBottom-132 }, halfValString, 0xFFFFFF_rgb .WithAlpha(255));
|
||||||
g->BlendText({ xStart + bars + 5, yBottom-260 }, maxValString, RGBA<uint8_t>(255, 255, 255, 255));
|
g->BlendText({ xStart + bars + 5, yBottom-260 }, maxValString, 0xFFFFFF_rgb .WithAlpha(255));
|
||||||
}
|
}
|
||||||
|
|
||||||
ElementPopulationDebug::~ElementPopulationDebug()
|
ElementPopulationDebug::~ElementPopulationDebug()
|
||||||
|
@ -174,269 +174,269 @@ void Graphics::draw_icon(int x, int y, Icon icon, unsigned char alpha, bool inve
|
|||||||
{
|
{
|
||||||
case IconOpen:
|
case IconOpen:
|
||||||
if(invert)
|
if(invert)
|
||||||
BlendChar({ x, y }, 0xE001, RGBA<uint8_t>(0, 0, 0, alpha));
|
BlendChar({ x, y }, 0xE001, 0x000000_rgb .WithAlpha(alpha));
|
||||||
else
|
else
|
||||||
BlendChar({ x, y }, 0xE001, RGBA<uint8_t>(255, 255, 255, alpha));
|
BlendChar({ x, y }, 0xE001, 0xFFFFFF_rgb .WithAlpha(alpha));
|
||||||
break;
|
break;
|
||||||
case IconReload:
|
case IconReload:
|
||||||
if(invert)
|
if(invert)
|
||||||
BlendChar({ x, y }, 0xE011, RGBA<uint8_t>(0, 0, 0, alpha));
|
BlendChar({ x, y }, 0xE011, 0x000000_rgb .WithAlpha(alpha));
|
||||||
else
|
else
|
||||||
BlendChar({ x, y }, 0xE011, RGBA<uint8_t>(255, 255, 255, alpha));
|
BlendChar({ x, y }, 0xE011, 0xFFFFFF_rgb .WithAlpha(alpha));
|
||||||
break;
|
break;
|
||||||
case IconSave:
|
case IconSave:
|
||||||
if(invert)
|
if(invert)
|
||||||
BlendChar({ x, y }, 0xE002, RGBA<uint8_t>(0, 0, 0, alpha));
|
BlendChar({ x, y }, 0xE002, 0x000000_rgb .WithAlpha(alpha));
|
||||||
else
|
else
|
||||||
BlendChar({ x, y }, 0xE002, RGBA<uint8_t>(255, 255, 255, alpha));
|
BlendChar({ x, y }, 0xE002, 0xFFFFFF_rgb .WithAlpha(alpha));
|
||||||
break;
|
break;
|
||||||
case IconVoteUp:
|
case IconVoteUp:
|
||||||
if(invert)
|
if(invert)
|
||||||
{
|
{
|
||||||
BlendChar({ x-11, y+1 }, 0xE04B, RGBA<uint8_t>(0, 100, 0, alpha));
|
BlendChar({ x-11, y+1 }, 0xE04B, 0x006400_rgb .WithAlpha(alpha));
|
||||||
BlendText({ x+2, y+1 }, "Vote", RGBA<uint8_t>(0, 100, 0, alpha));
|
BlendText({ x+2, y+1 }, "Vote", 0x006400_rgb .WithAlpha(alpha));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BlendChar({ x-11, y+1 }, 0xE04B, RGBA<uint8_t>(0, 187, 18, alpha));
|
BlendChar({ x-11, y+1 }, 0xE04B, 0x00BB12_rgb .WithAlpha(alpha));
|
||||||
BlendText({ x+2, y+1 }, "Vote", RGBA<uint8_t>(0, 187, 18, alpha));
|
BlendText({ x+2, y+1 }, "Vote", 0x00BB12_rgb .WithAlpha(alpha));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case IconVoteDown:
|
case IconVoteDown:
|
||||||
if(invert)
|
if(invert)
|
||||||
BlendChar({ x, y }, 0xE04A, RGBA<uint8_t>(100, 10, 0, alpha));
|
BlendChar({ x, y }, 0xE04A, 0x640A00_rgb .WithAlpha(alpha));
|
||||||
else
|
else
|
||||||
BlendChar({ x, y }, 0xE04A, RGBA<uint8_t>(187, 40, 0, alpha));
|
BlendChar({ x, y }, 0xE04A, 0xBB2800_rgb .WithAlpha(alpha));
|
||||||
break;
|
break;
|
||||||
case IconTag:
|
case IconTag:
|
||||||
if(invert)
|
if(invert)
|
||||||
BlendChar({ x, y }, 0xE003, RGBA<uint8_t>(0, 0, 0, alpha));
|
BlendChar({ x, y }, 0xE003, 0x000000_rgb .WithAlpha(alpha));
|
||||||
else
|
else
|
||||||
BlendChar({ x, y }, 0xE003, RGBA<uint8_t>(255, 255, 255, alpha));
|
BlendChar({ x, y }, 0xE003, 0xFFFFFF_rgb .WithAlpha(alpha));
|
||||||
break;
|
break;
|
||||||
case IconNew:
|
case IconNew:
|
||||||
if(invert)
|
if(invert)
|
||||||
BlendChar({ x, y }, 0xE012, RGBA<uint8_t>(0, 0, 0, alpha));
|
BlendChar({ x, y }, 0xE012, 0x000000_rgb .WithAlpha(alpha));
|
||||||
else
|
else
|
||||||
BlendChar({ x, y }, 0xE012, RGBA<uint8_t>(255, 255, 255, alpha));
|
BlendChar({ x, y }, 0xE012, 0xFFFFFF_rgb .WithAlpha(alpha));
|
||||||
break;
|
break;
|
||||||
case IconLogin:
|
case IconLogin:
|
||||||
if(invert)
|
if(invert)
|
||||||
BlendChar({ x, y + 1 }, 0xE004, RGBA<uint8_t>(0, 0, 0, alpha));
|
BlendChar({ x, y + 1 }, 0xE004, 0x000000_rgb .WithAlpha(alpha));
|
||||||
else
|
else
|
||||||
BlendChar({ x, y + 1 }, 0xE004, RGBA<uint8_t>(255, 255, 255, alpha));
|
BlendChar({ x, y + 1 }, 0xE004, 0xFFFFFF_rgb .WithAlpha(alpha));
|
||||||
break;
|
break;
|
||||||
case IconSimulationSettings:
|
case IconSimulationSettings:
|
||||||
if(invert)
|
if(invert)
|
||||||
BlendChar({ x, y + 1 }, 0xE04F, RGBA<uint8_t>(0, 0, 0, alpha));
|
BlendChar({ x, y + 1 }, 0xE04F, 0x000000_rgb .WithAlpha(alpha));
|
||||||
else
|
else
|
||||||
BlendChar({ x, y + 1 }, 0xE04F, RGBA<uint8_t>(255, 255, 255, alpha));
|
BlendChar({ x, y + 1 }, 0xE04F, 0xFFFFFF_rgb .WithAlpha(alpha));
|
||||||
break;
|
break;
|
||||||
case IconRenderSettings:
|
case IconRenderSettings:
|
||||||
if(invert)
|
if(invert)
|
||||||
{
|
{
|
||||||
BlendChar({ x, y + 1 }, 0xE058, RGBA<uint8_t>(255, 0, 0, alpha));
|
BlendChar({ x, y + 1 }, 0xE058, 0xFF0000_rgb .WithAlpha(alpha));
|
||||||
BlendChar({ x, y + 1 }, 0xE059, RGBA<uint8_t>(0, 255, 0, alpha));
|
BlendChar({ x, y + 1 }, 0xE059, 0x00FF00_rgb .WithAlpha(alpha));
|
||||||
BlendChar({ x, y + 1 }, 0xE05A, RGBA<uint8_t>(0, 0, 255, alpha));
|
BlendChar({ x, y + 1 }, 0xE05A, 0x0000FF_rgb .WithAlpha(alpha));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AddChar({ x, y + 1 }, 0xE058, RGBA<uint8_t>(255, 0, 0, alpha));
|
AddChar({ x, y + 1 }, 0xE058, 0xFF0000_rgb .WithAlpha(alpha));
|
||||||
AddChar({ x, y + 1 }, 0xE059, RGBA<uint8_t>(0, 255, 0, alpha));
|
AddChar({ x, y + 1 }, 0xE059, 0x00FF00_rgb .WithAlpha(alpha));
|
||||||
AddChar({ x, y + 1 }, 0xE05A, RGBA<uint8_t>(0, 0, 255, alpha));
|
AddChar({ x, y + 1 }, 0xE05A, 0x0000FF_rgb .WithAlpha(alpha));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case IconPause:
|
case IconPause:
|
||||||
if(invert)
|
if(invert)
|
||||||
BlendChar({ x, y }, 0xE010, RGBA<uint8_t>(0, 0, 0, alpha));
|
BlendChar({ x, y }, 0xE010, 0x000000_rgb .WithAlpha(alpha));
|
||||||
else
|
else
|
||||||
BlendChar({ x, y }, 0xE010, RGBA<uint8_t>(255, 255, 255, alpha));
|
BlendChar({ x, y }, 0xE010, 0xFFFFFF_rgb .WithAlpha(alpha));
|
||||||
break;
|
break;
|
||||||
case IconFavourite:
|
case IconFavourite:
|
||||||
if(invert)
|
if(invert)
|
||||||
BlendChar({ x, y }, 0xE04C, RGBA<uint8_t>(100, 80, 32, alpha));
|
BlendChar({ x, y }, 0xE04C, 0x645020_rgb .WithAlpha(alpha));
|
||||||
else
|
else
|
||||||
BlendChar({ x, y }, 0xE04C, RGBA<uint8_t>(192, 160, 64, alpha));
|
BlendChar({ x, y }, 0xE04C, 0xC0A040_rgb .WithAlpha(alpha));
|
||||||
break;
|
break;
|
||||||
case IconReport:
|
case IconReport:
|
||||||
if(invert)
|
if(invert)
|
||||||
BlendChar({ x, y }, 0xE063, RGBA<uint8_t>(140, 140, 0, alpha));
|
BlendChar({ x, y }, 0xE063, 0x8C8C00_rgb .WithAlpha(alpha));
|
||||||
else
|
else
|
||||||
BlendChar({ x, y }, 0xE063, RGBA<uint8_t>(255, 255, 0, alpha));
|
BlendChar({ x, y }, 0xE063, 0xFFFF00_rgb .WithAlpha(alpha));
|
||||||
break;
|
break;
|
||||||
case IconUsername:
|
case IconUsername:
|
||||||
if(invert)
|
if(invert)
|
||||||
{
|
{
|
||||||
BlendChar({ x, y }, 0xE00B, RGBA<uint8_t>(32, 64, 128, alpha));
|
BlendChar({ x, y }, 0xE00B, 0x204080_rgb .WithAlpha(alpha));
|
||||||
BlendChar({ x, y }, 0xE00A, RGBA<uint8_t>(0, 0, 0, alpha));
|
BlendChar({ x, y }, 0xE00A, 0x000000_rgb .WithAlpha(alpha));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BlendChar({ x, y }, 0xE00B, RGBA<uint8_t>(32, 64, 128, alpha));
|
BlendChar({ x, y }, 0xE00B, 0x204080_rgb .WithAlpha(alpha));
|
||||||
BlendChar({ x, y }, 0xE00A, RGBA<uint8_t>(255, 255, 255, alpha));
|
BlendChar({ x, y }, 0xE00A, 0xFFFFFF_rgb .WithAlpha(alpha));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case IconPassword:
|
case IconPassword:
|
||||||
if(invert)
|
if(invert)
|
||||||
{
|
{
|
||||||
BlendChar({ x, y }, 0xE00C, RGBA<uint8_t>(160, 144, 32, alpha));
|
BlendChar({ x, y }, 0xE00C, 0xA09020_rgb .WithAlpha(alpha));
|
||||||
BlendChar({ x, y }, 0xE004, RGBA<uint8_t>(0, 0, 0, alpha));
|
BlendChar({ x, y }, 0xE004, 0x000000_rgb .WithAlpha(alpha));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BlendChar({ x, y }, 0xE00C, RGBA<uint8_t>(160, 144, 32, alpha));
|
BlendChar({ x, y }, 0xE00C, 0xA09020_rgb .WithAlpha(alpha));
|
||||||
BlendChar({ x, y }, 0xE004, RGBA<uint8_t>(255, 255, 255, alpha));
|
BlendChar({ x, y }, 0xE004, 0xFFFFFF_rgb .WithAlpha(alpha));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case IconClose:
|
case IconClose:
|
||||||
if(invert)
|
if(invert)
|
||||||
BlendChar({ x, y }, 0xE02A, RGBA<uint8_t>(20, 20, 20, alpha));
|
BlendChar({ x, y }, 0xE02A, 0x141414_rgb .WithAlpha(alpha));
|
||||||
else
|
else
|
||||||
BlendChar({ x, y }, 0xE02A, RGBA<uint8_t>(230, 230, 230, alpha));
|
BlendChar({ x, y }, 0xE02A, 0xE6E6E6_rgb .WithAlpha(alpha));
|
||||||
break;
|
break;
|
||||||
case IconVoteSort:
|
case IconVoteSort:
|
||||||
if (invert)
|
if (invert)
|
||||||
{
|
{
|
||||||
BlendChar({ x, y }, 0xE029, RGBA<uint8_t>(44, 48, 32, alpha));
|
BlendChar({ x, y }, 0xE029, 0x2C3020_rgb .WithAlpha(alpha));
|
||||||
BlendChar({ x, y }, 0xE028, RGBA<uint8_t>(32, 44, 32, alpha));
|
BlendChar({ x, y }, 0xE028, 0x202C20_rgb .WithAlpha(alpha));
|
||||||
BlendChar({ x, y }, 0xE027, RGBA<uint8_t>(128, 128, 128, alpha));
|
BlendChar({ x, y }, 0xE027, 0x808080_rgb .WithAlpha(alpha));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BlendChar({ x, y }, 0xE029, RGBA<uint8_t>(144, 48, 32, alpha));
|
BlendChar({ x, y }, 0xE029, 0x903020_rgb .WithAlpha(alpha));
|
||||||
BlendChar({ x, y }, 0xE028, RGBA<uint8_t>(32, 144, 32, alpha));
|
BlendChar({ x, y }, 0xE028, 0x209020_rgb .WithAlpha(alpha));
|
||||||
BlendChar({ x, y }, 0xE027, RGBA<uint8_t>(255, 255, 255, alpha));
|
BlendChar({ x, y }, 0xE027, 0xFFFFFF_rgb .WithAlpha(alpha));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case IconDateSort:
|
case IconDateSort:
|
||||||
if (invert)
|
if (invert)
|
||||||
{
|
{
|
||||||
BlendChar({ x, y }, 0xE026, RGBA<uint8_t>(32, 32, 32, alpha));
|
BlendChar({ x, y }, 0xE026, 0x202020_rgb .WithAlpha(alpha));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BlendChar({ x, y }, 0xE026, RGBA<uint8_t>(255, 255, 255, alpha));
|
BlendChar({ x, y }, 0xE026, 0xFFFFFF_rgb .WithAlpha(alpha));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case IconMyOwn:
|
case IconMyOwn:
|
||||||
if (invert)
|
if (invert)
|
||||||
{
|
{
|
||||||
BlendChar({ x, y }, 0xE014, RGBA<uint8_t>(192, 160, 64, alpha));
|
BlendChar({ x, y }, 0xE014, 0xC0A040_rgb .WithAlpha(alpha));
|
||||||
BlendChar({ x, y }, 0xE013, RGBA<uint8_t>(32, 32, 32, alpha));
|
BlendChar({ x, y }, 0xE013, 0x202020_rgb .WithAlpha(alpha));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BlendChar({ x, y }, 0xE014, RGBA<uint8_t>(192, 160, 64, alpha));
|
BlendChar({ x, y }, 0xE014, 0xC0A040_rgb .WithAlpha(alpha));
|
||||||
BlendChar({ x, y }, 0xE013, RGBA<uint8_t>(255, 255, 255, alpha));
|
BlendChar({ x, y }, 0xE013, 0xFFFFFF_rgb .WithAlpha(alpha));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case IconSearch:
|
case IconSearch:
|
||||||
BlendChar({ x, y }, 0xE00E, RGBA<uint8_t>(30, 30, 180, alpha));
|
BlendChar({ x, y }, 0xE00E, 0x1E1EB4_rgb .WithAlpha(alpha));
|
||||||
BlendChar({ x, y }, 0xE00F, RGBA<uint8_t>(255, 255, 255, alpha));
|
BlendChar({ x, y }, 0xE00F, 0xFFFFFF_rgb .WithAlpha(alpha));
|
||||||
break;
|
break;
|
||||||
case IconDelete:
|
case IconDelete:
|
||||||
if(invert)
|
if(invert)
|
||||||
{
|
{
|
||||||
BlendChar({ x, y }, 0xE006, RGBA<uint8_t>(159, 47, 31, alpha));
|
BlendChar({ x, y }, 0xE006, 0x9F2F1F_rgb .WithAlpha(alpha));
|
||||||
BlendChar({ x, y }, 0xE005, RGBA<uint8_t>(0, 0, 0, alpha));
|
BlendChar({ x, y }, 0xE005, 0x000000_rgb .WithAlpha(alpha));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BlendChar({ x, y }, 0xE006, RGBA<uint8_t>(159, 47, 31, alpha));
|
BlendChar({ x, y }, 0xE006, 0x9F2F1F_rgb .WithAlpha(alpha));
|
||||||
BlendChar({ x, y }, 0xE005, RGBA<uint8_t>(255, 255, 255, alpha));
|
BlendChar({ x, y }, 0xE005, 0xFFFFFF_rgb .WithAlpha(alpha));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case IconAdd:
|
case IconAdd:
|
||||||
if(invert)
|
if(invert)
|
||||||
{
|
{
|
||||||
BlendChar({ x, y }, 0xE006, RGBA<uint8_t>(32, 144, 32, alpha));
|
BlendChar({ x, y }, 0xE006, 0x209020_rgb .WithAlpha(alpha));
|
||||||
BlendChar({ x, y }, 0xE009, RGBA<uint8_t>(0, 0, 0, alpha));
|
BlendChar({ x, y }, 0xE009, 0x000000_rgb .WithAlpha(alpha));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BlendChar({ x, y }, 0xE006, RGBA<uint8_t>(32, 144, 32, alpha));
|
BlendChar({ x, y }, 0xE006, 0x209020_rgb .WithAlpha(alpha));
|
||||||
BlendChar({ x, y }, 0xE009, RGBA<uint8_t>(255, 255, 255, alpha));
|
BlendChar({ x, y }, 0xE009, 0xFFFFFF_rgb .WithAlpha(alpha));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case IconVelocity:
|
case IconVelocity:
|
||||||
BlendChar({ x + 1, y }, 0xE018, RGBA<uint8_t>(128, 160, 255, alpha));
|
BlendChar({ x + 1, y }, 0xE018, 0x80A0FF_rgb .WithAlpha(alpha));
|
||||||
break;
|
break;
|
||||||
case IconPressure:
|
case IconPressure:
|
||||||
if(invert)
|
if(invert)
|
||||||
BlendChar({ x + 1, y + 1 }, 0xE019, RGBA<uint8_t>(180, 160, 16, alpha));
|
BlendChar({ x + 1, y + 1 }, 0xE019, 0xB4A010_rgb .WithAlpha(alpha));
|
||||||
else
|
else
|
||||||
BlendChar({ x + 1, y + 1 }, 0xE019, RGBA<uint8_t>(255, 212, 32, alpha));
|
BlendChar({ x + 1, y + 1 }, 0xE019, 0xFFD420_rgb .WithAlpha(alpha));
|
||||||
break;
|
break;
|
||||||
case IconPersistant:
|
case IconPersistant:
|
||||||
if(invert)
|
if(invert)
|
||||||
BlendChar({ x + 1, y + 1 }, 0xE01A, RGBA<uint8_t>(20, 20, 20, alpha));
|
BlendChar({ x + 1, y + 1 }, 0xE01A, 0x141414_rgb .WithAlpha(alpha));
|
||||||
else
|
else
|
||||||
BlendChar({ x + 1, y + 1 }, 0xE01A, RGBA<uint8_t>(212, 212, 212, alpha));
|
BlendChar({ x + 1, y + 1 }, 0xE01A, 0xD4D4D4_rgb .WithAlpha(alpha));
|
||||||
break;
|
break;
|
||||||
case IconFire:
|
case IconFire:
|
||||||
BlendChar({ x + 1, y + 1 }, 0xE01B, RGBA<uint8_t>(255, 0, 0, alpha));
|
BlendChar({ x + 1, y + 1 }, 0xE01B, 0xFF0000_rgb .WithAlpha(alpha));
|
||||||
BlendChar({ x + 1, y + 1 }, 0xE01C, RGBA<uint8_t>(255, 255, 64, alpha));
|
BlendChar({ x + 1, y + 1 }, 0xE01C, 0xFFFF40_rgb .WithAlpha(alpha));
|
||||||
break;
|
break;
|
||||||
case IconBlob:
|
case IconBlob:
|
||||||
if(invert)
|
if(invert)
|
||||||
BlendChar({ x + 1, y }, 0xE03F, RGBA<uint8_t>(55, 180, 55, alpha));
|
BlendChar({ x + 1, y }, 0xE03F, 0x37B437_rgb .WithAlpha(alpha));
|
||||||
else
|
else
|
||||||
BlendChar({ x + 1, y }, 0xE03F, RGBA<uint8_t>(55, 255, 55, alpha));
|
BlendChar({ x + 1, y }, 0xE03F, 0x37FF37_rgb .WithAlpha(alpha));
|
||||||
break;
|
break;
|
||||||
case IconHeat:
|
case IconHeat:
|
||||||
BlendChar({ x + 3, y }, 0xE03E, RGBA<uint8_t>(255, 0, 0, alpha));
|
BlendChar({ x + 3, y }, 0xE03E, 0xFF0000_rgb .WithAlpha(alpha));
|
||||||
if(invert)
|
if(invert)
|
||||||
BlendChar({ x + 3, y }, 0xE03D, RGBA<uint8_t>(0, 0, 0, alpha));
|
BlendChar({ x + 3, y }, 0xE03D, 0x000000_rgb .WithAlpha(alpha));
|
||||||
else
|
else
|
||||||
BlendChar({ x + 3, y }, 0xE03D, RGBA<uint8_t>(255, 255, 255, alpha));
|
BlendChar({ x + 3, y }, 0xE03D, 0xFFFFFF_rgb .WithAlpha(alpha));
|
||||||
break;
|
break;
|
||||||
case IconBlur:
|
case IconBlur:
|
||||||
if(invert)
|
if(invert)
|
||||||
BlendChar({ x + 1, y }, 0xE044, RGBA<uint8_t>(50, 70, 180, alpha));
|
BlendChar({ x + 1, y }, 0xE044, 0x3246B4_rgb .WithAlpha(alpha));
|
||||||
else
|
else
|
||||||
BlendChar({ x + 1, y }, 0xE044, RGBA<uint8_t>(100, 150, 255, alpha));
|
BlendChar({ x + 1, y }, 0xE044, 0x6496FF_rgb .WithAlpha(alpha));
|
||||||
break;
|
break;
|
||||||
case IconGradient:
|
case IconGradient:
|
||||||
if(invert)
|
if(invert)
|
||||||
BlendChar({ x + 1, y + 1 }, 0xE053, RGBA<uint8_t>(255, 50, 255, alpha));
|
BlendChar({ x + 1, y + 1 }, 0xE053, 0xFF32FF_rgb .WithAlpha(alpha));
|
||||||
else
|
else
|
||||||
BlendChar({ x + 1, y + 1 }, 0xE053, RGBA<uint8_t>(205, 50, 205, alpha));
|
BlendChar({ x + 1, y + 1 }, 0xE053, 0xCD32CD_rgb .WithAlpha(alpha));
|
||||||
break;
|
break;
|
||||||
case IconLife:
|
case IconLife:
|
||||||
if(invert)
|
if(invert)
|
||||||
BlendChar({ x, y + 1 }, 0xE060, RGBA<uint8_t>(0, 0, 0, alpha));
|
BlendChar({ x, y + 1 }, 0xE060, 0x000000_rgb .WithAlpha(alpha));
|
||||||
else
|
else
|
||||||
BlendChar({ x, y + 1 }, 0xE060, RGBA<uint8_t>(255, 255, 255, alpha));
|
BlendChar({ x, y + 1 }, 0xE060, 0xFFFFFF_rgb .WithAlpha(alpha));
|
||||||
break;
|
break;
|
||||||
case IconEffect:
|
case IconEffect:
|
||||||
BlendChar({ x + 1, y }, 0xE061, RGBA<uint8_t>(255, 255, 160, alpha));
|
BlendChar({ x + 1, y }, 0xE061, 0xFFFFA0_rgb .WithAlpha(alpha));
|
||||||
break;
|
break;
|
||||||
case IconGlow:
|
case IconGlow:
|
||||||
BlendChar({ x + 1, y }, 0xE05F, RGBA<uint8_t>(200, 255, 255, alpha));
|
BlendChar({ x + 1, y }, 0xE05F, 0xC8FFFF_rgb .WithAlpha(alpha));
|
||||||
break;
|
break;
|
||||||
case IconWarp:
|
case IconWarp:
|
||||||
BlendChar({ x + 1, y }, 0xE05E, RGBA<uint8_t>(255, 255, 255, alpha));
|
BlendChar({ x + 1, y }, 0xE05E, 0xFFFFFF_rgb .WithAlpha(alpha));
|
||||||
break;
|
break;
|
||||||
case IconBasic:
|
case IconBasic:
|
||||||
if(invert)
|
if(invert)
|
||||||
BlendChar({ x + 1, y + 1 }, 0xE05B, RGBA<uint8_t>(50, 50, 0, alpha));
|
BlendChar({ x + 1, y + 1 }, 0xE05B, 0x323200_rgb .WithAlpha(alpha));
|
||||||
else
|
else
|
||||||
BlendChar({ x + 1, y + 1 }, 0xE05B, RGBA<uint8_t>(255, 255, 200, alpha));
|
BlendChar({ x + 1, y + 1 }, 0xE05B, 0xFFFFC8_rgb .WithAlpha(alpha));
|
||||||
break;
|
break;
|
||||||
case IconAltAir:
|
case IconAltAir:
|
||||||
if(invert) {
|
if(invert) {
|
||||||
BlendChar({ x + 1, y + 1 }, 0xE054, RGBA<uint8_t>(180, 55, 55, alpha));
|
BlendChar({ x + 1, y + 1 }, 0xE054, 0xB43737_rgb .WithAlpha(alpha));
|
||||||
BlendChar({ x + 1, y + 1 }, 0xE055, RGBA<uint8_t>(55, 180, 55, alpha));
|
BlendChar({ x + 1, y + 1 }, 0xE055, 0x37B437_rgb .WithAlpha(alpha));
|
||||||
} else {
|
} else {
|
||||||
BlendChar({ x + 1, y + 1 }, 0xE054, RGBA<uint8_t>(255, 55, 55, alpha));
|
BlendChar({ x + 1, y + 1 }, 0xE054, 0xFF3737_rgb .WithAlpha(alpha));
|
||||||
BlendChar({ x + 1, y + 1 }, 0xE055, RGBA<uint8_t>(55, 255, 55, alpha));
|
BlendChar({ x + 1, y + 1 }, 0xE055, 0x37FF37_rgb .WithAlpha(alpha));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if(invert)
|
if(invert)
|
||||||
BlendChar({ x, y }, 't', RGBA<uint8_t>(0, 0, 0, alpha));
|
BlendChar({ x, y }, 't', 0x000000_rgb .WithAlpha(alpha));
|
||||||
else
|
else
|
||||||
BlendChar({ x, y }, 't', RGBA<uint8_t>(255, 255, 255, alpha));
|
BlendChar({ x, y }, 't', 0xFFFFFF_rgb .WithAlpha(alpha));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -151,8 +151,8 @@ void Renderer::DrawSigns()
|
|||||||
{
|
{
|
||||||
String text = currentSign.getDisplayText(sim, x, y, w, h);
|
String text = currentSign.getDisplayText(sim, x, y, w, h);
|
||||||
DrawFilledRect(RectSized(Vec2{ x + 1, y + 1 }, Vec2{ w, h - 1 }), 0x000000_rgb);
|
DrawFilledRect(RectSized(Vec2{ x + 1, y + 1 }, Vec2{ w, h - 1 }), 0x000000_rgb);
|
||||||
DrawRect(RectSized(Vec2{ x, y }, Vec2{ w+1, h }), RGB<uint8_t>(192, 192, 192));
|
DrawRect(RectSized(Vec2{ x, y }, Vec2{ w+1, h }), 0xC0C0C0_rgb);
|
||||||
BlendText({ x+3, y+4 }, text, RGBA<uint8_t>(255, 255, 255, 255));
|
BlendText({ x+3, y+4 }, text, 0xFFFFFF_rgb .WithAlpha(255));
|
||||||
|
|
||||||
if (currentSign.ju != sign::None)
|
if (currentSign.ju != sign::None)
|
||||||
{
|
{
|
||||||
@ -162,7 +162,7 @@ void Renderer::DrawSigns()
|
|||||||
int dy = (currentSign.y > 18) ? -1 : 1;
|
int dy = (currentSign.y > 18) ? -1 : 1;
|
||||||
for (int j = 0; j < 4; j++)
|
for (int j = 0; j < 4; j++)
|
||||||
{
|
{
|
||||||
DrawPixel({ x, y }, RGB<uint8_t>(192, 192, 192));
|
DrawPixel({ x, y }, 0xC0C0C0_rgb);
|
||||||
x += dx;
|
x += dx;
|
||||||
y += dy;
|
y += dy;
|
||||||
}
|
}
|
||||||
@ -188,9 +188,9 @@ void Renderer::render_parts()
|
|||||||
for (nx=0; nx<XRES; nx++)
|
for (nx=0; nx<XRES; nx++)
|
||||||
{
|
{
|
||||||
if (ny%(4*gridSize) == 0)
|
if (ny%(4*gridSize) == 0)
|
||||||
BlendPixel({ nx, ny }, RGBA<uint8_t>(100, 100, 100, 80));
|
BlendPixel({ nx, ny }, 0x646464_rgb .WithAlpha(80));
|
||||||
if (nx%(4*gridSize) == 0 && ny%(4*gridSize) != 0)
|
if (nx%(4*gridSize) == 0 && ny%(4*gridSize) != 0)
|
||||||
BlendPixel({ nx, ny }, RGBA<uint8_t>(100, 100, 100, 80));
|
BlendPixel({ nx, ny }, 0x646464_rgb .WithAlpha(80));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foundElements = 0;
|
foundElements = 0;
|
||||||
@ -417,7 +417,7 @@ void Renderer::render_parts()
|
|||||||
if (mousePos.X>(nx-3) && mousePos.X<(nx+3) && mousePos.Y<(ny+3) && mousePos.Y>(ny-3)) //If mouse is in the head
|
if (mousePos.X>(nx-3) && mousePos.X<(nx+3) && mousePos.Y<(ny+3) && mousePos.Y>(ny-3)) //If mouse is in the head
|
||||||
{
|
{
|
||||||
String hp = String::Build(Format::Width(sim->parts[i].life, 3));
|
String hp = String::Build(Format::Width(sim->parts[i].life, 3));
|
||||||
BlendText(mousePos + Vec2{ -8-2*(sim->parts[i].life<100)-2*(sim->parts[i].life<10), -12 }, hp, RGBA<uint8_t>(255, 255, 255, 255));
|
BlendText(mousePos + Vec2{ -8-2*(sim->parts[i].life<100)-2*(sim->parts[i].life<10), -12 }, hp, 0xFFFFFF_rgb .WithAlpha(255));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (findingElement == t)
|
if (findingElement == t)
|
||||||
@ -510,9 +510,9 @@ void Renderer::render_parts()
|
|||||||
int nx = int(cplayer->legs[leg*8+4]), ny = int(cplayer->legs[leg*8+5]);
|
int nx = int(cplayer->legs[leg*8+4]), ny = int(cplayer->legs[leg*8+5]);
|
||||||
int colr = 255, colg = 0, colb = 255;
|
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))
|
if (((int)(cplayer->comm)&0x04) == 0x04 || (((int)(cplayer->comm)&0x01) == 0x01 && leg==0) || (((int)(cplayer->comm)&0x02) == 0x02 && leg==1))
|
||||||
DrawPixel({ nx, ny }, RGB<uint8_t>(0, 255, 0));
|
DrawPixel({ nx, ny }, 0x00FF00_rgb);
|
||||||
else
|
else
|
||||||
DrawPixel({ nx, ny }, RGB<uint8_t>(255, 0, 0));
|
DrawPixel({ nx, ny }, 0xFF0000_rgb);
|
||||||
BlendPixel({ nx+1, ny }, RGBA<uint8_t>(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-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));
|
||||||
@ -778,9 +778,9 @@ void Renderer::draw_grav_zones()
|
|||||||
for (j=0; j<CELL; j++)//draws the colors
|
for (j=0; j<CELL; j++)//draws the colors
|
||||||
for (i=0; i<CELL; i++)
|
for (i=0; i<CELL; i++)
|
||||||
if(i == j)
|
if(i == j)
|
||||||
BlendPixel({ x*CELL+i, y*CELL+j }, RGBA<uint8_t>(255, 200, 0, 120));
|
BlendPixel({ x*CELL+i, y*CELL+j }, 0xFFC800_rgb .WithAlpha(120));
|
||||||
else
|
else
|
||||||
BlendPixel({ x*CELL+i, y*CELL+j }, RGBA<uint8_t>(32, 32, 32, 120));
|
BlendPixel({ x*CELL+i, y*CELL+j }, 0x202020_rgb .WithAlpha(120));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -808,7 +808,7 @@ void Renderer::draw_grav()
|
|||||||
{
|
{
|
||||||
nx -= sim->gravx[ca]*0.5f;
|
nx -= sim->gravx[ca]*0.5f;
|
||||||
ny -= sim->gravy[ca]*0.5f;
|
ny -= sim->gravy[ca]*0.5f;
|
||||||
AddPixel({ int(nx+0.5f), int(ny+0.5f) }, RGBA<uint8_t>(255, 255, 255, (int)(dist*20.0f)));
|
AddPixel({ int(nx+0.5f), int(ny+0.5f) }, 0xFFFFFF_rgb .WithAlpha(int(dist*20.0f)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -979,8 +979,8 @@ void Renderer::DrawWalls()
|
|||||||
// there is no velocity here, draw a streamline and continue
|
// there is no velocity here, draw a streamline and continue
|
||||||
if (!xVel && !yVel)
|
if (!xVel && !yVel)
|
||||||
{
|
{
|
||||||
BlendText({ x*CELL, y*CELL-2 }, 0xE00D, RGBA<uint8_t>(255, 255, 255, 128));
|
BlendText({ x*CELL, y*CELL-2 }, 0xE00D, 0xFFFFFF_rgb .WithAlpha(128));
|
||||||
AddPixel({ oldX, oldY }, RGBA<uint8_t>(255, 255, 255, 255));
|
AddPixel({ oldX, oldY }, 0xFFFFFF_rgb .WithAlpha(255));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
@ -996,7 +996,7 @@ void Renderer::DrawWalls()
|
|||||||
}
|
}
|
||||||
if (changed && (newX<0 || newX>=XRES || newY<0 || newY>=YRES))
|
if (changed && (newX<0 || newX>=XRES || newY<0 || newY>=YRES))
|
||||||
break;
|
break;
|
||||||
AddPixel({ newX, newY }, RGBA<uint8_t>(255, 255, 255, 64));
|
AddPixel({ newX, newY }, 0xFFFFFF_rgb .WithAlpha(64));
|
||||||
// cache velocity and other checks so we aren't running them constantly
|
// cache velocity and other checks so we aren't running them constantly
|
||||||
if (changed)
|
if (changed)
|
||||||
{
|
{
|
||||||
@ -1010,7 +1010,7 @@ void Renderer::DrawWalls()
|
|||||||
xf += xVel;
|
xf += xVel;
|
||||||
yf += yVel;
|
yf += yVel;
|
||||||
}
|
}
|
||||||
BlendText({ x*CELL, y*CELL-2 }, 0xE00D, RGBA<uint8_t>(255, 255, 255, 128));
|
BlendText({ x*CELL, y*CELL-2 }, 0xE00D, 0xFFFFFF_rgb .WithAlpha(128));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -71,8 +71,8 @@ void Renderer::RenderZoom()
|
|||||||
pixel pix;
|
pixel pix;
|
||||||
|
|
||||||
DrawFilledRect(RectSized(zoomWindowPosition, { zoomScopeSize * ZFACTOR, zoomScopeSize * ZFACTOR }), 0x000000_rgb);
|
DrawFilledRect(RectSized(zoomWindowPosition, { zoomScopeSize * ZFACTOR, zoomScopeSize * ZFACTOR }), 0x000000_rgb);
|
||||||
DrawRect(RectSized(zoomWindowPosition - Vec2{ 2, 2 }, Vec2{ zoomScopeSize*ZFACTOR+3, zoomScopeSize*ZFACTOR+3 }), RGB<uint8_t>(192, 192, 192));
|
DrawRect(RectSized(zoomWindowPosition - Vec2{ 2, 2 }, Vec2{ zoomScopeSize*ZFACTOR+3, zoomScopeSize*ZFACTOR+3 }), 0xC0C0C0_rgb);
|
||||||
DrawRect(RectSized(zoomWindowPosition - Vec2{ 1, 1 }, Vec2{ zoomScopeSize*ZFACTOR+1, zoomScopeSize*ZFACTOR+1 }), RGB<uint8_t>(0, 0, 0));
|
DrawRect(RectSized(zoomWindowPosition - Vec2{ 1, 1 }, Vec2{ zoomScopeSize*ZFACTOR+1, zoomScopeSize*ZFACTOR+1 }), 0x000000_rgb);
|
||||||
for (j=0; j<zoomScopeSize; j++)
|
for (j=0; j<zoomScopeSize; j++)
|
||||||
for (i=0; i<zoomScopeSize; i++)
|
for (i=0; i<zoomScopeSize; i++)
|
||||||
{
|
{
|
||||||
|
@ -255,10 +255,10 @@ void ColourPickerActivity::OnKeyPress(int key, int scan, bool repeat, bool shift
|
|||||||
void ColourPickerActivity::OnDraw()
|
void ColourPickerActivity::OnDraw()
|
||||||
{
|
{
|
||||||
Graphics * g = GetGraphics();
|
Graphics * g = GetGraphics();
|
||||||
g->BlendFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), RGBA<uint8_t>(0, 0, 0, currentAlpha));
|
g->BlendFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb .WithAlpha(currentAlpha));
|
||||||
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(255, 255, 255));
|
g->DrawRect(RectSized(Position, Size), 0xFFFFFF_rgb);
|
||||||
|
|
||||||
g->DrawRect(RectSized(Position + Vec2{ 4, 4 }, Vec2{ 258, 130 }), RGB<uint8_t>(180, 180, 180));
|
g->DrawRect(RectSized(Position + Vec2{ 4, 4 }, Vec2{ 258, 130 }), 0xB4B4B4_rgb);
|
||||||
|
|
||||||
|
|
||||||
auto offset = Position + Vec2{ 5, 5 };
|
auto offset = Position + Vec2{ 5, 5 };
|
||||||
|
@ -110,9 +110,9 @@ void ConsoleView::NotifyCurrentCommandChanged(ConsoleModel * sender)
|
|||||||
void ConsoleView::OnDraw()
|
void ConsoleView::OnDraw()
|
||||||
{
|
{
|
||||||
Graphics * g = GetGraphics();
|
Graphics * g = GetGraphics();
|
||||||
g->BlendFilledRect(RectSized(Position, Size), RGBA<uint8_t>(0, 0, 0, 110));
|
g->BlendFilledRect(RectSized(Position, Size), 0x000000_rgb .WithAlpha(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-16 }, Position + Size - Vec2{ 0, 16 }, 0xFFFFFF_rgb .WithAlpha(160));
|
||||||
g->BlendLine(Position + Vec2{ 0, Size.Y }, Position + Size, RGBA<uint8_t>(255, 255, 255, 200));
|
g->BlendLine(Position + Vec2{ 0, Size.Y }, Position + Size, 0xFFFFFF_rgb .WithAlpha(200));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConsoleView::OnTick(float dt)
|
void ConsoleView::OnTick(float dt)
|
||||||
|
@ -83,5 +83,5 @@ void ConfirmPrompt::OnDraw()
|
|||||||
Graphics * g = GetGraphics();
|
Graphics * g = GetGraphics();
|
||||||
|
|
||||||
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
||||||
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(200, 200, 200));
|
g->DrawRect(RectSized(Position, Size), 0xC8C8C8_rgb);
|
||||||
}
|
}
|
||||||
|
@ -59,5 +59,5 @@ void ErrorMessage::OnDraw()
|
|||||||
Graphics * g = GetGraphics();
|
Graphics * g = GetGraphics();
|
||||||
|
|
||||||
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
||||||
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(200, 200, 200));
|
g->DrawRect(RectSized(Position, Size), 0xC8C8C8_rgb);
|
||||||
}
|
}
|
||||||
|
@ -75,5 +75,5 @@ void InformationMessage::OnDraw()
|
|||||||
Graphics * g = GetGraphics();
|
Graphics * g = GetGraphics();
|
||||||
|
|
||||||
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
||||||
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(200, 200, 200));
|
g->DrawRect(RectSized(Position, Size), 0xC8C8C8_rgb);
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ void SaveIDMessage::OnDraw()
|
|||||||
Graphics * g = GetGraphics();
|
Graphics * g = GetGraphics();
|
||||||
|
|
||||||
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
||||||
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(200, 200, 200));
|
g->DrawRect(RectSized(Position, Size), 0xC8C8C8_rgb);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SaveIDMessage::OnTryExit(ExitMethod method)
|
void SaveIDMessage::OnTryExit(ExitMethod method)
|
||||||
|
@ -94,5 +94,5 @@ void TextPrompt::OnDraw()
|
|||||||
Graphics * g = GetGraphics();
|
Graphics * g = GetGraphics();
|
||||||
|
|
||||||
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
||||||
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(200, 200, 200));
|
g->DrawRect(RectSized(Position, Size), 0xC8C8C8_rgb);
|
||||||
}
|
}
|
||||||
|
@ -213,15 +213,15 @@ void ElementSearchActivity::OnDraw()
|
|||||||
{
|
{
|
||||||
Graphics * g = GetGraphics();
|
Graphics * g = GetGraphics();
|
||||||
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
||||||
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(255, 255, 255));
|
g->DrawRect(RectSized(Position, Size), 0xFFFFFF_rgb);
|
||||||
|
|
||||||
g->BlendRect(
|
g->BlendRect(
|
||||||
RectSized(Position + searchField->Position + Vec2{ 0, searchField->Size.Y+8 },
|
RectSized(Position + searchField->Position + Vec2{ 0, searchField->Size.Y+8 },
|
||||||
{ searchField->Size.X, Size.Y-(searchField->Position.Y+searchField->Size.Y+8)-23 }),
|
{ searchField->Size.X, Size.Y-(searchField->Position.Y+searchField->Size.Y+8)-23 }),
|
||||||
RGBA<uint8_t>(255, 255, 255, 180));
|
0xFFFFFF_rgb .WithAlpha(180));
|
||||||
if (toolTipPresence && toolTip.length())
|
if (toolTipPresence && toolTip.length())
|
||||||
{
|
{
|
||||||
g->BlendText({ 10, Size.Y+70 }, toolTip, RGBA<uint8_t>(255, 255, 255, toolTipPresence>51?255:toolTipPresence*5));
|
g->BlendText({ 10, Size.Y+70 }, toolTip, 0xFFFFFF_rgb .WithAlpha(toolTipPresence>51?255:toolTipPresence*5));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -304,7 +304,7 @@ void FileBrowserActivity::OnDraw()
|
|||||||
|
|
||||||
//Window Background+Outline
|
//Window Background+Outline
|
||||||
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
||||||
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(255, 255, 255));
|
g->DrawRect(RectSized(Position, Size), 0xFFFFFF_rgb);
|
||||||
}
|
}
|
||||||
|
|
||||||
FileBrowserActivity::~FileBrowserActivity()
|
FileBrowserActivity::~FileBrowserActivity()
|
||||||
|
@ -491,19 +491,19 @@ void FontEditor::OnDraw()
|
|||||||
|
|
||||||
if(rulers)
|
if(rulers)
|
||||||
{
|
{
|
||||||
g->DrawLine({ 0, 7 + 0 * FONT_SCALE }, { areaWidth - 1, 7 + 0 * FONT_SCALE }, RGB<uint8_t>(128, 128, 128));
|
g->DrawLine({ 0, 7 + 0 * FONT_SCALE }, { areaWidth - 1, 7 + 0 * FONT_SCALE }, 0x808080_rgb);
|
||||||
g->DrawLine({ 0, 7 + 2 * FONT_SCALE }, { areaWidth - 1, 7 + 2 * FONT_SCALE }, RGB<uint8_t>(128, 128, 128));
|
g->DrawLine({ 0, 7 + 2 * FONT_SCALE }, { areaWidth - 1, 7 + 2 * FONT_SCALE }, 0x808080_rgb);
|
||||||
g->DrawLine({ 0, 7 + 4 * FONT_SCALE }, { areaWidth - 1, 7 + 4 * FONT_SCALE }, RGB<uint8_t>(128, 128, 128));
|
g->DrawLine({ 0, 7 + 4 * FONT_SCALE }, { areaWidth - 1, 7 + 4 * FONT_SCALE }, 0x808080_rgb);
|
||||||
g->DrawLine({ 0, 7 + 9 * FONT_SCALE }, { areaWidth - 1, 7 + 9 * FONT_SCALE }, RGB<uint8_t>(128, 128, 128));
|
g->DrawLine({ 0, 7 + 9 * FONT_SCALE }, { areaWidth - 1, 7 + 9 * FONT_SCALE }, 0x808080_rgb);
|
||||||
g->DrawLine({ 0, 7 + 12 * FONT_SCALE }, { areaWidth - 1, 7 + 12 * FONT_SCALE }, RGB<uint8_t>(128, 128, 128));
|
g->DrawLine({ 0, 7 + 12 * FONT_SCALE }, { areaWidth - 1, 7 + 12 * FONT_SCALE }, 0x808080_rgb);
|
||||||
|
|
||||||
g->DrawLine({ 7, 8 }, { 7, 7 + FONT_H * FONT_SCALE }, RGB<uint8_t>(128, 128, 128));
|
g->DrawLine({ 7, 8 }, { 7, 7 + FONT_H * FONT_SCALE }, 0x808080_rgb);
|
||||||
g->DrawLine({ 7 + width * FONT_SCALE, 8}, { 7 + width * FONT_SCALE, 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 }, 0x808080_rgb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g->BlendText({ 8, 8 }, "No character", RGBA<uint8_t>(255, 0, 0, 255));
|
g->BlendText({ 8, 8 }, "No character", 0xFF0000_rgb .WithAlpha(255));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,7 +186,7 @@ void GOLWindow::OnDraw()
|
|||||||
Graphics * g = GetGraphics();
|
Graphics * g = GetGraphics();
|
||||||
|
|
||||||
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
||||||
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(200, 200, 200));
|
g->DrawRect(RectSized(Position, Size), 0xC8C8C8_rgb);
|
||||||
|
|
||||||
int width = Size.X - 60;
|
int width = Size.X - 60;
|
||||||
for (int xx = 0; xx < width; ++xx)
|
for (int xx = 0; xx < width; ++xx)
|
||||||
|
@ -153,7 +153,7 @@ public:
|
|||||||
drawn = true;
|
drawn = true;
|
||||||
|
|
||||||
if(showSplit)
|
if(showSplit)
|
||||||
g->DrawLine(screenPos + Vec2{ splitPosition, 1 }, screenPos + Vec2{ splitPosition, Size.Y-2 }, RGB<uint8_t>(180, 180, 180));
|
g->DrawLine(screenPos + Vec2{ splitPosition, 1 }, screenPos + Vec2{ splitPosition, Size.Y-2 }, 0xB4B4B4_rgb);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2139,7 +2139,7 @@ void GameView::OnDraw()
|
|||||||
{
|
{
|
||||||
if(selectPoint1.X==-1)
|
if(selectPoint1.X==-1)
|
||||||
{
|
{
|
||||||
ren->BlendFilledRect(RectSized(Vec2{ 0, 0 }, Vec2{ XRES, YRES }), RGBA<uint8_t>(0, 0, 0, 100));
|
ren->BlendFilledRect(RectSized(Vec2{ 0, 0 }, Vec2{ XRES, YRES }), 0x000000_rgb .WithAlpha(100));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2153,11 +2153,11 @@ void GameView::OnDraw()
|
|||||||
if(y2>YRES-1)
|
if(y2>YRES-1)
|
||||||
y2 = YRES-1;
|
y2 = YRES-1;
|
||||||
|
|
||||||
ren->BlendFilledRect(RectSized(Vec2{ 0, 0 }, Vec2{ XRES, y1 }), RGBA<uint8_t>(0, 0, 0, 100));
|
ren->BlendFilledRect(RectSized(Vec2{ 0, 0 }, Vec2{ XRES, y1 }), 0x000000_rgb .WithAlpha(100));
|
||||||
ren->BlendFilledRect(RectSized(Vec2{ 0, y2+1 }, Vec2{ XRES, YRES-y2-1 }), RGBA<uint8_t>(0, 0, 0, 100));
|
ren->BlendFilledRect(RectSized(Vec2{ 0, y2+1 }, Vec2{ XRES, YRES-y2-1 }), 0x000000_rgb .WithAlpha(100));
|
||||||
|
|
||||||
ren->BlendFilledRect(RectSized(Vec2{ 0, y1 }, Vec2{ x1, (y2-y1)+1 }), RGBA<uint8_t>(0, 0, 0, 100));
|
ren->BlendFilledRect(RectSized(Vec2{ 0, y1 }, Vec2{ x1, (y2-y1)+1 }), 0x000000_rgb .WithAlpha(100));
|
||||||
ren->BlendFilledRect(RectSized(Vec2{ x2+1, y1 }, Vec2{ XRES-x2-1, (y2-y1)+1 }), RGBA<uint8_t>(0, 0, 0, 100));
|
ren->BlendFilledRect(RectSized(Vec2{ x2+1, y1 }, Vec2{ XRES-x2-1, (y2-y1)+1 }), 0x000000_rgb .WithAlpha(100));
|
||||||
|
|
||||||
ren->XorDottedRect(RectBetween(Vec2{ x1, y1 }, Vec2{ x2, y2 }));
|
ren->XorDottedRect(RectBetween(Vec2{ x1, y1 }, Vec2{ x2, y2 }));
|
||||||
}
|
}
|
||||||
@ -2198,8 +2198,8 @@ void GameView::OnDraw()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
startY -= 14;
|
startY -= 14;
|
||||||
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->BlendFilledRect(RectSized(Vec2{ startX-3, startY-3 }, Vec2{ Graphics::TextSize(message).X + 5, 14 }), 0x000000_rgb .WithAlpha(std::min(100, alpha)));
|
||||||
g->BlendText({ startX, startY }, message, RGBA<uint8_t>(255, 255, 255, alpha));
|
g->BlendText({ startX, startY }, message, 0xFFFFFF_rgb .WithAlpha(alpha));
|
||||||
(*iter).second -= 3;
|
(*iter).second -= 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2210,8 +2210,8 @@ void GameView::OnDraw()
|
|||||||
String sampleInfo = String::Build("#", screenshotIndex, " ", String(0xE00E), " REC");
|
String sampleInfo = String::Build("#", screenshotIndex, " ", String(0xE00E), " REC");
|
||||||
|
|
||||||
int textWidth = Graphics::TextSize(sampleInfo).X - 1;
|
int textWidth = Graphics::TextSize(sampleInfo).X - 1;
|
||||||
g->BlendFilledRect(RectSized(Vec2{ XRES-20-textWidth, 12 }, Vec2{ textWidth+8, 15 }), RGBA<uint8_t>(0, 0, 0, 127));
|
g->BlendFilledRect(RectSized(Vec2{ XRES-20-textWidth, 12 }, Vec2{ textWidth+8, 15 }), 0x000000_rgb .WithAlpha(127));
|
||||||
g->BlendText({ XRES-16-textWidth, 16 }, sampleInfo, RGBA<uint8_t>(255, 50, 20, 255));
|
g->BlendText({ XRES-16-textWidth, 16 }, sampleInfo, 0xFF3214_rgb .WithAlpha(255));
|
||||||
}
|
}
|
||||||
else if(showHud)
|
else if(showHud)
|
||||||
{
|
{
|
||||||
@ -2331,14 +2331,14 @@ void GameView::OnDraw()
|
|||||||
}
|
}
|
||||||
|
|
||||||
int textWidth = Graphics::TextSize(sampleInfo.Build()).X - 1;
|
int textWidth = Graphics::TextSize(sampleInfo.Build()).X - 1;
|
||||||
g->BlendFilledRect(RectSized(Vec2{ XRES-20-textWidth, 12 }, Vec2{ textWidth+8, 15 }), RGBA<uint8_t>(0, 0, 0, int(alpha*0.5f)));
|
g->BlendFilledRect(RectSized(Vec2{ XRES-20-textWidth, 12 }, Vec2{ textWidth+8, 15 }), 0x000000_rgb .WithAlpha(int(alpha*0.5f)));
|
||||||
g->BlendText({ XRES-16-textWidth, 16 }, sampleInfo.Build(), RGBA<uint8_t>(255, 255, 255, int(alpha*0.75f)));
|
g->BlendText({ XRES-16-textWidth, 16 }, sampleInfo.Build(), 0xFFFFFF_rgb .WithAlpha(int(alpha*0.75f)));
|
||||||
|
|
||||||
if (wavelengthGfx)
|
if (wavelengthGfx)
|
||||||
{
|
{
|
||||||
int i, cr, cg, cb, j, h = 3, x = XRES-19-textWidth, y = 10;
|
int i, cr, cg, cb, j, h = 3, x = XRES-19-textWidth, y = 10;
|
||||||
int tmp;
|
int tmp;
|
||||||
g->BlendFilledRect(RectSized(Vec2{ x, y }, Vec2{ 30, h }), RGBA<uint8_t>(64, 64, 64, alpha));
|
g->BlendFilledRect(RectSized(Vec2{ x, y }, Vec2{ 30, h }), 0x404040_rgb .WithAlpha(alpha));
|
||||||
for (i = 0; i < 30; i++)
|
for (i = 0; i < 30; i++)
|
||||||
{
|
{
|
||||||
if ((wavelengthGfx >> i)&1)
|
if ((wavelengthGfx >> i)&1)
|
||||||
@ -2389,8 +2389,8 @@ void GameView::OnDraw()
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto textWidth = Graphics::TextSize(sampleInfo.Build()).X - 1;
|
auto textWidth = Graphics::TextSize(sampleInfo.Build()).X - 1;
|
||||||
g->BlendFilledRect(RectSized(Vec2{ XRES-20-textWidth, 27 }, Vec2{ textWidth+8, 14 }), RGBA<uint8_t>(0, 0, 0, int(alpha*0.5f)));
|
g->BlendFilledRect(RectSized(Vec2{ XRES-20-textWidth, 27 }, Vec2{ textWidth+8, 14 }), 0x000000_rgb .WithAlpha(int(alpha*0.5f)));
|
||||||
g->BlendText({ XRES-16-textWidth, 30 }, sampleInfo.Build(), RGBA<uint8_t>(255, 255, 255, int(alpha*0.75f)));
|
g->BlendText({ XRES-16-textWidth, 30 }, sampleInfo.Build(), 0xFFFFFF_rgb .WithAlpha(int(alpha*0.75f)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2418,35 +2418,35 @@ void GameView::OnDraw()
|
|||||||
|
|
||||||
int textWidth = Graphics::TextSize(fpsInfo.Build()).X - 1;
|
int textWidth = Graphics::TextSize(fpsInfo.Build()).X - 1;
|
||||||
int alpha = 255-introText*5;
|
int alpha = 255-introText*5;
|
||||||
g->BlendFilledRect(RectSized(Vec2{ 12, 12 }, Vec2{ textWidth+8, 15 }), RGBA<uint8_t>(0, 0, 0, int(alpha*0.5)));
|
g->BlendFilledRect(RectSized(Vec2{ 12, 12 }, Vec2{ textWidth+8, 15 }), 0x000000_rgb .WithAlpha(int(alpha*0.5)));
|
||||||
g->BlendText({ 16, 16 }, fpsInfo.Build(), RGBA<uint8_t>(32, 216, 255, int(alpha*0.75)));
|
g->BlendText({ 16, 16 }, fpsInfo.Build(), 0x20D8FF_rgb .WithAlpha(int(alpha*0.75)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//Tooltips
|
//Tooltips
|
||||||
if(infoTipPresence)
|
if(infoTipPresence)
|
||||||
{
|
{
|
||||||
int infoTipAlpha = (infoTipPresence>50?50:infoTipPresence)*5;
|
int infoTipAlpha = (infoTipPresence>50?50:infoTipPresence)*5;
|
||||||
g->BlendTextOutline({ (XRES - (Graphics::TextSize(infoTip).X - 1)) / 2, YRES / 2 - 2 }, infoTip, RGBA<uint8_t>(255, 255, 255, infoTipAlpha));
|
g->BlendTextOutline({ (XRES - (Graphics::TextSize(infoTip).X - 1)) / 2, YRES / 2 - 2 }, infoTip, 0xFFFFFF_rgb .WithAlpha(infoTipAlpha));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(toolTipPresence && toolTipPosition.X!=-1 && toolTipPosition.Y!=-1 && toolTip.length())
|
if(toolTipPresence && toolTipPosition.X!=-1 && toolTipPosition.Y!=-1 && toolTip.length())
|
||||||
{
|
{
|
||||||
if (toolTipPosition.Y == Size.Y-MENUSIZE-10)
|
if (toolTipPosition.Y == Size.Y-MENUSIZE-10)
|
||||||
g->BlendTextOutline(toolTipPosition, toolTip, RGBA<uint8_t>(255, 255, 255, toolTipPresence>51?255:toolTipPresence*5));
|
g->BlendTextOutline(toolTipPosition, toolTip, 0xFFFFFF_rgb .WithAlpha(toolTipPresence>51?255:toolTipPresence*5));
|
||||||
else
|
else
|
||||||
g->BlendText(toolTipPosition, toolTip, RGBA<uint8_t>(255, 255, 255, toolTipPresence>51?255:toolTipPresence*5));
|
g->BlendText(toolTipPosition, toolTip, 0xFFFFFF_rgb .WithAlpha(toolTipPresence>51?255:toolTipPresence*5));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(buttonTipShow > 0)
|
if(buttonTipShow > 0)
|
||||||
{
|
{
|
||||||
g->BlendText({ 16, Size.Y-MENUSIZE-24 }, buttonTip, RGBA<uint8_t>(255, 255, 255, buttonTipShow>51?255:buttonTipShow*5));
|
g->BlendText({ 16, Size.Y-MENUSIZE-24 }, buttonTip, 0xFFFFFF_rgb .WithAlpha(buttonTipShow>51?255:buttonTipShow*5));
|
||||||
}
|
}
|
||||||
|
|
||||||
//Introduction text
|
//Introduction text
|
||||||
if(introText && showHud)
|
if(introText && showHud)
|
||||||
{
|
{
|
||||||
g->BlendFilledRect(RectSized(Vec2{ 0, 0 }, WINDOW), RGBA<uint8_t>(0, 0, 0, introText>51?102:introText*2));
|
g->BlendFilledRect(RectSized(Vec2{ 0, 0 }, WINDOW), 0x000000_rgb .WithAlpha(introText>51?102:introText*2));
|
||||||
g->BlendText({ 16, 16 }, introTextMessage, RGBA<uint8_t>(255, 255, 255, introText>51?255:introText*5));
|
g->BlendText({ 16, 16 }, introTextMessage, 0xFFFFFF_rgb .WithAlpha(introText>51?255:introText*5));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -239,7 +239,7 @@ void PropertyWindow::OnDraw()
|
|||||||
Graphics * g = GetGraphics();
|
Graphics * g = GetGraphics();
|
||||||
|
|
||||||
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
||||||
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(200, 200, 200));
|
g->DrawRect(RectSized(Position, Size), 0xC8C8C8_rgb);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PropertyWindow::OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt)
|
void PropertyWindow::OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt)
|
||||||
|
@ -169,8 +169,8 @@ void SignWindow::DoDraw()
|
|||||||
|
|
||||||
String text = currentSign.getDisplayText(sim, x, y, w, h);
|
String text = currentSign.getDisplayText(sim, x, y, w, h);
|
||||||
g->DrawFilledRect(RectSized(Vec2{ x + 1, y + 1 }, Vec2{ w, h - 1 }), 0x000000_rgb);
|
g->DrawFilledRect(RectSized(Vec2{ x + 1, y + 1 }, Vec2{ w, h - 1 }), 0x000000_rgb);
|
||||||
g->DrawRect(RectSized(Vec2{ x, y }, Vec2{ w+1, h }), RGB<uint8_t>(192, 192, 192));
|
g->DrawRect(RectSized(Vec2{ x, y }, Vec2{ w+1, h }), 0xC0C0C0_rgb);
|
||||||
g->BlendText({ x+3, y+4 }, text, RGBA<uint8_t>(255, 255, 255, 255));
|
g->BlendText({ x+3, y+4 }, text, 0xFFFFFF_rgb .WithAlpha(255));
|
||||||
|
|
||||||
if (currentSign.ju != sign::None)
|
if (currentSign.ju != sign::None)
|
||||||
{
|
{
|
||||||
@ -180,7 +180,7 @@ void SignWindow::DoDraw()
|
|||||||
dy = (currentSign.y > 18) ? -1 : 1;
|
dy = (currentSign.y > 18) ? -1 : 1;
|
||||||
for (int j=0; j<4; j++)
|
for (int j=0; j<4; j++)
|
||||||
{
|
{
|
||||||
g->DrawPixel({ x, y }, RGB<uint8_t>(192, 192, 192));
|
g->DrawPixel({ x, y }, 0xC0C0C0_rgb);
|
||||||
x+=dx;
|
x+=dx;
|
||||||
y+=dy;
|
y+=dy;
|
||||||
}
|
}
|
||||||
@ -223,7 +223,7 @@ void SignWindow::OnDraw()
|
|||||||
Graphics * g = GetGraphics();
|
Graphics * g = GetGraphics();
|
||||||
|
|
||||||
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
||||||
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(200, 200, 200));
|
g->DrawRect(RectSized(Position, Size), 0xC8C8C8_rgb);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<VideoBuffer> SignTool::GetIcon(int toolID, Vec2<int> size)
|
std::unique_ptr<VideoBuffer> SignTool::GetIcon(int toolID, Vec2<int> size)
|
||||||
|
@ -76,11 +76,11 @@ void ToolButton::Draw(const ui::Point& screenPos)
|
|||||||
|
|
||||||
if (totalColour<544)
|
if (totalColour<544)
|
||||||
{
|
{
|
||||||
g->BlendText(screenPos + textPosition, buttonDisplayText, RGBA<uint8_t>(255, 255, 255, 255));
|
g->BlendText(screenPos + textPosition, buttonDisplayText, 0xFFFFFF_rgb .WithAlpha(255));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g->BlendText(screenPos + textPosition, buttonDisplayText, RGBA<uint8_t>(0, 0, 0, 255));
|
g->BlendText(screenPos + textPosition, buttonDisplayText, 0x000000_rgb .WithAlpha(255));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ClipRect.Size().X && ClipRect.Size().Y)
|
if (ClipRect.Size().X && ClipRect.Size().Y)
|
||||||
|
@ -76,22 +76,22 @@ void Checkbox::Draw(const Point& screenPos)
|
|||||||
Graphics * g = GetGraphics();
|
Graphics * g = GetGraphics();
|
||||||
if(checked)
|
if(checked)
|
||||||
{
|
{
|
||||||
g->DrawFilledRect(RectSized(screenPos + Vec2{ 5, 5 }, Vec2{ 6, 6 }), RGB<uint8_t>(255, 255, 255));
|
g->DrawFilledRect(RectSized(screenPos + Vec2{ 5, 5 }, Vec2{ 6, 6 }), 0xFFFFFF_rgb);
|
||||||
}
|
}
|
||||||
if(isMouseOver)
|
if(isMouseOver)
|
||||||
{
|
{
|
||||||
g->DrawRect(RectSized(screenPos + Vec2{ 2, 2 }, Vec2{ 12, 12 }), RGB<uint8_t>(255, 255, 255));
|
g->DrawRect(RectSized(screenPos + Vec2{ 2, 2 }, Vec2{ 12, 12 }), 0xFFFFFF_rgb);
|
||||||
g->BlendFilledRect(RectSized(screenPos + Vec2{ 5, 5 }, Vec2{ 6, 6 }), RGBA<uint8_t>(255, 255, 255, 170));
|
g->BlendFilledRect(RectSized(screenPos + Vec2{ 5, 5 }, Vec2{ 6, 6 }), 0xFFFFFF_rgb .WithAlpha(170));
|
||||||
if (!Appearance.icon)
|
if (!Appearance.icon)
|
||||||
g->BlendText(screenPos + Vec2{ 18, 4 }, text, RGBA<uint8_t>(255, 255, 255, 255));
|
g->BlendText(screenPos + Vec2{ 18, 4 }, text, 0xFFFFFF_rgb .WithAlpha(255));
|
||||||
else
|
else
|
||||||
g->draw_icon(screenPos.X+iconPosition.X, screenPos.Y+iconPosition.Y, Appearance.icon, 255);
|
g->draw_icon(screenPos.X+iconPosition.X, screenPos.Y+iconPosition.Y, Appearance.icon, 255);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g->BlendRect(RectSized(screenPos + Vec2{ 2, 2 }, Vec2{ 12, 12 }), RGBA<uint8_t>(255, 255, 255, 200));
|
g->BlendRect(RectSized(screenPos + Vec2{ 2, 2 }, Vec2{ 12, 12 }), 0xFFFFFF_rgb .WithAlpha(200));
|
||||||
if (!Appearance.icon)
|
if (!Appearance.icon)
|
||||||
g->BlendText(screenPos + Vec2{ 18, 4 }, text, RGBA<uint8_t>(255, 255, 255, 200));
|
g->BlendText(screenPos + Vec2{ 18, 4 }, text, 0xFFFFFF_rgb .WithAlpha(200));
|
||||||
else
|
else
|
||||||
g->draw_icon(screenPos.X+iconPosition.X, screenPos.Y+iconPosition.Y, Appearance.icon, 200);
|
g->draw_icon(screenPos.X+iconPosition.X, screenPos.Y+iconPosition.Y, Appearance.icon, 200);
|
||||||
}
|
}
|
||||||
|
@ -94,6 +94,6 @@ void ContextMenu::AddItem(ContextMenuItem item)
|
|||||||
void ContextMenu::OnDraw()
|
void ContextMenu::OnDraw()
|
||||||
{
|
{
|
||||||
Graphics * g = GetGraphics();
|
Graphics * g = GetGraphics();
|
||||||
g->DrawFilledRect(RectSized(Position, Size), RGB<uint8_t>(100, 100, 100));
|
g->DrawFilledRect(RectSized(Position, Size), 0x646464_rgb);
|
||||||
g->BlendRect(RectSized(Position, Size), Appearance.BackgroundInactive);
|
g->BlendRect(RectSized(Position, Size), Appearance.BackgroundInactive);
|
||||||
}
|
}
|
||||||
|
@ -125,11 +125,11 @@ void DirectionSelector::Draw(const ui::Point& screenPos)
|
|||||||
center + point.offset - Vec2{ snapPointRadius, snapPointRadius },
|
center + point.offset - Vec2{ snapPointRadius, snapPointRadius },
|
||||||
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)
|
snapPointColor.NoAlpha().WithAlpha(altDown ? (int)(snapPointColor.Alpha / 2) : snapPointColor.Alpha)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
g->BlendFilledEllipse(center + value.offset, { handleRadius, handleRadius }, RGBA<uint8_t>(foregroundColor.Red, foregroundColor.Green, foregroundColor.Blue, (mouseHover || mouseDown) ? std::min(int(foregroundColor.Alpha * 1.5f), 255) : foregroundColor.Alpha));
|
g->BlendFilledEllipse(center + value.offset, { handleRadius, handleRadius }, foregroundColor.NoAlpha().WithAlpha((mouseHover || mouseDown) ? std::min(int(foregroundColor.Alpha * 1.5f), 255) : foregroundColor.Alpha));
|
||||||
g->BlendEllipse(center + value.offset, { handleRadius, handleRadius }, borderColor);
|
g->BlendEllipse(center + value.offset, { handleRadius, handleRadius }, borderColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -253,7 +253,7 @@ void Label::Draw(const Point& screenPos)
|
|||||||
screenPos + textPosition + Vec2{ selectionXL - 1, selectionYL - 2 },
|
screenPos + textPosition + Vec2{ selectionXL - 1, selectionYL - 2 },
|
||||||
Vec2{ selectionXH - selectionXL + 1, FONT_H }
|
Vec2{ selectionXH - selectionXL + 1, FONT_H }
|
||||||
),
|
),
|
||||||
RGB<uint8_t>(255, 255, 255)
|
0xFFFFFF_rgb
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -263,7 +263,7 @@ void Label::Draw(const Point& screenPos)
|
|||||||
screenPos + textPosition + Vec2{ selectionXL - 1, selectionYL - 2 },
|
screenPos + textPosition + Vec2{ selectionXL - 1, selectionYL - 2 },
|
||||||
Vec2{ textSize.X - selectionXL + 1, FONT_H }
|
Vec2{ textSize.X - selectionXL + 1, FONT_H }
|
||||||
),
|
),
|
||||||
RGB<uint8_t>(255, 255, 255)
|
0xFFFFFF_rgb
|
||||||
);
|
);
|
||||||
for (int i = 1; i < selectionLineH - selectionLineL; ++i)
|
for (int i = 1; i < selectionLineH - selectionLineL; ++i)
|
||||||
{
|
{
|
||||||
@ -272,7 +272,7 @@ void Label::Draw(const Point& screenPos)
|
|||||||
screenPos + textPosition + Vec2{ -1, selectionYL - 2 + i * FONT_H },
|
screenPos + textPosition + Vec2{ -1, selectionYL - 2 + i * FONT_H },
|
||||||
Vec2{ textSize.X + 1, FONT_H }
|
Vec2{ textSize.X + 1, FONT_H }
|
||||||
),
|
),
|
||||||
RGB<uint8_t>(255, 255, 255)
|
0xFFFFFF_rgb
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
g->DrawFilledRect(
|
g->DrawFilledRect(
|
||||||
@ -280,7 +280,7 @@ void Label::Draw(const Point& screenPos)
|
|||||||
screenPos + textPosition + Vec2{ -1, selectionYH - 2 },
|
screenPos + textPosition + Vec2{ -1, selectionYH - 2 },
|
||||||
Vec2{ selectionXH + 1, FONT_H }
|
Vec2{ selectionXH + 1, FONT_H }
|
||||||
),
|
),
|
||||||
RGB<uint8_t>(255, 255, 255)
|
0xFFFFFF_rgb
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -288,7 +288,7 @@ void Label::Draw(const Point& screenPos)
|
|||||||
g->BlendText(
|
g->BlendText(
|
||||||
screenPos + textPosition,
|
screenPos + textPosition,
|
||||||
displayTextWithSelection,
|
displayTextWithSelection,
|
||||||
RGBA<uint8_t>(textColour.Red, textColour.Green, textColour.Blue, 255)
|
textColour.NoAlpha().WithAlpha(255)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ void ProgressBar::Draw(const Point & screenPos)
|
|||||||
|
|
||||||
ui::Colour progressBarColour = style::Colour::WarningTitle;
|
ui::Colour progressBarColour = style::Colour::WarningTitle;
|
||||||
|
|
||||||
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(255, 255, 255));
|
g->DrawRect(RectSized(Position, Size), 0xFFFFFF_rgb);
|
||||||
|
|
||||||
if(progress!=-1)
|
if(progress!=-1)
|
||||||
{
|
{
|
||||||
@ -72,7 +72,7 @@ void ProgressBar::Draw(const Point & screenPos)
|
|||||||
g->DrawFilledRect(RectSized(screenPos + Vec2{ 2, 2 }, Vec2{ rsize, Size.Y-4 }), progressBarColour.NoAlpha());
|
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));
|
g->BlendText(screenPos + Vec2{ ((Size.X-(Graphics::TextSize(progressStatus).X - 1))/2), (Size.Y-8)/2 }, progressStatus, progress<50 ? 0xFFFFFF_rgb .WithAlpha(255) : 0x000000_rgb .WithAlpha(255));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProgressBar::Tick(float dt)
|
void ProgressBar::Tick(float dt)
|
||||||
|
@ -179,7 +179,7 @@ void RichLabel::Draw(const Point& screenPos)
|
|||||||
{
|
{
|
||||||
Graphics * g = GetGraphics();
|
Graphics * g = GetGraphics();
|
||||||
ui::Colour textColour = Appearance.TextInactive;
|
ui::Colour textColour = Appearance.TextInactive;
|
||||||
g->BlendText(screenPos + textPosition, displayText, RGBA<uint8_t>(textColour.Red, textColour.Green, textColour.Blue, 255));
|
g->BlendText(screenPos + textPosition, displayText, textColour.NoAlpha().WithAlpha(255));
|
||||||
}
|
}
|
||||||
|
|
||||||
void RichLabel::OnMouseClick(int x, int y, unsigned button)
|
void RichLabel::OnMouseClick(int x, int y, unsigned button)
|
||||||
|
@ -188,7 +188,7 @@ void SaveButton::Draw(const Point& screenPos)
|
|||||||
|
|
||||||
if(selected && selectable)
|
if(selected && selectable)
|
||||||
{
|
{
|
||||||
g->BlendFilledRect(RectSized(screenPos, Size), RGBA<uint8_t>(100, 170, 255, 100));
|
g->BlendFilledRect(RectSized(screenPos, Size), 0x64AAFF_rgb .WithAlpha(100));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (thumbnail)
|
if (thumbnail)
|
||||||
@ -199,63 +199,63 @@ void SaveButton::Draw(const Point& screenPos)
|
|||||||
g->BlendImage(tex->Data(), 255, RectSized(screenPos + ((save && save->id) ? ((space - thumbBoxSize) / 2 - Vec2{ 3, 0 }) : (space - thumbSize) / 2), tex->Size()));
|
g->BlendImage(tex->Data(), 255, RectSized(screenPos + ((save && save->id) ? ((space - thumbBoxSize) / 2 - Vec2{ 3, 0 }) : (space - thumbSize) / 2), tex->Size()));
|
||||||
}
|
}
|
||||||
else if (file && !file->GetGameSave())
|
else if (file && !file->GetGameSave())
|
||||||
g->BlendText(screenPos + Vec2{ (Size.X-(Graphics::TextSize("Error loading save").X - 1))/2, (Size.Y-28)/2 }, "Error loading save", RGBA<uint8_t>(180, 180, 180, 255));
|
g->BlendText(screenPos + Vec2{ (Size.X-(Graphics::TextSize("Error loading save").X - 1))/2, (Size.Y-28)/2 }, "Error loading save", 0xB4B4B4_rgb .WithAlpha(255));
|
||||||
if(save)
|
if(save)
|
||||||
{
|
{
|
||||||
if(save->id)
|
if(save->id)
|
||||||
{
|
{
|
||||||
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{ - 3, 0 } + (Size - thumbBoxSize - Vec2{ 0, 21 }) / 2, thumbBoxSize), isMouseInside ? 0xD2E6FF_rgb : 0xB4B4B4_rgb);
|
||||||
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->DrawRect(RectSized(screenPos + Vec2{ thumbBoxSize.X - 4, 0 } + (Size - thumbBoxSize - Vec2{ 0, 21 }) / 2, Vec2{ 7, thumbBoxSize.Y }), isMouseInside ? 0xD2E6FF_rgb : 0xB4B4B4_rgb);
|
||||||
|
|
||||||
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, 1+(Size.Y-20-thumbBoxSize.Y)/2 }, Vec2{ 5, (thumbBoxSize.Y+1)/2-1 }), 0x006B0A_rgb);
|
||||||
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->DrawFilledRect(RectSized(screenPos + Vec2{ -3+thumbBoxSize.X+(Size.X-thumbBoxSize.X)/2, (Size.Y-20)/2 }, Vec2{ 5, thumbBoxSize.Y/2-1 }), 0x6B0A00_rgb);
|
||||||
|
|
||||||
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-voteBarHeightUp }, Vec2{ 3, voteBarHeightUp }), 0x39BB39_rgb); //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
|
g->DrawFilledRect(RectSized(screenPos + Vec2{ -2+thumbBoxSize.X+(Size.X-thumbBoxSize.X)/2, (Size.Y-20)/2 }, Vec2{ 3, voteBarHeightDown }), 0xBB3939_rgb); //red
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
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->DrawRect(RectSized(screenPos + (Size - thumbBoxSize - Vec2{ 0, 21 }) / 2, thumbBoxSize), isMouseInside ? 0xD2E6FF_rgb : 0xB4B4B4_rgb);
|
||||||
}
|
}
|
||||||
|
|
||||||
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));
|
g->BlendText(screenPos + Vec2{ (Size.X-(Graphics::TextSize(name).X - 1))/2, Size.Y - 21 }, name, (isMouseInside && !isMouseInsideAuthor) ? 0xFFFFFF_rgb .WithAlpha(255) : 0xB4B4B4_rgb .WithAlpha(255));
|
||||||
g->BlendText(screenPos + Vec2{ (Size.X-(Graphics::TextSize(save->userName.FromUtf8()).X - 1))/2, Size.Y - 10 }, save->userName.FromUtf8(), isMouseInsideAuthor ? RGBA<uint8_t>(200, 230, 255, 255) : RGBA<uint8_t>(100, 130, 160, 255));
|
g->BlendText(screenPos + Vec2{ (Size.X-(Graphics::TextSize(save->userName.FromUtf8()).X - 1))/2, Size.Y - 10 }, save->userName.FromUtf8(), isMouseInsideAuthor ? 0xC8E6FF_rgb .WithAlpha(255) : 0x6482A0_rgb .WithAlpha(255));
|
||||||
if (showVotes)// && !isMouseInside)
|
if (showVotes)// && !isMouseInside)
|
||||||
{
|
{
|
||||||
int x = screenPos.X-7+(Size.X-thumbBoxSize.X)/2+thumbBoxSize.X-(Graphics::TextSize(votesBackground).X - 1);
|
int x = screenPos.X-7+(Size.X-thumbBoxSize.X)/2+thumbBoxSize.X-(Graphics::TextSize(votesBackground).X - 1);
|
||||||
int y = screenPos.Y-23+(Size.Y-thumbBoxSize.Y)/2+thumbBoxSize.Y;
|
int y = screenPos.Y-23+(Size.Y-thumbBoxSize.Y)/2+thumbBoxSize.Y;
|
||||||
g->BlendText({ x, y }, votesBackground, RGBA<uint8_t>(16, 72, 16, 255));
|
g->BlendText({ x, y }, votesBackground, 0x104810_rgb .WithAlpha(255));
|
||||||
g->BlendText({ x, y }, votesBackground2, RGBA<uint8_t>(192, 192, 192, 255));
|
g->BlendText({ x, y }, votesBackground2, 0xC0C0C0_rgb .WithAlpha(255));
|
||||||
g->BlendText({ x+3, y }, votesString, RGBA<uint8_t>(255, 255, 255, 255));
|
g->BlendText({ x+3, y }, votesString, 0xFFFFFF_rgb .WithAlpha(255));
|
||||||
}
|
}
|
||||||
if (isMouseInsideHistory && showVotes)
|
if (isMouseInsideHistory && showVotes)
|
||||||
{
|
{
|
||||||
int x = screenPos.X;
|
int x = screenPos.X;
|
||||||
int y = screenPos.Y-15+(Size.Y-thumbBoxSize.Y)/2+thumbBoxSize.Y;
|
int y = screenPos.Y-15+(Size.Y-thumbBoxSize.Y)/2+thumbBoxSize.Y;
|
||||||
g->DrawFilledRect(RectSized(Vec2{ x+1, y+1 }, Vec2{ 7, 8 }), RGB<uint8_t>(255, 255, 255));
|
g->DrawFilledRect(RectSized(Vec2{ x+1, y+1 }, Vec2{ 7, 8 }), 0xFFFFFF_rgb);
|
||||||
g->BlendText({ x, y }, 0xE026, isMouseInsideHistory ? RGBA<uint8_t>(200, 100, 80, 255) : RGBA<uint8_t>(160, 70, 50, 255));
|
g->BlendText({ x, y }, 0xE026, isMouseInsideHistory ? 0xC86450_rgb .WithAlpha(255) : 0xA04632_rgb .WithAlpha(255));
|
||||||
}
|
}
|
||||||
if (!save->GetPublished())
|
if (!save->GetPublished())
|
||||||
{
|
{
|
||||||
g->BlendText(screenPos - Vec2{ 0, 2 }, 0xE04D, RGBA<uint8_t>(255, 255, 255, 255));
|
g->BlendText(screenPos - Vec2{ 0, 2 }, 0xE04D, 0xFFFFFF_rgb .WithAlpha(255));
|
||||||
g->BlendText(screenPos - Vec2{ 0, 2 }, 0xE04E, RGBA<uint8_t>(212, 151, 81, 255));
|
g->BlendText(screenPos - Vec2{ 0, 2 }, 0xE04E, 0xD49751_rgb .WithAlpha(255));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (file)
|
else if (file)
|
||||||
{
|
{
|
||||||
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->DrawRect(RectSized(screenPos + (Size - thumbBoxSize- Vec2{ 0, 21 }) / 2, thumbBoxSize), isMouseInside ? 0xD2E6FF_rgb : 0xB4B4B4_rgb);
|
||||||
if (thumbSize.X)
|
if (thumbSize.X)
|
||||||
g->XorDottedRect(RectSized(screenPos + (Size - thumbSize - Vec2{ 0, 21 }) / 2, thumbSize));
|
g->XorDottedRect(RectSized(screenPos + (Size - thumbSize - Vec2{ 0, 21 }) / 2, thumbSize));
|
||||||
|
|
||||||
g->BlendText(screenPos + Vec2{ (Size.X-(Graphics::TextSize(name).X - 1))/2, Size.Y - 21 }, name, isMouseInside ? RGBA<uint8_t>(255, 255, 255, 255) : RGBA<uint8_t>(180, 180, 180, 255));
|
g->BlendText(screenPos + Vec2{ (Size.X-(Graphics::TextSize(name).X - 1))/2, Size.Y - 21 }, name, isMouseInside ? 0xFFFFFF_rgb .WithAlpha(255) : 0xB4B4B4_rgb .WithAlpha(255));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isMouseInside && selectable)
|
if(isMouseInside && selectable)
|
||||||
{
|
{
|
||||||
g->DrawFilledRect(RectSized(screenPos + Vec2{ Size.X - 19, 7 }, Vec2{ 13, 13 }), 0x000000_rgb);
|
g->DrawFilledRect(RectSized(screenPos + Vec2{ Size.X - 19, 7 }, Vec2{ 13, 13 }), 0x000000_rgb);
|
||||||
g->DrawRect(RectSized(screenPos + Vec2{ Size.X-20, 6 }, Vec2{ 14, 14 }), RGB<uint8_t>(255, 255, 255));
|
g->DrawRect(RectSized(screenPos + Vec2{ Size.X-20, 6 }, Vec2{ 14, 14 }), 0xFFFFFF_rgb);
|
||||||
if(selected)
|
if(selected)
|
||||||
g->DrawFilledRect(RectSized(screenPos + Vec2{ Size.X-18, 8 }, Vec2{ 10, 10 }), RGB<uint8_t>(255, 255, 255));
|
g->DrawFilledRect(RectSized(screenPos + Vec2{ Size.X-18, 8 }, Vec2{ 10, 10 }), 0xFFFFFF_rgb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,8 +65,8 @@ void ScrollPanel::Draw(const Point& screenPos)
|
|||||||
scrollPos = float(Size.Y-scrollHeight)*(float(offsetY)/float(maxOffset.Y));
|
scrollPos = float(Size.Y-scrollHeight)*(float(offsetY)/float(maxOffset.Y));
|
||||||
}
|
}
|
||||||
|
|
||||||
g->BlendFilledRect(RectSized(screenPos + Vec2{ Size.X - scrollBarWidth, 0 }, { scrollBarWidth, Size.Y }), RGBA<uint8_t>(125, 125, 125, 100));
|
g->BlendFilledRect(RectSized(screenPos + Vec2{ Size.X - scrollBarWidth, 0 }, { scrollBarWidth, Size.Y }), 0x7D7D7D_rgb .WithAlpha(100));
|
||||||
g->DrawFilledRect(RectSized(screenPos + Vec2{ Size.X - scrollBarWidth, int(scrollPos) }, { scrollBarWidth, int(scrollHeight)+1 }), RGB<uint8_t>(255, 255, 255));
|
g->DrawFilledRect(RectSized(screenPos + Vec2{ Size.X - scrollBarWidth, int(scrollPos) }, { scrollBarWidth, int(scrollHeight)+1 }), 0xFFFFFF_rgb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ void Slider::Draw(const Point& screenPos)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g->DrawRect(RectSized(screenPos + Vec2{ 3, 3 }, Size - Vec2{ 6, 6 }), RGB<uint8_t>(255, 255, 255));
|
g->DrawRect(RectSized(screenPos + Vec2{ 3, 3 }, Size - Vec2{ 6, 6 }), 0xFFFFFF_rgb);
|
||||||
|
|
||||||
auto fPosition = float(sliderPosition);
|
auto fPosition = float(sliderPosition);
|
||||||
auto fSize = float(Size.X-6);
|
auto fSize = float(Size.X-6);
|
||||||
@ -126,8 +126,8 @@ void Slider::Draw(const Point& screenPos)
|
|||||||
auto sliderX = int(fSliderX);
|
auto sliderX = int(fSliderX);
|
||||||
sliderX += 3;
|
sliderX += 3;
|
||||||
|
|
||||||
g->DrawFilledRect(RectSized(screenPos + Vec2{ sliderX-2, 1 }, Vec2{ 4, Size.Y-2 }), RGB<uint8_t>(20, 20, 20));
|
g->DrawFilledRect(RectSized(screenPos + Vec2{ sliderX-2, 1 }, Vec2{ 4, Size.Y-2 }), 0x141414_rgb);
|
||||||
g->DrawRect(RectSized(screenPos + Vec2{ sliderX-2, 1 }, Vec2{ 4, Size.Y-2 }), RGB<uint8_t>(200, 200, 200));
|
g->DrawRect(RectSized(screenPos + Vec2{ sliderX-2, 1 }, Vec2{ 4, Size.Y-2 }), 0xC8C8C8_rgb);
|
||||||
}
|
}
|
||||||
|
|
||||||
} /* namespace ui */
|
} /* namespace ui */
|
||||||
|
@ -614,20 +614,20 @@ void Textbox::Draw(const Point& screenPos)
|
|||||||
if(IsFocused())
|
if(IsFocused())
|
||||||
{
|
{
|
||||||
if(border)
|
if(border)
|
||||||
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(255, 255, 255));
|
g->DrawRect(RectSized(Position, Size), 0xFFFFFF_rgb);
|
||||||
g->DrawLine(
|
g->DrawLine(
|
||||||
screenPos + textPosition + Vec2{ cursorPositionX, cursorPositionY-2 },
|
screenPos + textPosition + Vec2{ cursorPositionX, cursorPositionY-2 },
|
||||||
screenPos + textPosition + Vec2{ cursorPositionX, cursorPositionY+9 },
|
screenPos + textPosition + Vec2{ cursorPositionX, cursorPositionY+9 },
|
||||||
RGB<uint8_t>(255, 255, 255));
|
0xFFFFFF_rgb);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(!text.length())
|
if(!text.length())
|
||||||
{
|
{
|
||||||
g->BlendText(screenPos + textPosition, placeHolder, RGBA<uint8_t>(textColour.Red, textColour.Green, textColour.Blue, 170));
|
g->BlendText(screenPos + textPosition, placeHolder, textColour.NoAlpha().WithAlpha(170));
|
||||||
}
|
}
|
||||||
if(border)
|
if(border)
|
||||||
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(160, 160, 160));
|
g->DrawRect(RectSized(Position, Size), 0xA0A0A0_rgb);
|
||||||
}
|
}
|
||||||
if(Appearance.icon)
|
if(Appearance.icon)
|
||||||
g->draw_icon(screenPos.X+iconPosition.X, screenPos.Y+iconPosition.Y, Appearance.icon);
|
g->draw_icon(screenPos.X+iconPosition.X, screenPos.Y+iconPosition.Y, Appearance.icon);
|
||||||
|
@ -125,7 +125,7 @@ void LoginView::OnDraw()
|
|||||||
{
|
{
|
||||||
Graphics * g = GetGraphics();
|
Graphics * g = GetGraphics();
|
||||||
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
||||||
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(255, 255, 255));
|
g->DrawRect(RectSized(Position, Size), 0xFFFFFF_rgb);
|
||||||
}
|
}
|
||||||
|
|
||||||
LoginView::~LoginView() {
|
LoginView::~LoginView() {
|
||||||
|
@ -46,7 +46,7 @@ OptionsView::OptionsView():
|
|||||||
|
|
||||||
void Draw(const ui::Point& screenPos) override
|
void Draw(const ui::Point& screenPos) override
|
||||||
{
|
{
|
||||||
GetGraphics()->BlendRect(RectSized(screenPos, Size), RGBA<uint8_t>(255, 255, 255, 180));
|
GetGraphics()->BlendRect(RectSized(screenPos, Size), 0xFFFFFF_rgb .WithAlpha(180));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -159,7 +159,7 @@ OptionsView::OptionsView():
|
|||||||
Graphics * g = GetGraphics();
|
Graphics * g = GetGraphics();
|
||||||
|
|
||||||
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
||||||
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(200, 200, 200));
|
g->DrawRect(RectSized(Position, Size), 0xC8C8C8_rgb);
|
||||||
}
|
}
|
||||||
|
|
||||||
ui::DirectionSelector * gravityDirection;
|
ui::DirectionSelector * gravityDirection;
|
||||||
@ -541,7 +541,7 @@ void OptionsView::OnDraw()
|
|||||||
{
|
{
|
||||||
Graphics * g = GetGraphics();
|
Graphics * g = GetGraphics();
|
||||||
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
||||||
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(255, 255, 255));
|
g->DrawRect(RectSized(Position, Size), 0xFFFFFF_rgb);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OptionsView::OnTryExit(ExitMethod method)
|
void OptionsView::OnTryExit(ExitMethod method)
|
||||||
|
@ -263,15 +263,15 @@ void PreviewView::DoDraw()
|
|||||||
g->BlendLine(
|
g->BlendLine(
|
||||||
Position + Vec2{ 1+XRES/2, linePos },
|
Position + Vec2{ 1+XRES/2, linePos },
|
||||||
Position + Vec2{ Size.X-2, linePos },
|
Position + Vec2{ Size.X-2, linePos },
|
||||||
RGBA<uint8_t>(255, 255, 255, 100));
|
0xFFFFFF_rgb .WithAlpha(100));
|
||||||
}
|
}
|
||||||
if (c->GetDoOpen())
|
if (c->GetDoOpen())
|
||||||
{
|
{
|
||||||
g->BlendFilledRect(RectSized(Position + Size / 2 - Vec2{ 101, 26 }, { 202, 52 }), RGBA<uint8_t>(0, 0, 0, 210));
|
g->BlendFilledRect(RectSized(Position + Size / 2 - Vec2{ 101, 26 }, { 202, 52 }), 0x000000_rgb .WithAlpha(210));
|
||||||
g->BlendRect(RectSized(Position + Size / 2 - Vec2{ 100, 25 }, Vec2{ 200, 50 }), RGBA<uint8_t>(255, 255, 255, 180));
|
g->BlendRect(RectSized(Position + Size / 2 - Vec2{ 100, 25 }, Vec2{ 200, 50 }), 0xFFFFFF_rgb .WithAlpha(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->BlendText(Position + Vec2{(Size.X/2)-((Graphics::TextSize("Loading save...").X - 1)/2), (Size.Y/2)-5}, "Loading save...", style::Colour::InformationTitle.NoAlpha().WithAlpha(255));
|
||||||
}
|
}
|
||||||
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(255, 255, 255));
|
g->DrawRect(RectSized(Position, Size), 0xFFFFFF_rgb);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -287,8 +287,8 @@ void PreviewView::OnDraw()
|
|||||||
{
|
{
|
||||||
g->BlendImage(savePreview->Data(), 0xFF, RectSized(Position + Vec2(1, 1) + (RES / 2 - savePreview->Size()) / 2, savePreview->Size()));
|
g->BlendImage(savePreview->Data(), 0xFF, RectSized(Position + Vec2(1, 1) + (RES / 2 - savePreview->Size()) / 2, savePreview->Size()));
|
||||||
}
|
}
|
||||||
g->BlendRect(RectSized(Position, RES / 2 + Vec2{ 1, 1 }), RGBA<uint8_t>(255, 255, 255, 100));
|
g->BlendRect(RectSized(Position, RES / 2 + Vec2{ 1, 1 }), 0xFFFFFF_rgb .WithAlpha(100));
|
||||||
g->DrawLine(Position + Vec2{ XRES/2, 1 }, Position + Vec2{ XRES/2, Size.Y-2 }, RGB<uint8_t>(200, 200, 200));
|
g->DrawLine(Position + Vec2{ XRES/2, 1 }, Position + Vec2{ XRES/2, Size.Y-2 }, 0xC8C8C8_rgb);
|
||||||
|
|
||||||
if(votesUp || votesDown)
|
if(votesUp || votesDown)
|
||||||
{
|
{
|
||||||
@ -312,13 +312,13 @@ void PreviewView::OnDraw()
|
|||||||
nyu = nyu>50?50:nyu;
|
nyu = nyu>50?50:nyu;
|
||||||
nyd = nyd>50?50:nyd;
|
nyd = nyd>50?50:nyd;
|
||||||
|
|
||||||
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, 3 }, Vec2{ 53, 7 }), 0x006B0A_rgb);
|
||||||
g->DrawFilledRect(RectSized(Position + RES / 2 + Vec2{ -55, 9 }, Vec2{ 53, 7 }), RGB<uint8_t>(107, 10, 0));
|
g->DrawFilledRect(RectSized(Position + RES / 2 + Vec2{ -55, 9 }, Vec2{ 53, 7 }), 0x6B0A00_rgb);
|
||||||
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)+3 }, { 53, 7 }), 0x808080_rgb);
|
||||||
g->DrawRect(RectSized(Position + Vec2{ (XRES/2)-55, (YRES/2)+9 }, { 53, 7 }), RGB<uint8_t>(128, 128, 128));
|
g->DrawRect(RectSized(Position + Vec2{ (XRES/2)-55, (YRES/2)+9 }, { 53, 7 }), 0x808080_rgb);
|
||||||
|
|
||||||
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-nyu, 5 }, Vec2{ nyu, 3 }), 0x39BB39_rgb);
|
||||||
g->DrawFilledRect(RectSized(Position + RES / 2 + Vec2{ -4-nyd, 11 }, Vec2{ nyd, 3 }), RGB<uint8_t>(187, 57, 57));
|
g->DrawFilledRect(RectSized(Position + RES / 2 + Vec2{ -4-nyd, 11 }, Vec2{ nyd, 3 }), 0xBB3939_rgb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,7 +233,7 @@ void ProfileActivity::OnDraw()
|
|||||||
{
|
{
|
||||||
Graphics * g = GetGraphics();
|
Graphics * g = GetGraphics();
|
||||||
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
||||||
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(255, 255, 255));
|
g->DrawRect(RectSized(Position, Size), 0xFFFFFF_rgb);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProfileActivity::OnTryExit(ExitMethod method)
|
void ProfileActivity::OnTryExit(ExitMethod method)
|
||||||
|
@ -162,15 +162,15 @@ void RenderView::OnDraw()
|
|||||||
ren->RenderBegin();
|
ren->RenderBegin();
|
||||||
ren->RenderEnd();
|
ren->RenderEnd();
|
||||||
}
|
}
|
||||||
g->DrawLine({ 0, YRES }, { XRES-1, YRES }, RGB<uint8_t>(200, 200, 200));
|
g->DrawLine({ 0, YRES }, { XRES-1, YRES }, 0xC8C8C8_rgb);
|
||||||
g->DrawLine({ line1, YRES }, { line1, WINDOWH }, RGB<uint8_t>(200, 200, 200));
|
g->DrawLine({ line1, YRES }, { line1, WINDOWH }, 0xC8C8C8_rgb);
|
||||||
g->DrawLine({ line2, YRES }, { line2, WINDOWH }, RGB<uint8_t>(200, 200, 200));
|
g->DrawLine({ line2, YRES }, { line2, WINDOWH }, 0xC8C8C8_rgb);
|
||||||
g->DrawLine({ line3, YRES }, { line3, WINDOWH }, RGB<uint8_t>(200, 200, 200));
|
g->DrawLine({ line3, YRES }, { line3, WINDOWH }, 0xC8C8C8_rgb);
|
||||||
g->DrawLine({ line4, YRES }, { line4, WINDOWH }, RGB<uint8_t>(200, 200, 200));
|
g->DrawLine({ line4, YRES }, { line4, WINDOWH }, 0xC8C8C8_rgb);
|
||||||
g->DrawLine({ XRES, 0 }, { XRES, WINDOWH }, RGB<uint8_t>(255, 255, 255));
|
g->DrawLine({ XRES, 0 }, { XRES, WINDOWH }, 0xFFFFFF_rgb);
|
||||||
if(toolTipPresence && toolTip.length())
|
if(toolTipPresence && toolTip.length())
|
||||||
{
|
{
|
||||||
g->BlendText({ 6, Size.Y-MENUSIZE-12 }, toolTip, RGBA<uint8_t>(255, 255, 255, toolTipPresence>51?255:toolTipPresence*5));
|
g->BlendText({ 6, Size.Y-MENUSIZE-12 }, toolTip, 0xFFFFFF_rgb .WithAlpha(toolTipPresence>51?255:toolTipPresence*5));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -206,7 +206,7 @@ void SearchController::OpenSave(int saveID)
|
|||||||
{
|
{
|
||||||
delete activePreview;
|
delete activePreview;
|
||||||
Graphics * g = searchView->GetGraphics();
|
Graphics * g = searchView->GetGraphics();
|
||||||
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
|
g->BlendFilledRect(RectSized(Vec2{ XRES/3, WINDOWH-20 }, Vec2{ XRES/3, 20 }), 0x000000_rgb .WithAlpha(150)); //dim the "Page X of Y" a little to make the CopyTextButton more noticeable
|
||||||
activePreview = new PreviewController(saveID, 0, instantOpen, [this] { OpenSaveDone(); });
|
activePreview = new PreviewController(saveID, 0, instantOpen, [this] { OpenSaveDone(); });
|
||||||
activePreview->GetView()->MakeActiveWindow();
|
activePreview->GetView()->MakeActiveWindow();
|
||||||
}
|
}
|
||||||
@ -215,7 +215,7 @@ void SearchController::OpenSave(int saveID, int saveDate)
|
|||||||
{
|
{
|
||||||
delete activePreview;
|
delete activePreview;
|
||||||
Graphics * g = searchView->GetGraphics();
|
Graphics * g = searchView->GetGraphics();
|
||||||
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
|
g->BlendFilledRect(RectSized(Vec2{ XRES/3, WINDOWH-20 }, Vec2{ XRES/3, 20 }), 0x000000_rgb .WithAlpha(150)); //dim the "Page X of Y" a little to make the CopyTextButton more noticeable
|
||||||
activePreview = new PreviewController(saveID, saveDate, instantOpen, [this] { OpenSaveDone(); });
|
activePreview = new PreviewController(saveID, saveDate, instantOpen, [this] { OpenSaveDone(); });
|
||||||
activePreview->GetView()->MakeActiveWindow();
|
activePreview->GetView()->MakeActiveWindow();
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ void TagsView::OnDraw()
|
|||||||
{
|
{
|
||||||
Graphics * g = GetGraphics();
|
Graphics * g = GetGraphics();
|
||||||
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
||||||
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(255, 255, 255));
|
g->DrawRect(RectSized(Position, Size), 0xFFFFFF_rgb);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TagsView::NotifyTagsChanged(TagsModel * sender)
|
void TagsView::NotifyTagsChanged(TagsModel * sender)
|
||||||
|
@ -81,7 +81,7 @@ LuaWindow::LuaWindow(lua_State * l) :
|
|||||||
{
|
{
|
||||||
Graphics * g = ui::Engine::Ref().g;
|
Graphics * g = ui::Engine::Ref().g;
|
||||||
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
||||||
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(255, 255, 255));
|
g->DrawRect(RectSized(Position, Size), 0xFFFFFF_rgb);
|
||||||
luaWindow->triggerOnDraw();
|
luaWindow->triggerOnDraw();
|
||||||
}
|
}
|
||||||
void OnInitialized() override { luaWindow->triggerOnInitialized(); }
|
void OnInitialized() override { luaWindow->triggerOnInitialized(); }
|
||||||
|
@ -87,9 +87,9 @@ void TaskWindow::OnDraw()
|
|||||||
{
|
{
|
||||||
Graphics * g = GetGraphics();
|
Graphics * g = GetGraphics();
|
||||||
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb);
|
||||||
g->DrawRect(RectSized(Position, Size), RGB<uint8_t>(255, 255, 255));
|
g->DrawRect(RectSized(Position, Size), 0xFFFFFF_rgb);
|
||||||
|
|
||||||
g->DrawLine(Position + Vec2{ 0, Size.Y-17 }, Position + Vec2{ Size.X - 1, Size.Y-17 }, RGB<uint8_t>(255, 255, 255));
|
g->DrawLine(Position + Vec2{ 0, Size.Y-17 }, Position + Vec2{ Size.X - 1, Size.Y-17 }, 0xFFFFFF_rgb);
|
||||||
|
|
||||||
ui::Colour progressBarColour = style::Colour::WarningTitle;
|
ui::Colour progressBarColour = style::Colour::WarningTitle;
|
||||||
|
|
||||||
@ -117,7 +117,7 @@ void TaskWindow::OnDraw()
|
|||||||
g->DrawFilledRect(RectSized(Position + Vec2{ 2, Size.Y-15 }, Vec2{ rsize, 13 }), progressBarColour.NoAlpha());
|
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));
|
g->BlendText(Position + Vec2{ ((Size.X-(Graphics::TextSize(progressStatus).X - 1))/2), Size.Y-13 }, progressStatus, progress<50 ? 0xFFFFFF_rgb .WithAlpha(255) : 0x000000_rgb .WithAlpha(255));
|
||||||
}
|
}
|
||||||
|
|
||||||
TaskWindow::~TaskWindow() {
|
TaskWindow::~TaskWindow() {
|
||||||
|
Loading…
Reference in New Issue
Block a user