Improve usage of Line types

This commit is contained in:
2024-01-05 22:56:44 -06:00
parent 1f38bd9f68
commit 9c6778d497
3 changed files with 45 additions and 8 deletions

View File

@@ -7,10 +7,12 @@ namespace ScreenCenter {
class Frame : public GPU::internal::LinkedElementCreator<Frame> {
private:
GPU::TILE top_left[2];
GPU::TILE top_right[2];
GPU::TILE bottom_left[2];
GPU::TILE bottom_right[2];
GPU::TILE top_left[2];
GPU::TILE top_right[2];
GPU::TILE bottom_left[2];
GPU::TILE bottom_right[2];
GPU::LINE_G_MULTI<5> border;
GPU::LINE_G_SINGLE cross[2];
public:
static constexpr Frame::Linked create() {
@@ -30,6 +32,17 @@ namespace ScreenCenter {
frame.bottom_right[0] = Make::TILE(Make::AreaI16(GPU::Display::Width - Size.height, GPU::Display::Height - Size.width, Size.height, Size.width), BaseColor);
frame.bottom_right[1] = Make::TILE(Make::AreaI16(GPU::Display::Width - Size.width, GPU::Display::Height - Size.height, Size.width, Size.height), BaseColor);
frame.border = Make::LINE_G(
GPU::ColorVertex{GPU::Color24::Red(), Make::Vertex(0, 0)},
GPU::ColorVertex{GPU::Color24::Green(), Make::Vertex(0, GPU::Display::Height - 1)},
GPU::ColorVertex{GPU::Color24::Blue(), Make::Vertex(GPU::Display::Width - 1, GPU::Display::Height - 1)},
GPU::ColorVertex{GPU::Color24::Yellow(), Make::Vertex(GPU::Display::Width - 1, 0)},
GPU::ColorVertex{GPU::Color24::Red(), Make::Vertex(0, 0)}
);
frame.cross[0] = Make::LINE_G(frame.border[0], frame.border[2]);
frame.cross[1] = Make::LINE_G(frame.border[3], frame.border[1]);
return frame.linked();
}
};