feat(gx): wire up screen regions in OnPaint

This commit is contained in:
fallenoak 2023-03-30 17:11:19 -05:00 committed by GitHub
parent aeade5b085
commit e7780e67fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 40 deletions

@ -1 +1 @@
Subproject commit 3d141195362dc7557d09deab5b25c3647ee4764e
Subproject commit cdd3413a1b8d96ad2e6a89c73686ae8de80221de

View File

@ -43,26 +43,26 @@ int32_t OnPaint(const void* a1, void* a2) {
baseRect.right = 1.0f;
baseRect.top = 1.0f;
SRgnCombineRectf(&rgn.m_handle, &baseRect, 0, 2);
SRgnCombineRectf(rgn.m_handle, &baseRect, nullptr, 2);
layer = Screen::s_zorderlist.Head();
while (layer) {
SRgnGetBoundingRectf(&rgn.m_handle, &layer->visible);
SRgnGetBoundingRectf(rgn.m_handle, &layer->visible);
layer->visible.left = std::max(layer->visible.left, layer->rect.left);
layer->visible.bottom = std::max(layer->visible.bottom, layer->rect.bottom);
layer->visible.right = std::max(layer->visible.right, layer->rect.right);
layer->visible.top = std::max(layer->visible.top, layer->rect.top);
layer->visible.right = std::min(layer->visible.right, layer->rect.right);
layer->visible.top = std::min(layer->visible.top, layer->rect.top);
if (layer->flags & 0x1) {
SRgnCombineRectf(&rgn.m_handle, &layer->rect, 0, 4);
if (!(layer->flags & 0x1)) {
SRgnCombineRectf(rgn.m_handle, &layer->rect, nullptr, 4);
}
layer = layer->zorderlink.Next();
}
SRgnDelete(&rgn.m_handle);
SRgnDelete(rgn.m_handle);
// Save viewport
float minX, maxX, minY, maxY, minZ, maxZ;
@ -218,19 +218,3 @@ void ScrnSetStockFont(SCRNSTOCK stockID, const char* fontTexturePath) {
HTEXTFONT font = TextBlockGenerateFont(fontTexturePath, 0, fontHeight);
Screen::s_stockObjects[stockID] = font;
}
void SRgnCombineRectf(HSRGN* handle, RECTF* rect, void* param, int32_t combinemode) {
// TODO
}
void SRgnCreate(HSRGN* handle, uint32_t reserved) {
// TODO
}
void SRgnDelete(HSRGN* handle) {
// TODO
}
void SRgnGetBoundingRectf(HSRGN* handle, RECTF* rect) {
// TODO
}

View File

@ -4,9 +4,9 @@
#include <cstdint>
#include <common/Handle.hpp>
#include <storm/List.hpp>
#include <storm/Region.hpp>
typedef HOBJECT HLAYER;
typedef HOBJECT HSRGN;
enum SCRNSTOCK {
STOCK_SYSFONT = 0,
@ -14,13 +14,6 @@ enum SCRNSTOCK {
SCRNSTOCKOBJECTS = 2
};
struct RECTF {
float left;
float bottom;
float right;
float top;
};
class CILayer : public CHandleObject {
public:
RECTF rect;
@ -56,12 +49,4 @@ void ScrnLayerCreate(const RECTF*, float, unsigned long, void*, void (*)(void*,
void ScrnSetStockFont(SCRNSTOCK, const char*);
void SRgnCombineRectf(HSRGN*, RECTF*, void*, int32_t);
void SRgnCreate(HSRGN*, uint32_t);
void SRgnDelete(HSRGN*);
void SRgnGetBoundingRectf(HSRGN*, RECTF*);
#endif