diff options
| author | Juan Linietsky | 2014-12-02 14:02:41 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2014-12-02 14:02:41 -0300 |
| commit | e361e8539c889d3ca66e77ebb5d0ceb61d17f49d (patch) | |
| tree | e34bb70d58e8d023df34c3e6744b5cdfa866ef7d /platform/windows | |
| parent | 9d5a2cb8470d538fa33f9f7b4d6cdd5390b3b70b (diff) | |
| download | godot-e361e8539c889d3ca66e77ebb5d0ceb61d17f49d.tar.gz godot-e361e8539c889d3ca66e77ebb5d0ceb61d17f49d.tar.zst godot-e361e8539c889d3ca66e77ebb5d0ceb61d17f49d.zip | |
Diffstat (limited to 'platform/windows')
| -rw-r--r-- | platform/windows/os_windows.cpp | 42 | ||||
| -rw-r--r-- | platform/windows/os_windows.h | 2 |
2 files changed, 44 insertions, 0 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 8eb574694..1ab15dcda 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -52,8 +52,11 @@ #include "os/memory_pool_dynamic_prealloc.h" #include "globals.h" #include "io/marshalls.h" + +#include "shlobj.h" static const WORD MAX_CONSOLE_LINES = 1500; + //#define STDOUT_FILE extern HINSTANCE godot_hinstance; @@ -1875,7 +1878,46 @@ MainLoop *OS_Windows::get_main_loop() const { return main_loop; } +String OS_Windows::get_system_dir(SystemDir p_dir) const { + + + int id; + + + + switch(p_dir) { + case SYSTEM_DIR_DESKTOP: { + id=CSIDL_DESKTOPDIRECTORY; + } break; + case SYSTEM_DIR_DCIM: { + id=CSIDL_MYPICTURES; + } break; + case SYSTEM_DIR_DOCUMENTS: { + id=0x000C; + } break; + case SYSTEM_DIR_DOWNLOADS: { + id=0x000C ; + } break; + case SYSTEM_DIR_MOVIES: { + id=CSIDL_MYVIDEO; + } break; + case SYSTEM_DIR_MUSIC: { + id=CSIDL_MYMUSIC; + } break; + case SYSTEM_DIR_PICTURES: { + id=CSIDL_MYPICTURES; + } break; + case SYSTEM_DIR_RINGTONES: { + id=CSIDL_MYMUSIC; + } break; + } + + WCHAR szPath[MAX_PATH]; + HRESULT res = SHGetFolderPathW(NULL,id,NULL,0,szPath); + ERR_FAIL_COND_V(res!=S_OK,String()); + return String(szPath); +} String OS_Windows::get_data_dir() const { String an = Globals::get_singleton()->get("application/name"); diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index 4b1663714..20993c641 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -249,6 +249,8 @@ public: virtual void move_window_to_foreground(); virtual String get_data_dir() const; + virtual String get_system_dir(SystemDir p_dir) const; + virtual void release_rendering_thread(); virtual void make_rendering_thread(); |
