summaryrefslogtreecommitdiff
path: root/platform/windows
diff options
context:
space:
mode:
Diffstat (limited to 'platform/windows')
-rw-r--r--platform/windows/os_windows.cpp7
-rw-r--r--platform/windows/packet_peer_udp_winsock.cpp2
-rw-r--r--platform/windows/power_windows.cpp25
3 files changed, 32 insertions, 2 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 99b6890913..9dee2da21e 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -509,10 +509,13 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
if (!motion)
return 0;
- if (motion < 0)
+ if (motion < 0) {
mb.button_index = BUTTON_WHEEL_LEFT;
- else
+ mb.factor = fabs((double)motion / (double)WHEEL_DELTA);
+ } else {
mb.button_index = BUTTON_WHEEL_RIGHT;
+ mb.factor = fabs((double)motion / (double)WHEEL_DELTA);
+ }
} break;
/*
case WM_XBUTTONDOWN: {
diff --git a/platform/windows/packet_peer_udp_winsock.cpp b/platform/windows/packet_peer_udp_winsock.cpp
index f69c0bd2ed..f3b91c1b56 100644
--- a/platform/windows/packet_peer_udp_winsock.cpp
+++ b/platform/windows/packet_peer_udp_winsock.cpp
@@ -203,6 +203,8 @@ Error PacketPeerUDPWinsock::_poll(bool p_wait) {
len = sizeof(struct sockaddr_storage);
++queue_count;
+ if (p_wait)
+ break;
};
if (ret == SOCKET_ERROR) {
diff --git a/platform/windows/power_windows.cpp b/platform/windows/power_windows.cpp
index 1d9756f68b..428bc5dcc2 100644
--- a/platform/windows/power_windows.cpp
+++ b/platform/windows/power_windows.cpp
@@ -28,6 +28,31 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+/*
+Adapted from corresponding SDL 2.0 code.
+*/
+
+/*
+ Simple DirectMedia Layer
+ Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+*/
+
#include "power_windows.h"
// CODE CHUNK IMPORTED FROM SDL 2.0