diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/bind/core_bind.cpp | 53 | ||||
-rw-r--r-- | core/bind/core_bind.h | 12 | ||||
-rw-r--r-- | core/engine.cpp | 76 | ||||
-rw-r--r-- | core/engine.h | 37 | ||||
-rw-r--r-- | core/os/os.cpp | 29 | ||||
-rw-r--r-- | core/os/os.h | 2 |
6 files changed, 83 insertions, 126 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 80fe8b7c85..fe2be260d7 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -986,11 +986,6 @@ void _OS::alert(const String& p_alert,const String& p_title) { OS::get_singleton()->alert(p_alert,p_title); } -Dictionary _OS::get_engine_version() const { - - return OS::get_singleton()->get_engine_version(); -} - _OS *_OS::singleton=NULL; void _OS::_bind_methods() { @@ -1134,8 +1129,6 @@ void _OS::_bind_methods() { ClassDB::bind_method(_MD("set_use_vsync","enable"),&_OS::set_use_vsync); ClassDB::bind_method(_MD("is_vsync_enabled"),&_OS::is_vsync_enabled); - ClassDB::bind_method(_MD("get_engine_version"),&_OS::get_engine_version); - BIND_CONSTANT( DAY_SUNDAY ); BIND_CONSTANT( DAY_MONDAY ); BIND_CONSTANT( DAY_TUESDAY ); @@ -2596,42 +2589,9 @@ MainLoop *_Engine::get_main_loop() const { return OS::get_singleton()->get_main_loop(); } -String _Engine::get_version() const { - - return Engine::get_singleton()->get_version(); -} -String _Engine::get_version_name() const{ - - return Engine::get_singleton()->get_version_name(); -} -String _Engine::get_version_short_name() const{ - - return Engine::get_singleton()->get_version_short_name(); -} -int _Engine::get_version_major() const{ - - return Engine::get_singleton()->get_version_major(); - -} -int _Engine::get_version_minor() const{ - - return Engine::get_singleton()->get_version_minor(); - -} -String _Engine::get_version_revision() const{ - - return Engine::get_singleton()->get_version_revision(); - -} -String _Engine::get_version_status() const{ - - return Engine::get_singleton()->get_version_status(); - -} -int _Engine::get_version_year() const{ - - return Engine::get_singleton()->get_version_year(); +Dictionary _Engine::get_version_info() const { + return Engine::get_singleton()->get_version_info(); } @@ -2652,14 +2612,7 @@ void _Engine::_bind_methods() { ClassDB::bind_method(_MD("get_main_loop:MainLoop"),&_Engine::get_main_loop); - ClassDB::bind_method(_MD("get_version"),&_Engine::get_version); - ClassDB::bind_method(_MD("get_version_name"),&_Engine::get_version_name); - ClassDB::bind_method(_MD("get_version_short_name"),&_Engine::get_version_short_name); - ClassDB::bind_method(_MD("get_version_major"),&_Engine::get_version_major); - ClassDB::bind_method(_MD("get_version_minor"),&_Engine::get_version_minor); - ClassDB::bind_method(_MD("get_version_revision"),&_Engine::get_version_revision); - ClassDB::bind_method(_MD("get_version_status"),&_Engine::get_version_status); - ClassDB::bind_method(_MD("get_version_year"),&_Engine::get_version_year); + ClassDB::bind_method(_MD("get_version_info"),&_Engine::get_version_info); } diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index 3401435c68..0774492f66 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -309,8 +309,6 @@ public: void set_use_vsync(bool p_enable); bool is_vsync_enabled() const; - Dictionary get_engine_version() const; - static _OS *get_singleton() { return singleton; } _OS(); @@ -647,15 +645,7 @@ public: MainLoop *get_main_loop() const; - String get_version() const; - String get_version_name() const; - String get_version_short_name() const; - int get_version_major() const; - int get_version_minor() const; - String get_version_revision() const; - String get_version_status() const; - int get_version_year() const; - + Dictionary get_version_info() const; _Engine(); }; diff --git a/core/engine.cpp b/core/engine.cpp index c63ca59082..eb6d8a3478 100644 --- a/core/engine.cpp +++ b/core/engine.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* engine.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "engine.h" #include "version.h" @@ -43,39 +71,27 @@ float Engine::get_time_scale() const { return _time_scale; } +Dictionary Engine::get_version_info() const { -String Engine::get_version() const { + Dictionary dict; + dict["major"] = VERSION_MAJOR; + dict["minor"] = VERSION_MINOR; + #ifdef VERSION_PATCH + dict["patch"] = VERSION_PATCH; + #else + dict["patch"] = 0; + #endif + dict["status"] = _MKSTR(VERSION_STATUS); + dict["revision"] = _MKSTR(VERSION_REVISION); + dict["year"] = VERSION_YEAR; - return VERSION_FULL_NAME; -} -String Engine::get_version_name() const{ - - return _MKSTR(VERSION_NAME); -} -String Engine::get_version_short_name() const{ - - return _MKSTR(VERSION_SHORT_NAME); - -} -int Engine::get_version_major() const{ - - return VERSION_MAJOR; -} -int Engine::get_version_minor() const{ - - return VERSION_MINOR; -} -String Engine::get_version_revision() const{ - - return _MKSTR(VERSION_REVISION); -} -String Engine::get_version_status() const{ - - return _MKSTR(VERSION_STATUS); -} -int Engine::get_version_year() const{ + String stringver = String(dict["major"]) + "." + String(dict["minor"]); + if ((int)dict["patch"] != 0) + stringver += "." + String(dict["patch"]); + stringver += "-" + String(dict["status"]) + " (" + String(dict["revision"]) + ")"; + dict["string"] = stringver; - return VERSION_YEAR; + return dict; } diff --git a/core/engine.h b/core/engine.h index 8bcdb72e17..9af4219a68 100644 --- a/core/engine.h +++ b/core/engine.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* engine.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #ifndef ENGINE_H #define ENGINE_H @@ -52,14 +80,7 @@ public: _FORCE_INLINE_ bool get_use_pixel_snap() const { return _pixel_snap; } - String get_version() const; - String get_version_name() const; - String get_version_short_name() const; - int get_version_major() const; - int get_version_minor() const; - String get_version_revision() const; - String get_version_status() const; - int get_version_year() const; + Dictionary get_version_info() const; Engine(); }; diff --git a/core/os/os.cpp b/core/os/os.cpp index db7b7cb943..f4c13dabcc 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -27,13 +27,13 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "os.h" -#include "os/file_access.h" -#include <stdarg.h> + #include "dir_access.h" #include "globals.h" #include "input.h" -// For get_engine_version, could be removed if it's moved to a new Engine singleton -#include "version.h" +#include "os/file_access.h" + +#include <stdarg.h> OS* OS::singleton=NULL; @@ -512,27 +512,6 @@ bool OS::is_vsync_enabled() const{ return true; } -Dictionary OS::get_engine_version() const { - - Dictionary dict; - dict["major"] = _MKSTR(VERSION_MAJOR); - dict["minor"] = _MKSTR(VERSION_MINOR); -#ifdef VERSION_PATCH - dict["patch"] = _MKSTR(VERSION_PATCH); -#else - dict["patch"] = ""; -#endif - dict["status"] = _MKSTR(VERSION_STATUS); - dict["revision"] = _MKSTR(VERSION_REVISION); - - String stringver = String(dict["major"]) + "." + String(dict["minor"]); - if (dict["patch"] != "") - stringver += "." + String(dict["patch"]); - stringver += "-" + String(dict["status"]) + " (" + String(dict["revision"]) + ")"; - dict["string"] = stringver; - - return dict; -} OS::OS() { last_error=NULL; diff --git a/core/os/os.h b/core/os/os.h index 4c34ff92f9..ea03481a92 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -402,8 +402,6 @@ public: virtual void set_use_vsync(bool p_enable); virtual bool is_vsync_enabled() const; - Dictionary get_engine_version() const; - bool is_hidpi_allowed() const { return _allow_hidpi; } OS(); virtual ~OS(); |