From 2fc9fa0c2d99fab3602584997d57ea4fba2f2ce2 Mon Sep 17 00:00:00 2001 From: "Grayson Riffe (Laptop)" Date: Fri, 17 Sep 2021 00:00:11 -0500 Subject: [PATCH] The mouse now starts tracking only when state loading is complete --- NFPackCreator/AssetBuild/base/shaders/gBufferFragment.shader | 0 NFPackCreator/AssetBuild/base/shaders/gBufferVertex.shader | 0 NothinFancy/src/Application.cpp | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 NFPackCreator/AssetBuild/base/shaders/gBufferFragment.shader create mode 100644 NFPackCreator/AssetBuild/base/shaders/gBufferVertex.shader diff --git a/NFPackCreator/AssetBuild/base/shaders/gBufferFragment.shader b/NFPackCreator/AssetBuild/base/shaders/gBufferFragment.shader new file mode 100644 index 0000000..e69de29 diff --git a/NFPackCreator/AssetBuild/base/shaders/gBufferVertex.shader b/NFPackCreator/AssetBuild/base/shaders/gBufferVertex.shader new file mode 100644 index 0000000..e69de29 diff --git a/NothinFancy/src/Application.cpp b/NothinFancy/src/Application.cpp index 7c9be99..8430e1a 100644 --- a/NothinFancy/src/Application.cpp +++ b/NothinFancy/src/Application.cpp @@ -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; }