diff options
author | Juan Linietsky <reduzio@gmail.com> | 2014-09-19 21:01:41 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2014-09-19 21:01:41 -0300 |
commit | 0a557f3bf50a0ccff444003c5adc8078862e52c7 (patch) | |
tree | 64fef2b54fa65f895239e2384cc8164549099f74 /platform/windows | |
parent | 549d344f0fef5e5748ded69b6a037698ff55f8bc (diff) |
- more fixes on #672 on windows
- added #660, but need help on osx, help please I don't have a mac!
- fixed #667 and #668 (eol detection in comments)
- added #670 (hint when using method without () )
Diffstat (limited to 'platform/windows')
-rw-r--r-- | platform/windows/os_windows.cpp | 16 | ||||
-rw-r--r-- | platform/windows/os_windows.h | 1 |
2 files changed, 16 insertions, 1 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index a12cd67403..78c40c56d9 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -1323,11 +1323,25 @@ void OS_Windows::set_mouse_mode(MouseMode p_mode) { OS_Windows::MouseMode OS_Windows::get_mouse_mode() const{ + return mouse_mode; } +void OS_Windows::warp_mouse_pos(const Point2& p_to) { + + if (p_mode==MOUSE_MODE_CAPTURED) { + + old_x=p_to.x; + old_y=p_to.y; + } else { + + SetCursorPos(p_to.x, p_to.y); + } + +} + Point2 OS_Windows::get_mouse_pos() const { return Point2(old_x, old_y); @@ -1836,7 +1850,7 @@ String OS_Windows::get_data_dir() const { if (has_environment("APPDATA")) { bool use_godot = Globals::get_singleton()->get("application/use_shared_user_dir"); - if (use_godot) + if (!use_godot) return (OS::get_singleton()->get_environment("APPDATA")+"/"+an).replace("\\","/"); else return (OS::get_singleton()->get_environment("APPDATA")+"/Godot/app_userdata/"+an).replace("\\","/"); diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index 1a41b9d77d..433d29a84d 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -209,6 +209,7 @@ public: void set_mouse_mode(MouseMode p_mode); MouseMode get_mouse_mode() const; + virtual void warp_mouse_pos(const Point2& p_to); virtual Point2 get_mouse_pos() const; virtual int get_mouse_button_state() const; virtual void set_window_title(const String& p_title); |