summaryrefslogtreecommitdiff
path: root/platform/windows
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-12-02 14:02:41 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-12-02 14:02:41 -0300
commite361e8539c889d3ca66e77ebb5d0ceb61d17f49d (patch)
treee34bb70d58e8d023df34c3e6744b5cdfa866ef7d /platform/windows
parent9d5a2cb8470d538fa33f9f7b4d6cdd5390b3b70b (diff)
-Ability to ask for documents/pictures/etc system dirs.
-Fixes to animationplayer -fixes to collada importer
Diffstat (limited to 'platform/windows')
-rw-r--r--platform/windows/os_windows.cpp42
-rw-r--r--platform/windows/os_windows.h2
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();