rodecomp/Source/Client/BrowserCursor.cpp
2026-10-24 00:35:19 +00:00

41 lines
1 KiB
C++

#include "Client/BrowserCursor.h"
#include "Client/Mouse.h"
#include "Render/RenderSystemBase.h"
// OFFSET: 0x00AB32E0
// FUNCTION: fn_45439
void BrowserCursor::Set(int value) {
if (this->state == value) {
return;
}
if (value != 0) {
SetCursor(LoadCursorA(nullptr, MAKEINTRESOURCEA(32512)));
// Original mouse centering queries Width then Height before replacing
// both coordinates with -100. Retain these virtual calls and their order.
this->mouse.SetX(static_cast<int>(this->renderSystem.Width()) / 2);
this->mouse.SetY(static_cast<int>(this->renderSystem.Height()) / 2);
this->mouse.SetX(-100);
this->mouse.SetY(-100);
} else {
SetCursor(nullptr);
}
this->mouse.Reset();
ShowCursor(value);
this->state = value;
}
// OFFSET: 0x00AB3230
// FUNCTION: fn_45438
void BrowserCursor::Poll() {
POINT point;
GetCursorPos(&point);
if (WindowFromPoint(point) != this->applicationWindow) {
if (this->state != 1) {
this->Set(1);
}
} else if (this->state != 0) {
this->Set(0);
}
}