feat(glue): set up cursor image from CGlueMgr

This commit is contained in:
superp00t 2024-09-06 12:26:04 -04:00
parent dd7dee7232
commit 671fd73fd3
2 changed files with 20 additions and 1 deletions

View File

@ -48,6 +48,7 @@ char CGlueMgr::m_accountName[1280];
float CGlueMgr::m_aspect;
bool CGlueMgr::m_authenticated;
char CGlueMgr::m_currentScreen[64];
MipBits* CGlueMgr::m_cursorMipBits;
int32_t CGlueMgr::m_disconnectPending;
int32_t CGlueMgr::m_displayingQueueDialog;
CGlueMgr::GLUE_IDLE_STATE CGlueMgr::m_idleState;
@ -469,6 +470,20 @@ void CGlueMgr::PollLoginServerLogin() {
}
}
void CGlueMgr::InitCursor() {
uint32_t width;
uint32_t height;
PIXEL_FORMAT format = PIXEL_ARGB8888;
CGlueMgr::m_cursorMipBits = TextureLoadImage("Interface\\Cursor\\Point.blp", &width, &height, &format, nullptr, nullptr, nullptr, 0);
STORM_ASSERT(width == 32);
STORM_ASSERT(height == 32);
STORM_ASSERT(format == PIXEL_ARGB8888);
CGlueMgr::m_simpleTop->SetCursor(CGlueMgr::m_cursorMipBits);
}
void CGlueMgr::Resume() {
// TODO
// CGlueMgr::m_disconnectPending = 0;
@ -497,8 +512,9 @@ void CGlueMgr::Resume() {
CGlueMgr::m_simpleTop = top;
CGlueMgr::m_simpleTop->m_displaySizeCallback = &CGlueMgr::HandleDisplaySizeChanged;
CGlueMgr::InitCursor();
// TODO
// - setting cursor texture
// - setting mouse mode
FrameScript_Flush();

View File

@ -3,6 +3,7 @@
#include "event/Event.hpp"
#include "net/Types.hpp"
#include "gx/Texture.hpp"
#include <cstdint>
class CSimpleTop;
@ -36,6 +37,7 @@ class CGlueMgr {
static float m_aspect;
static bool m_authenticated;
static char m_currentScreen[];
static MipBits* m_cursorMipBits;
static int32_t m_disconnectPending;
static int32_t m_displayingQueueDialog;
static GLUE_IDLE_STATE m_idleState;
@ -61,6 +63,7 @@ class CGlueMgr {
static int32_t HandleDisplaySizeChanged(const CSizeEvent& event);
static int32_t Idle(const void* a1, void* a2);
static void Initialize();
static void InitCursor();
static void LoginServerLogin(const char* accountName, const char* password);
static void QuitGame();
static void PollAccountLogin(int32_t errorCode, const char* msg, int32_t complete, int32_t result, WOWCS_OPS op);