The mouse now starts tracking only when state loading is complete

This commit is contained in:
Grayson Riffe (Laptop) 2021-09-17 00:00:11 -05:00
parent 6daa9d8d25
commit 2fc9fa0c2d
3 changed files with 2 additions and 2 deletions

View File

@ -256,7 +256,7 @@ namespace nf {
if (m_mouseY < 0)
m_mouseY = 0;
if (m_trackingMouse) {
if (m_trackingMouse && m_currentState->isRunning()) {
int middleX = m_currentConfig.width / 2;
int middleY = m_currentConfig.height / 2;
m_mouseDiffX += m_mouseX - middleX;
@ -381,7 +381,7 @@ namespace nf {
case WM_SETCURSOR: {
if (LOWORD(lParam) != HTCLIENT)
break;
if (app->m_trackingMouse && LOWORD(lParam) == HTCLIENT && GetFocus() == hWnd) {
if (app->m_trackingMouse && app->m_currentState->isRunning() && LOWORD(lParam) == HTCLIENT && GetFocus() == hWnd) {
SetCursor(NULL);
return 0;
}