Introduce corner frames
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
#pragma once
|
||||
#include <PSX/GPU/gpu.hpp>
|
||||
#include <PSX/GPU/make_gpu_primitives.hpp>
|
||||
|
||||
namespace ScreenCenter {
|
||||
using namespace JabyEngine;
|
||||
|
||||
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];
|
||||
|
||||
public:
|
||||
static constexpr Frame::Linked create() {
|
||||
constexpr auto BaseColor = GPU::Color24::from_rgb(0x1D, 0xA0, 0xA3);
|
||||
constexpr auto Size = Make::SizeI16(64, 16);
|
||||
|
||||
Frame frame;
|
||||
|
||||
frame.top_left[0] = Make::TILE(Make::AreaI16(0, 0, Size.width, Size.height), BaseColor);
|
||||
frame.top_left[1] = Make::TILE(Make::AreaI16(0, 0, Size.height, Size.width), BaseColor);
|
||||
|
||||
frame.top_right[0] = Make::TILE(Make::AreaI16(GPU::Display::Width - Size.width, 0, Size.width, Size.height), BaseColor);
|
||||
frame.top_right[1] = Make::TILE(Make::AreaI16(GPU::Display::Width - Size.height, 0, Size.height, Size.width), BaseColor);
|
||||
|
||||
frame.bottom_left[0] = Make::TILE(Make::AreaI16(0, GPU::Display::Height - Size.width, Size.height, Size.width), BaseColor);
|
||||
frame.bottom_left[1] = Make::TILE(Make::AreaI16(0, GPU::Display::Height - Size.height, Size.width, Size.height), BaseColor);
|
||||
|
||||
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);
|
||||
return frame.linked();
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user