diff options
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 8eb5746948..1ab15dcda3 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 4b16637143..20993c6419 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(); |