mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-04-09 23:06:47 +03:00
feat(ui): CSimpleTop::SetCursor
This commit is contained in:
parent
671fd73fd3
commit
4c6f78eda4
@ -8,6 +8,7 @@
|
||||
#include "ui/CSimpleRender.hpp"
|
||||
#include "ui/CSimpleTexture.hpp"
|
||||
#include "ui/CSimpleTitleRegion.hpp"
|
||||
#include "cursor/Cursor.hpp"
|
||||
#include <cstring>
|
||||
#include <tempest/Math.hpp>
|
||||
|
||||
@ -515,6 +516,15 @@ void CSimpleTop::RegisterFrame(CSimpleFrame* frame) {
|
||||
this->m_frames.LinkToTail(frame);
|
||||
}
|
||||
|
||||
void CSimpleTop::SetCursor(MipBits* image) {
|
||||
if (image) {
|
||||
auto cursor = g_theGxDevicePtr->CursorLock();
|
||||
memcpy(cursor, image->mip[0], CURSOR_IMAGE_BYTES);
|
||||
g_theGxDevicePtr->CursorUnlock(0, 0);
|
||||
g_theGxDevicePtr->CursorSetVisible(1);
|
||||
}
|
||||
}
|
||||
|
||||
void CSimpleTop::ShowFrame(CSimpleFrame* frame, int32_t a3) {
|
||||
this->m_strata[frame->m_strata]->AddFrame(frame);
|
||||
frame->RegisterForEvents(a3);
|
||||
|
@ -74,6 +74,7 @@ class CSimpleTop : public CLayoutFrame {
|
||||
int32_t RaiseFrame(CSimpleFrame* frame, int32_t checkOcclusion);
|
||||
void RegisterForEvent(CSimpleFrame* frame, CSimpleEventType event, int32_t a4, uint32_t priority);
|
||||
void RegisterFrame(CSimpleFrame* frame);
|
||||
void SetCursor(MipBits* cursorImage);
|
||||
void ShowFrame(CSimpleFrame* frame, int32_t a3);
|
||||
int32_t StartMoveOrResizeFrame(const CMouseEvent& start, MOVERESIZE_REASON reason, int32_t resize);
|
||||
int32_t StartMoveOrResizeFrame(CSimpleFrame* frame, MOVERESIZE_REASON reason, float startx, float starty, int32_t a6);
|
||||
|
Loading…
Reference in New Issue
Block a user