diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-07-19 17:00:46 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-07-19 17:06:03 -0300 |
commit | 25678b1876816b9ccb14b2c92aef62f3b009f88f (patch) | |
tree | 189f082d788f78e16f620b056d21249118883fc5 /platform/javascript | |
parent | 89588d43349e496a9e05756d42ae87323d31269e (diff) |
-Renamed GlobalConfig to ProjectSettings, makes more sense.
-Added system for feature overrides, it's pretty cool :)
Diffstat (limited to 'platform/javascript')
-rw-r--r-- | platform/javascript/export/export.cpp | 12 | ||||
-rw-r--r-- | platform/javascript/os_javascript.cpp | 11 | ||||
-rw-r--r-- | platform/javascript/os_javascript.h | 2 |
3 files changed, 22 insertions, 3 deletions
diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp index 4bdfdae39e..b436d52363 100644 --- a/platform/javascript/export/export.cpp +++ b/platform/javascript/export/export.cpp @@ -61,6 +61,7 @@ public: virtual bool get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const; virtual String get_name() const; + virtual String get_os_name() const; virtual Ref<Texture> get_logo() const; virtual bool can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const; @@ -74,6 +75,12 @@ public: virtual Error run(const Ref<EditorExportPreset> &p_preset, int p_device, int p_debug_flags); virtual Ref<Texture> get_run_icon() const; + virtual void get_platform_features(List<String> *r_features) { + + r_features->push_back("web"); + r_features->push_back("JavaScript"); + } + EditorExportPlatformJavaScript(); }; @@ -167,6 +174,11 @@ String EditorExportPlatformJavaScript::get_name() const { return "HTML5"; } +String EditorExportPlatformJavaScript::get_os_name() const { + + return "JavaScript"; +} + Ref<Texture> EditorExportPlatformJavaScript::get_logo() const { return logo; diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index 9df26f1471..7dbc178c60 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -29,8 +29,8 @@ /*************************************************************************/ #include "os_javascript.h" -#include "core/global_config.h" #include "core/io/file_access_buffered_fa.h" +#include "core/project_settings.h" #include "dom_keys.h" #include "drivers/gles3/rasterizer_gles3.h" #include "drivers/unix/dir_access_unix.h" @@ -487,7 +487,7 @@ void OS_JavaScript::initialize(const VideoMode &p_desired, int p_video_driver, i #ifdef JAVASCRIPT_EVAL_ENABLED javascript_eval = memnew(JavaScript); - GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("JavaScript", javascript_eval)); + ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("JavaScript", javascript_eval)); #endif visual_server->init(); @@ -828,7 +828,7 @@ String OS_JavaScript::get_data_dir() const { return get_data_dir_func(); */ return "/userfs"; - //return GlobalConfig::get_singleton()->get_singleton_object("GodotOS")->call("get_data_dir"); + //return ProjectSettings::get_singleton()->get_singleton_object("GodotOS")->call("get_data_dir"); }; String OS_JavaScript::get_executable_path() const { @@ -911,6 +911,11 @@ int OS_JavaScript::get_power_percent_left() { return power_manager->get_power_percent_left(); } +bool OS_JavaScript::_check_internal_feature_support(const String &p_feature) { + + return p_feature == "web" || p_feature == "s3tc"; // TODO check for these features really being available +} + OS_JavaScript::OS_JavaScript(const char *p_execpath, GetDataDirFunc p_get_data_dir_func) { set_cmdline(p_execpath, get_cmdline_args()); main_loop = NULL; diff --git a/platform/javascript/os_javascript.h b/platform/javascript/os_javascript.h index 65269148ec..24e96e20dd 100644 --- a/platform/javascript/os_javascript.h +++ b/platform/javascript/os_javascript.h @@ -164,6 +164,8 @@ public: virtual int get_power_seconds_left(); virtual int get_power_percent_left(); + virtual bool _check_internal_feature_support(const String &p_feature); + OS_JavaScript(const char *p_execpath, GetDataDirFunc p_get_data_dir_func); ~OS_JavaScript(); }; |