diff options
Diffstat (limited to 'platform/windows')
-rw-r--r-- | platform/windows/context_gl_win.cpp | 17 | ||||
-rw-r--r-- | platform/windows/context_gl_win.h | 13 | ||||
-rw-r--r-- | platform/windows/godot_res.rc | 8 | ||||
-rw-r--r-- | platform/windows/os_windows.cpp | 59 | ||||
-rw-r--r-- | platform/windows/os_windows.h | 8 |
5 files changed, 63 insertions, 42 deletions
diff --git a/platform/windows/context_gl_win.cpp b/platform/windows/context_gl_win.cpp index 8571f0dc65..81aa18dd23 100644 --- a/platform/windows/context_gl_win.cpp +++ b/platform/windows/context_gl_win.cpp @@ -27,25 +27,12 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#if defined(OPENGL_ENABLED) || defined(GLES2_ENABLED) - -// -// C++ Implementation: context_gl_x11 -// -// Description: -// -// +#if defined(OPENGL_ENABLED) || defined(GLES_ENABLED) + // Author: Juan Linietsky <reduzio@gmail.com>, (C) 2008 -// -// Copyright: See COPYING file that comes with this distribution -// -// #include "context_gl_win.h" -//#include "drivers/opengl/glwrapper.h" -//#include "ctxgl_procaddr.h" - #define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 #define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 #define WGL_CONTEXT_FLAGS_ARB 0x2094 diff --git a/platform/windows/context_gl_win.h b/platform/windows/context_gl_win.h index 0059cbc311..5a280b0d08 100644 --- a/platform/windows/context_gl_win.h +++ b/platform/windows/context_gl_win.h @@ -27,18 +27,9 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#if defined(OPENGL_ENABLED) || defined(GLES2_ENABLED) -// -// C++ Interface: context_gl_x11 -// -// Description: -// -// +#if defined(OPENGL_ENABLED) || defined(GLES_ENABLED) + // Author: Juan Linietsky <reduzio@gmail.com>, (C) 2008 -// -// Copyright: See COPYING file that comes with this distribution -// -// #ifndef CONTEXT_GL_WIN_H #define CONTEXT_GL_WIN_H diff --git a/platform/windows/godot_res.rc b/platform/windows/godot_res.rc index b86869d316..c535a749c0 100644 --- a/platform/windows/godot_res.rc +++ b/platform/windows/godot_res.rc @@ -23,13 +23,13 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Godot Engine" - VALUE "FileDescription", _MKSTR(VERSION_NAME) " Editor" + VALUE "FileDescription", VERSION_NAME " Editor" VALUE "FileVersion", _MKSTR(VERSION_MAJOR) "." _MKSTR(VERSION_MINOR) "." _MKSTR(VERSION_PATCH) - VALUE "ProductName", _MKSTR(VERSION_NAME) + VALUE "ProductName", VERSION_NAME VALUE "Licence", "MIT" VALUE "LegalCopyright", "Copyright (c) 2007-" _MKSTR(VERSION_YEAR) " Juan Linietsky, Ariel Manzur" - VALUE "Info", "http://www.godotengine.org" - VALUE "ProductVersion", _MKSTR(VERSION_MAJOR) "." _MKSTR(VERSION_MINOR) PATCH_STRING "." _MKSTR(VERSION_REVISION) + VALUE "Info", "https://godotengine.org" + VALUE "ProductVersion", _MKSTR(VERSION_MAJOR) "." _MKSTR(VERSION_MINOR) PATCH_STRING "." VERSION_BUILD END END BLOCK "VarFileInfo" diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 0f62dbb9e8..72d51ad62a 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -47,6 +47,7 @@ #include "servers/visual/visual_server_wrap_mt.h" #include "stream_peer_winsock.h" #include "tcp_server_winsock.h" +#include "version_generated.gen.h" #include "windows_terminal_logger.h" #include <process.h> @@ -143,7 +144,7 @@ int OS_Windows::get_video_driver_count() const { } const char *OS_Windows::get_video_driver_name(int p_driver) const { - return "GLES2"; + return "GLES3"; } int OS_Windows::get_audio_driver_count() const { @@ -1090,7 +1091,7 @@ void OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int //RegisterTouchWindow(hWnd, 0); // Windows 7 - _ensure_data_dir(); + _ensure_user_data_dir(); DragAcceptFiles(hWnd, true); @@ -2131,6 +2132,43 @@ MainLoop *OS_Windows::get_main_loop() const { return main_loop; } +String OS_Windows::get_config_path() const { + + if (has_environment("XDG_CONFIG_HOME")) { // unlikely, but after all why not? + return get_environment("XDG_CONFIG_HOME"); + } else if (has_environment("APPDATA")) { + return get_environment("APPDATA"); + } else { + return "."; + } +} + +String OS_Windows::get_data_path() const { + + if (has_environment("XDG_DATA_HOME")) { + return get_environment("XDG_DATA_HOME"); + } else { + return get_config_path(); + } +} + +String OS_Windows::get_cache_path() const { + + if (has_environment("XDG_CACHE_HOME")) { + return get_environment("XDG_CACHE_HOME"); + } else if (has_environment("TEMP")) { + return get_environment("TEMP"); + } else { + return get_config_path(); + } +} + +// Get properly capitalized engine name for system paths +String OS_Windows::get_godot_dir_name() const { + + return String(VERSION_SHORT_NAME).capitalize(); +} + String OS_Windows::get_system_dir(SystemDir p_dir) const { int id; @@ -2167,18 +2205,17 @@ String OS_Windows::get_system_dir(SystemDir p_dir) const { ERR_FAIL_COND_V(res != S_OK, String()); return String(szPath); } -String OS_Windows::get_data_dir() const { - String an = get_safe_application_name(); - if (an != "") { +String OS_Windows::get_user_data_dir() const { - if (has_environment("APPDATA")) { + String appname = get_safe_application_name(); + if (appname != "") { - bool use_godot = ProjectSettings::get_singleton()->get("application/config/use_shared_user_dir"); - 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("\\", "/"); + bool use_godot_dir = ProjectSettings::get_singleton()->get("application/config/use_shared_user_dir"); + if (use_godot_dir) { + return get_data_path().plus_file(get_godot_dir_name()).plus_file("app_userdata").plus_file(appname).replace("\\", "/"); + } else { + return get_data_path().plus_file(appname).replace("\\", "/"); } } diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index fbd60e5f0d..5e0c240dba 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -253,8 +253,14 @@ public: virtual void enable_for_stealing_focus(ProcessID pid); virtual void move_window_to_foreground(); - virtual String get_data_dir() const; + + virtual String get_config_path() const; + virtual String get_data_path() const; + virtual String get_cache_path() const; + virtual String get_godot_dir_name() const; + virtual String get_system_dir(SystemDir p_dir) const; + virtual String get_user_data_dir() const; virtual void release_rendering_thread(); virtual void make_rendering_thread(); |