diff --git a/Source/Client/Browser/BrowserCursor.cpp b/Source/Client/Browser/BrowserCursor.cpp index d87e18fd3..2ace5cc91 100644 --- a/Source/Client/Browser/BrowserCursor.cpp +++ b/Source/Client/Browser/BrowserCursor.cpp @@ -1,39 +1,3 @@ #include "Client/Application/ApplicationWindow.h" #include "Client/Browser/WebBrowser.h" #include "Client/Input/Mouse.h" - -// OFFSET: 0x00AB32E0 -// FUNCTION: fn_45439 -void CWebBrowser::SetCursorState(int value) { - if (this->cursorState == value) { - return; - } - - if (value != 0) { - SetCursor(LoadCursorA(nullptr, reinterpret_cast(IDC_ARROW))); - - g_mouse.Center(); - g_mouse.SetX(-100); - g_mouse.SetY(-100); - } else { - SetCursor(nullptr); - } - - g_mouse.Reset(); - ShowCursor(value); - this->cursorState = value; -} - -// OFFSET: 0x00AB3230 -// FUNCTION: fn_45438 -void CWebBrowser::PollCursor() { - POINT point; - GetCursorPos(&point); - if (hWnd != WindowFromPoint(point)) { - if (this->cursorState != 1) { - this->SetCursorState(1); - } - } else if (this->cursorState != 0) { - this->SetCursorState(0); - } -} diff --git a/Source/Client/Browser/BrowserFrame.cpp b/Source/Client/Browser/BrowserFrame.cpp index 09844183f..c80a2850d 100644 --- a/Source/Client/Browser/BrowserFrame.cpp +++ b/Source/Client/Browser/BrowserFrame.cpp @@ -1,4 +1,19 @@ +#include "Client/Application/ApplicationWindow.h" #include "Client/Browser/WebBrowser.h" +#include "Client/Input/Mouse.h" + +// OFFSET: 0x00AB2260 +// FUNCTION: fn_45430 +void CWebBrowser::RefreshSize() { + long width = 0; + long height = 0; + this->browser->get_Width(&width); + this->browser->get_Height(&height); + + if (this->width != width || this->height != height) { + this->Resize(this->width, this->height); + } +} // OFFSET: 0x00AB2610 // FUNCTION: fn_17414 @@ -34,3 +49,39 @@ void CWebBrowser::Poll() { this->RefreshSize(); this->PollCursor(); } + +// OFFSET: 0x00AB3230 +// FUNCTION: fn_45438 +void CWebBrowser::PollCursor() { + POINT point; + GetCursorPos(&point); + if (hWnd != WindowFromPoint(point)) { + if (this->cursorState != 1) { + this->SetCursorState(1); + } + } else if (this->cursorState != 0) { + this->SetCursorState(0); + } +} + +// OFFSET: 0x00AB32E0 +// FUNCTION: fn_45439 +void CWebBrowser::SetCursorState(int value) { + if (this->cursorState == value) { + return; + } + + if (value != 0) { + SetCursor(LoadCursorA(nullptr, reinterpret_cast(IDC_ARROW))); + + g_mouse.Center(); + g_mouse.SetX(-100); + g_mouse.SetY(-100); + } else { + SetCursor(nullptr); + } + + g_mouse.Reset(); + ShowCursor(value); + this->cursorState = value; +} diff --git a/Source/Client/Browser/BrowserWindowSizing.cpp b/Source/Client/Browser/BrowserWindowSizing.cpp index 969c5f2ab..f54441253 100644 --- a/Source/Client/Browser/BrowserWindowSizing.cpp +++ b/Source/Client/Browser/BrowserWindowSizing.cpp @@ -26,19 +26,6 @@ void CWebBrowser::Resize(int requestedWidth, int requestedHeight) { } } -// OFFSET: 0x00AB2260 -// FUNCTION: fn_45430 -void CWebBrowser::RefreshSize() { - long width = 0; - long height = 0; - this->browser->get_Width(&width); - this->browser->get_Height(&height); - - if (this->width != width || this->height != height) { - this->Resize(this->width, this->height); - } -} - // INLINED int CWebBrowser::AuxiliaryHeight() { if (this->rebar && this->auxiliaryVisible != 0) { diff --git a/Source/Client/Browser/WebBrowser.h b/Source/Client/Browser/WebBrowser.h index f50e4e9e5..a22aae078 100644 --- a/Source/Client/Browser/WebBrowser.h +++ b/Source/Client/Browser/WebBrowser.h @@ -25,7 +25,7 @@ public: bool AttachSite(); void DetachSite(); bool CreateAddressBar(int width, int height); - void Resize(int width, int height); + __declspec(noinline) void Resize(int width, int height); void RefreshSize(); int AuxiliaryHeight(); void Normalize();