diff options
Diffstat (limited to 'platform/windows')
-rw-r--r-- | platform/windows/context_gl_win.h | 4 | ||||
-rw-r--r-- | platform/windows/crash_handler_win.cpp | 2 | ||||
-rw-r--r-- | platform/windows/detect.py | 4 | ||||
-rw-r--r-- | platform/windows/export/export.cpp | 4 | ||||
-rw-r--r-- | platform/windows/key_mapping_win.cpp | 2 | ||||
-rw-r--r-- | platform/windows/key_mapping_win.h | 2 | ||||
-rw-r--r-- | platform/windows/os_windows.cpp | 26 | ||||
-rw-r--r-- | platform/windows/os_windows.h | 6 | ||||
-rw-r--r-- | platform/windows/power_windows.h | 6 | ||||
-rw-r--r-- | platform/windows/windows_terminal_logger.h | 4 |
10 files changed, 32 insertions, 28 deletions
diff --git a/platform/windows/context_gl_win.h b/platform/windows/context_gl_win.h index e7578a1aeb..af2f89568e 100644 --- a/platform/windows/context_gl_win.h +++ b/platform/windows/context_gl_win.h @@ -35,9 +35,9 @@ #ifndef CONTEXT_GL_WIN_H #define CONTEXT_GL_WIN_H +#include "core/error_list.h" +#include "core/os/os.h" #include "drivers/gl_context/context_gl.h" -#include "error_list.h" -#include "os/os.h" #include <windows.h> diff --git a/platform/windows/crash_handler_win.cpp b/platform/windows/crash_handler_win.cpp index 76a227c608..2760e87b8b 100644 --- a/platform/windows/crash_handler_win.cpp +++ b/platform/windows/crash_handler_win.cpp @@ -28,9 +28,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ +#include "core/project_settings.h" #include "main/main.h" #include "os_windows.h" -#include "project_settings.h" #ifdef CRASH_HANDLER_EXCEPTION diff --git a/platform/windows/detect.py b/platform/windows/detect.py index 150d418502..5d5af17086 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -208,8 +208,8 @@ def configure_msvc(env, manual_msvc_config): 'RTAUDIO_ENABLED', 'WASAPI_ENABLED', 'WINMIDI_ENABLED', 'TYPED_METHOD_BIND', 'WIN32', 'MSVC', - {'WINVER' : '$target_win_version', - '_WIN32_WINNT': '$target_win_version'}]) + 'WINVER=$target_win_version', + '_WIN32_WINNT=$target_win_version']) env.AppendUnique(CPPDEFINES=['NOMINMAX']) # disable bogus min/max WinDef.h macros if env["bits"] == "64": env.AppendUnique(CPPDEFINES=['_WIN64']) diff --git a/platform/windows/export/export.cpp b/platform/windows/export/export.cpp index 38fd6366c7..dcaae40b10 100644 --- a/platform/windows/export/export.cpp +++ b/platform/windows/export/export.cpp @@ -28,10 +28,10 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ +#include "core/os/file_access.h" +#include "core/os/os.h" #include "editor/editor_export.h" #include "editor/editor_settings.h" -#include "os/file_access.h" -#include "os/os.h" #include "platform/windows/logo.gen.h" class EditorExportPlatformWindows : public EditorExportPlatformPC { diff --git a/platform/windows/key_mapping_win.cpp b/platform/windows/key_mapping_win.cpp index 69dd385354..80580a63b3 100644 --- a/platform/windows/key_mapping_win.cpp +++ b/platform/windows/key_mapping_win.cpp @@ -212,7 +212,7 @@ static _WinTranslatePair _vk_to_keycode[] = { { KEY_SEMICOLON, VK_OEM_1 }, // (0xBA) { KEY_EQUAL, VK_OEM_PLUS }, // (0xBB) // Windows 2000/XP: For any country/region, the '+' key - { KEY_COLON, VK_OEM_COMMA }, // (0xBC) // Windows 2000/XP: For any country/region, the ',' key + { KEY_COMMA, VK_OEM_COMMA }, // (0xBC) // Windows 2000/XP: For any country/region, the ',' key { KEY_MINUS, VK_OEM_MINUS }, // (0xBD) // Windows 2000/XP: For any country/region, the '-' key { KEY_PERIOD, VK_OEM_PERIOD }, // (0xBE) // Windows 2000/XP: For any country/region, the '.' key { KEY_SLASH, VK_OEM_2 }, // (0xBF) //Windows 2000/XP: For the US standard keyboard, the '/?' key diff --git a/platform/windows/key_mapping_win.h b/platform/windows/key_mapping_win.h index 8d6461f27d..340f916e1c 100644 --- a/platform/windows/key_mapping_win.h +++ b/platform/windows/key_mapping_win.h @@ -31,7 +31,7 @@ #ifndef KEY_MAPPING_WINDOWS_H #define KEY_MAPPING_WINDOWS_H -#include "os/keyboard.h" +#include "core/os/keyboard.h" #include <windows.h> diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 88793386ab..6723210432 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -28,27 +28,27 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ +// Must include Winsock before windows.h (included by os_windows.h) +#include "drivers/unix/net_socket_posix.h" + #include "os_windows.h" +#include "core/io/marshalls.h" +#include "core/version_generated.gen.h" #include "drivers/gles2/rasterizer_gles2.h" #include "drivers/gles3/rasterizer_gles3.h" #include "drivers/windows/dir_access_windows.h" #include "drivers/windows/file_access_windows.h" #include "drivers/windows/mutex_windows.h" -#include "drivers/windows/packet_peer_udp_winsock.h" #include "drivers/windows/rw_lock_windows.h" #include "drivers/windows/semaphore_windows.h" -#include "drivers/windows/stream_peer_tcp_winsock.h" -#include "drivers/windows/tcp_server_winsock.h" #include "drivers/windows/thread_windows.h" -#include "io/marshalls.h" #include "joypad.h" #include "lang_table.h" #include "main/main.h" #include "servers/audio_server.h" #include "servers/visual/visual_server_raster.h" #include "servers/visual/visual_server_wrap_mt.h" -#include "version_generated.gen.h" #include "windows_terminal_logger.h" #include <process.h> @@ -219,9 +219,7 @@ void OS_Windows::initialize_core() { DirAccess::make_default<DirAccessWindows>(DirAccess::ACCESS_USERDATA); DirAccess::make_default<DirAccessWindows>(DirAccess::ACCESS_FILESYSTEM); - TCPServerWinsock::make_default(); - StreamPeerTCPWinsock::make_default(); - PacketPeerUDPWinsock::make_default(); + NetSocketPosix::make_default(); // We need to know how often the clock is updated if (!QueryPerformanceFrequency((LARGE_INTEGER *)&ticks_per_second)) @@ -1514,9 +1512,6 @@ void OS_Windows::finalize_core() { timeEndPeriod(1); memdelete(process_map); - - TCPServerWinsock::cleanup(); - StreamPeerTCPWinsock::cleanup(); } void OS_Windows::alert(const String &p_alert, const String &p_title) { @@ -1711,6 +1706,15 @@ void OS_Windows::set_window_position(const Point2 &p_position) { RECT r; GetWindowRect(hWnd, &r); MoveWindow(hWnd, p_position.x, p_position.y, r.right - r.left, r.bottom - r.top, TRUE); + + // Don't let the mouse leave the window when moved + if (mouse_mode == MOUSE_MODE_CONFINED) { + RECT rect; + GetClientRect(hWnd, &rect); + ClientToScreen(hWnd, (POINT *)&rect.left); + ClientToScreen(hWnd, (POINT *)&rect.right); + ClipCursor(&rect); + } } Size2 OS_Windows::get_window_size() const { diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index c9fa46052a..01e1c51ca5 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -31,13 +31,13 @@ #ifndef OS_WINDOWS_H #define OS_WINDOWS_H #include "context_gl_win.h" +#include "core/os/input.h" +#include "core/os/os.h" #include "core/project_settings.h" #include "crash_handler_win.h" #include "drivers/rtaudio/audio_driver_rtaudio.h" #include "drivers/wasapi/audio_driver_wasapi.h" #include "drivers/winmidi/win_midi.h" -#include "os/input.h" -#include "os/os.h" #include "power_windows.h" #include "servers/audio_server.h" #include "servers/visual/rasterizer.h" @@ -157,7 +157,7 @@ class OS_Windows : public OS { void _update_window_style(bool repaint = true); - // functions used by main to initialize/deintialize the OS + // functions used by main to initialize/deinitialize the OS protected: virtual int get_current_video_driver() const; diff --git a/platform/windows/power_windows.h b/platform/windows/power_windows.h index 1c1a8c0876..4984b473ca 100644 --- a/platform/windows/power_windows.h +++ b/platform/windows/power_windows.h @@ -31,9 +31,9 @@ #ifndef PLATFORM_WINDOWS_POWER_WINDOWS_H_ #define PLATFORM_WINDOWS_POWER_WINDOWS_H_ -#include "os/dir_access.h" -#include "os/file_access.h" -#include "os/os.h" +#include "core/os/dir_access.h" +#include "core/os/file_access.h" +#include "core/os/os.h" #include <windows.h> diff --git a/platform/windows/windows_terminal_logger.h b/platform/windows/windows_terminal_logger.h index 1ad2bcb0fd..1cd1941b8a 100644 --- a/platform/windows/windows_terminal_logger.h +++ b/platform/windows/windows_terminal_logger.h @@ -33,7 +33,7 @@ #ifdef WINDOWS_ENABLED -#include "io/logger.h" +#include "core/io/logger.h" class WindowsTerminalLogger : public StdLogger { public: @@ -44,4 +44,4 @@ public: #endif -#endif
\ No newline at end of file +#endif |