feat(ui): CSimpleTop::SetCursor

This commit is contained in:
phaneron 2024-09-06 12:27:55 -04:00
parent 671fd73fd3
commit 4c6f78eda4
2 changed files with 11 additions and 0 deletions

View file

@ -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);