summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SConstruct3
-rw-r--r--core/SCsub21
-rw-r--r--core/core_string_names.cpp23
-rw-r--r--core/core_string_names.h27
-rw-r--r--core/io/compression.cpp2
-rw-r--r--core/variant.h1
-rw-r--r--core/variant_call.cpp70
-rw-r--r--core/variant_op.cpp508
-rw-r--r--doc/classes/Area.xml47
-rw-r--r--doc/classes/Area2D.xml69
-rw-r--r--doc/classes/CollisionObject.xml26
-rw-r--r--doc/classes/CollisionObject2D.xml33
-rw-r--r--doc/classes/Range.xml9
-rw-r--r--doc/classes/SpriteFrames.xml18
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.cpp2
-rw-r--r--drivers/gles3/shader_compiler_gles3.cpp2
-rw-r--r--drivers/gles3/shaders/scene.glsl5
-rw-r--r--editor/editor_export.cpp2
-rw-r--r--editor/editor_fonts.cpp10
-rw-r--r--editor/editor_log.cpp15
-rw-r--r--editor/editor_settings.cpp6
-rw-r--r--editor/editor_themes.cpp3
-rw-r--r--editor/icons/icon_status_error.svg7
-rw-r--r--editor/icons/icon_status_success.svg7
-rw-r--r--editor/icons/icon_status_warning.svg7
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp2
-rw-r--r--editor/plugins/spatial_editor_plugin.cpp36
-rw-r--r--editor/plugins/tile_map_editor_plugin.cpp4
-rw-r--r--editor/project_manager.cpp343
-rw-r--r--editor/project_manager.h4
-rw-r--r--editor/script_editor_debugger.cpp2
-rw-r--r--main/main.cpp22
-rw-r--r--misc/dist/ios_xcode/export_options.plist10
-rwxr-xr-xmisc/dist/ios_xcode/godot.iphone.debug.arm (renamed from misc/dist/ios_xcode/godot_debug.iphone)0
-rwxr-xr-xmisc/dist/ios_xcode/godot.iphone.debug.arm64 (renamed from misc/dist/ios_xcode/godot_opt.iphone)0
-rwxr-xr-xmisc/dist/ios_xcode/godot.iphone.debug.fat0
-rwxr-xr-xmisc/dist/ios_xcode/godot.iphone.release.arm0
-rwxr-xr-xmisc/dist/ios_xcode/godot.iphone.release.arm640
-rwxr-xr-xmisc/dist/ios_xcode/godot.iphone.release.fat0
-rw-r--r--misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj198
-rw-r--r--misc/dist/ios_xcode/godot_ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata2
-rw-r--r--misc/dist/ios_xcode/godot_ios.xcodeproj/xcshareddata/xcschemes/godot_ios.xcscheme93
-rw-r--r--misc/dist/ios_xcode/godot_ios/Default-568h@2x.png (renamed from misc/dist/ios_xcode/godot_ios/Default-568h@2x~iphone.png)bin564 -> 564 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Default-667h.pngbin683 -> 0 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Default-736h@3x.pngbin2582 -> 0 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Default-Landscape-1366h@2x.pngbin0 -> 32836 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Default-Landscape-736h@3x.png (renamed from misc/dist/ios_xcode/godot_ios/Default-Landscape-736h.png)bin2582 -> 2582 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Default-Landscape@2x.png (renamed from misc/dist/ios_xcode/godot_ios/Default-Landscape@2x~ipad.png)bin3131 -> 3131 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Default-Landscape~ipad.pngbin634 -> 0 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Default-Portrait-1366h@2x.pngbin0 -> 33309 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Default-Portrait-736h@3x.png (renamed from misc/dist/ios_xcode/godot_ios/Default-736h.png)bin1676 -> 1676 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Default-Portrait@2x.pngbin0 -> 33309 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Default-Portrait@2x~ipad.pngbin3070 -> 0 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Default-Portrait~ipad.pngbin589 -> 0 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Default@2x~iphone.pngbin515 -> 0 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Default~iphone.pngbin309 -> 0 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Contents.json128
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-100.pngbin250 -> 0 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-114.pngbin253 -> 0 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-120.pngbin253 -> 0 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-144.pngbin259 -> 0 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-152.pngbin260 -> 0 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-180.pngbin265 -> 0 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-29.pngbin242 -> 0 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-40.pngbin240 -> 0 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-50.pngbin243 -> 0 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-57.pngbin243 -> 0 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-58.pngbin243 -> 0 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-60.pngbin244 -> 0 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-72.pngbin244 -> 0 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-76.pngbin246 -> 0 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-80.pngbin245 -> 0 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-167.pngbin262 -> 0 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-87.pngbin247 -> 0 bytes
-rw-r--r--misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/sizes17
-rw-r--r--misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist15
-rw-r--r--misc/dist/ios_xcode/godot_ios/godot_ios.entitlements8
-rw-r--r--misc/dist/linux/godot.6165
-rw-r--r--misc/dist/linux/godot.appdata.xml34
-rw-r--r--misc/dist/linux/godot.desktop9
-rw-r--r--modules/gdnative/SCsub2
-rw-r--r--modules/gdnative/gdnative.cpp5
-rw-r--r--modules/gdnative/include/gdnative/gdnative.h4
-rw-r--r--modules/gdnative/include/nativescript/godot_nativescript.h4
-rw-r--r--modules/gdnative/nativescript/SCsub3
-rw-r--r--modules/openssl/stream_peer_openssl.cpp60
-rw-r--r--modules/openssl/stream_peer_openssl.h5
-rw-r--r--modules/visual_script/visual_script_func_nodes.cpp4
-rw-r--r--platform/iphone/export/export.cpp361
-rw-r--r--platform/osx/os_osx.h1
-rw-r--r--platform/osx/os_osx.mm23
-rw-r--r--platform/server/detect.py12
-rw-r--r--platform/windows/detect.py9
-rw-r--r--platform/x11/detect.py15
-rw-r--r--scene/2d/collision_object_2d.cpp2
-rw-r--r--scene/3d/collision_object.cpp2
-rw-r--r--scene/main/scene_tree.cpp1
-rw-r--r--scene/resources/material.cpp21
-rw-r--r--scene/resources/material.h5
-rw-r--r--servers/audio/effects/audio_effect_chorus.cpp3
-rw-r--r--servers/audio/effects/audio_effect_limiter.cpp2
-rw-r--r--servers/physics_2d/physics_2d_server_wrap_mt.cpp3
-rw-r--r--servers/visual/shader_language.cpp5
-rw-r--r--servers/visual/shader_types.cpp1
-rw-r--r--servers/visual/visual_server_raster.h20
-rw-r--r--thirdparty/zstd/SCsub23
106 files changed, 1979 insertions, 632 deletions
diff --git a/SConstruct b/SConstruct
index f2f1ea57f3..964222c7a0 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1,7 +1,7 @@
#!/usr/bin/env python
-EnsureSConsVersion(0, 14)
+EnsureSConsVersion(0, 98, 1)
import string
@@ -171,6 +171,7 @@ opts.Add('builtin_pcre2', "Use the builtin pcre2 library (yes/no)", 'yes')
opts.Add('builtin_recast', "Use the builtin recast library (yes/no)", 'yes')
opts.Add('builtin_squish', "Use the builtin squish library (yes/no)", 'yes')
opts.Add('builtin_zlib', "Use the builtin zlib library (yes/no)", 'yes')
+opts.Add('builtin_zstd', "Use the builtin zstd library (yes/no)", 'yes')
# Environment setup
opts.Add("CXX", "C++ compiler")
diff --git a/core/SCsub b/core/SCsub
index c1e57f6840..e78fe185a9 100644
--- a/core/SCsub
+++ b/core/SCsub
@@ -83,24 +83,8 @@ thirdparty_minizip_sources = [
thirdparty_minizip_sources = [thirdparty_minizip_dir + file for file in thirdparty_minizip_sources]
env.add_source_files(env.core_sources, thirdparty_minizip_sources)
-thirdparty_zstd_dir = "#thirdparty/zstd/"
-thirdparty_zstd_sources = [
- "common/entropy_common.c",
- "common/error_private.c",
- "common/fse_decompress.c",
- "common/pool.c",
- "common/threading.c",
- "common/xxhash.c",
- "common/zstd_common.c",
- "compress/fse_compress.c",
- "compress/huf_compress.c",
- "compress/zstd_compress.c",
- "compress/zstdmt_compress.c",
- "decompress/huf_decompress.c",
- "decompress/zstd_decompress.c",
-]
-thirdparty_zstd_sources = [thirdparty_zstd_dir + file for file in thirdparty_zstd_sources]
-env.add_source_files(env.core_sources, thirdparty_zstd_sources)
+if "builtin_zstd" in env and env["builtin_zstd"] == "yes":
+ SConscript("#thirdparty/zstd/SCsub")
# Godot's own sources
@@ -123,5 +107,4 @@ SConscript('helper/SCsub')
# Build it all as a library
lib = env.Library("core", env.core_sources)
env.Prepend(LIBS=[lib])
-env.Append(CPPPATH=["#thirdparty/zstd", "#thirdparty/zstd/common"])
Export('env')
diff --git a/core/core_string_names.cpp b/core/core_string_names.cpp
index ef9346253f..feee39225f 100644
--- a/core/core_string_names.cpp
+++ b/core/core_string_names.cpp
@@ -47,4 +47,27 @@ CoreStringNames::CoreStringNames()
_sections_unfolded(StaticCString::create("_sections_unfolded")),
#endif
_custom_features(StaticCString::create("_custom_features")) {
+
+ x = StaticCString::create("x");
+ y = StaticCString::create("y");
+ z = StaticCString::create("z");
+ w = StaticCString::create("w");
+ r = StaticCString::create("r");
+ g = StaticCString::create("g");
+ b = StaticCString::create("b");
+ a = StaticCString::create("a");
+ position = StaticCString::create("position");
+ size = StaticCString::create("size");
+ end = StaticCString::create("end");
+ basis = StaticCString::create("basis");
+ origin = StaticCString::create("origin");
+ normal = StaticCString::create("normal");
+ d = StaticCString::create("d");
+ h = StaticCString::create("h");
+ s = StaticCString::create("s");
+ v = StaticCString::create("v");
+ r8 = StaticCString::create("r8");
+ g8 = StaticCString::create("g8");
+ b8 = StaticCString::create("b8");
+ a8 = StaticCString::create("a8");
}
diff --git a/core/core_string_names.h b/core/core_string_names.h
index 2eb2b703ae..6fcc773169 100644
--- a/core/core_string_names.h
+++ b/core/core_string_names.h
@@ -37,8 +37,6 @@ class CoreStringNames {
friend void register_core_types();
friend void unregister_core_types();
- static CoreStringNames *singleton;
-
static void create() { singleton = memnew(CoreStringNames); }
static void free() {
memdelete(singleton);
@@ -50,6 +48,8 @@ class CoreStringNames {
public:
_FORCE_INLINE_ static CoreStringNames *get_singleton() { return singleton; }
+ static CoreStringNames *singleton;
+
StringName _free;
StringName changed;
StringName _meta;
@@ -65,6 +65,29 @@ public:
StringName _sections_unfolded;
#endif
StringName _custom_features;
+
+ StringName x;
+ StringName y;
+ StringName z;
+ StringName w;
+ StringName r;
+ StringName g;
+ StringName b;
+ StringName a;
+ StringName position;
+ StringName size;
+ StringName end;
+ StringName basis;
+ StringName origin;
+ StringName normal;
+ StringName d;
+ StringName h;
+ StringName s;
+ StringName v;
+ StringName r8;
+ StringName g8;
+ StringName b8;
+ StringName a8;
};
#endif // SCENE_STRING_NAMES_H
diff --git a/core/io/compression.cpp b/core/io/compression.cpp
index 44fa65e11d..fbe97e54c7 100644
--- a/core/io/compression.cpp
+++ b/core/io/compression.cpp
@@ -33,9 +33,9 @@
#include "zip_io.h"
#include "thirdparty/misc/fastlz.h"
-#include "thirdparty/zstd/zstd.h"
#include <zlib.h>
+#include <zstd.h>
int Compression::compress(uint8_t *p_dst, const uint8_t *p_src, int p_src_size, Mode p_mode) {
diff --git a/core/variant.h b/core/variant.h
index 5ea540a63f..e0d0bf05c8 100644
--- a/core/variant.h
+++ b/core/variant.h
@@ -368,6 +368,7 @@ public:
static Vector<Variant> get_method_default_arguments(Variant::Type p_type, const StringName &p_method);
static Variant::Type get_method_return_type(Variant::Type p_type, const StringName &p_method, bool *r_has_return = NULL);
static Vector<StringName> get_method_argument_names(Variant::Type p_type, const StringName &p_method);
+ static bool is_method_const(Variant::Type p_type, const StringName &p_method);
void set_named(const StringName &p_index, const Variant &p_value, bool *r_valid = NULL);
Variant get_named(const StringName &p_index, bool *r_valid = NULL) const;
diff --git a/core/variant_call.cpp b/core/variant_call.cpp
index 7205280938..d141621fbb 100644
--- a/core/variant_call.cpp
+++ b/core/variant_call.cpp
@@ -53,6 +53,7 @@ struct _VariantCall {
Vector<StringName> arg_names;
Variant::Type return_type;
+ bool _const;
#ifdef DEBUG_ENABLED
bool returns;
#endif
@@ -145,11 +146,12 @@ struct _VariantCall {
#endif
}
- static void addfunc(Variant::Type p_type, Variant::Type p_return, const StringName &p_name, VariantFunc p_func, const Vector<Variant> &p_defaultarg, const Arg &p_argtype1 = Arg(), const Arg &p_argtype2 = Arg(), const Arg &p_argtype3 = Arg(), const Arg &p_argtype4 = Arg(), const Arg &p_argtype5 = Arg()) {
+ static void addfunc(bool p_const, Variant::Type p_type, Variant::Type p_return, const StringName &p_name, VariantFunc p_func, const Vector<Variant> &p_defaultarg, const Arg &p_argtype1 = Arg(), const Arg &p_argtype2 = Arg(), const Arg &p_argtype3 = Arg(), const Arg &p_argtype4 = Arg(), const Arg &p_argtype5 = Arg()) {
FuncData funcdata;
funcdata.func = p_func;
funcdata.default_args = p_defaultarg;
+ funcdata._const = p_const;
#ifdef DEBUG_ENABLED
funcdata.return_type = p_return;
funcdata.returns = p_return != Variant::NIL;
@@ -1201,6 +1203,17 @@ Vector<Variant::Type> Variant::get_method_argument_types(Variant::Type p_type, c
return E->get().arg_types;
}
+bool Variant::is_method_const(Variant::Type p_type, const StringName &p_method) {
+
+ const _VariantCall::TypeFunc &fd = _VariantCall::type_funcs[p_type];
+
+ const Map<StringName, _VariantCall::FuncData>::Element *E = fd.functions.find(p_method);
+ if (!E)
+ return false;
+
+ return E->get()._const;
+}
+
Vector<StringName> Variant::get_method_argument_names(Variant::Type p_type, const StringName &p_method) {
const _VariantCall::TypeFunc &fd = _VariantCall::type_funcs[p_type];
@@ -1248,6 +1261,10 @@ void Variant::get_method_list(List<MethodInfo> *p_list) const {
MethodInfo mi;
mi.name = E->key();
+ if (fd._const) {
+ mi.flags |= METHOD_FLAG_CONST;
+ }
+
for (int i = 0; i < fd.arg_types.size(); i++) {
PropertyInfo pi;
@@ -1360,15 +1377,26 @@ void register_variant_methods() {
_VariantCall::constant_data = memnew_arr(_VariantCall::ConstantData, Variant::VARIANT_MAX);
#define ADDFUNC0(m_vtype, m_ret, m_class, m_method, m_defarg) \
- _VariantCall::addfunc(Variant::m_vtype, Variant::m_ret, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg);
+ _VariantCall::addfunc(true, Variant::m_vtype, Variant::m_ret, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg);
#define ADDFUNC1(m_vtype, m_ret, m_class, m_method, m_arg1, m_argname1, m_defarg) \
- _VariantCall::addfunc(Variant::m_vtype, Variant::m_ret, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg, _VariantCall::Arg(Variant::m_arg1, _scs_create(m_argname1)));
+ _VariantCall::addfunc(true, Variant::m_vtype, Variant::m_ret, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg, _VariantCall::Arg(Variant::m_arg1, _scs_create(m_argname1)));
#define ADDFUNC2(m_vtype, m_ret, m_class, m_method, m_arg1, m_argname1, m_arg2, m_argname2, m_defarg) \
- _VariantCall::addfunc(Variant::m_vtype, Variant::m_ret, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg, _VariantCall::Arg(Variant::m_arg1, _scs_create(m_argname1)), _VariantCall::Arg(Variant::m_arg2, _scs_create(m_argname2)));
+ _VariantCall::addfunc(true, Variant::m_vtype, Variant::m_ret, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg, _VariantCall::Arg(Variant::m_arg1, _scs_create(m_argname1)), _VariantCall::Arg(Variant::m_arg2, _scs_create(m_argname2)));
#define ADDFUNC3(m_vtype, m_ret, m_class, m_method, m_arg1, m_argname1, m_arg2, m_argname2, m_arg3, m_argname3, m_defarg) \
- _VariantCall::addfunc(Variant::m_vtype, Variant::m_ret, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg, _VariantCall::Arg(Variant::m_arg1, _scs_create(m_argname1)), _VariantCall::Arg(Variant::m_arg2, _scs_create(m_argname2)), _VariantCall::Arg(Variant::m_arg3, _scs_create(m_argname3)));
+ _VariantCall::addfunc(true, Variant::m_vtype, Variant::m_ret, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg, _VariantCall::Arg(Variant::m_arg1, _scs_create(m_argname1)), _VariantCall::Arg(Variant::m_arg2, _scs_create(m_argname2)), _VariantCall::Arg(Variant::m_arg3, _scs_create(m_argname3)));
#define ADDFUNC4(m_vtype, m_ret, m_class, m_method, m_arg1, m_argname1, m_arg2, m_argname2, m_arg3, m_argname3, m_arg4, m_argname4, m_defarg) \
- _VariantCall::addfunc(Variant::m_vtype, Variant::m_ret, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg, _VariantCall::Arg(Variant::m_arg1, _scs_create(m_argname1)), _VariantCall::Arg(Variant::m_arg2, _scs_create(m_argname2)), _VariantCall::Arg(Variant::m_arg3, _scs_create(m_argname3)), _VariantCall::Arg(Variant::m_arg4, _scs_create(m_argname4)));
+ _VariantCall::addfunc(true, Variant::m_vtype, Variant::m_ret, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg, _VariantCall::Arg(Variant::m_arg1, _scs_create(m_argname1)), _VariantCall::Arg(Variant::m_arg2, _scs_create(m_argname2)), _VariantCall::Arg(Variant::m_arg3, _scs_create(m_argname3)), _VariantCall::Arg(Variant::m_arg4, _scs_create(m_argname4)));
+
+#define ADDFUNC0NC(m_vtype, m_ret, m_class, m_method, m_defarg) \
+ _VariantCall::addfunc(false, Variant::m_vtype, Variant::m_ret, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg);
+#define ADDFUNC1NC(m_vtype, m_ret, m_class, m_method, m_arg1, m_argname1, m_defarg) \
+ _VariantCall::addfunc(false, Variant::m_vtype, Variant::m_ret, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg, _VariantCall::Arg(Variant::m_arg1, _scs_create(m_argname1)));
+#define ADDFUNC2NC(m_vtype, m_ret, m_class, m_method, m_arg1, m_argname1, m_arg2, m_argname2, m_defarg) \
+ _VariantCall::addfunc(false, Variant::m_vtype, Variant::m_ret, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg, _VariantCall::Arg(Variant::m_arg1, _scs_create(m_argname1)), _VariantCall::Arg(Variant::m_arg2, _scs_create(m_argname2)));
+#define ADDFUNC3NC(m_vtype, m_ret, m_class, m_method, m_arg1, m_argname1, m_arg2, m_argname2, m_arg3, m_argname3, m_defarg) \
+ _VariantCall::addfunc(false, Variant::m_vtype, Variant::m_ret, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg, _VariantCall::Arg(Variant::m_arg1, _scs_create(m_argname1)), _VariantCall::Arg(Variant::m_arg2, _scs_create(m_argname2)), _VariantCall::Arg(Variant::m_arg3, _scs_create(m_argname3)));
+#define ADDFUNC4NC(m_vtype, m_ret, m_class, m_method, m_arg1, m_argname1, m_arg2, m_argname2, m_arg3, m_argname3, m_arg4, m_argname4, m_defarg) \
+ _VariantCall::addfunc(false, Variant::m_vtype, Variant::m_ret, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg, _VariantCall::Arg(Variant::m_arg1, _scs_create(m_argname1)), _VariantCall::Arg(Variant::m_arg2, _scs_create(m_argname2)), _VariantCall::Arg(Variant::m_arg3, _scs_create(m_argname3)), _VariantCall::Arg(Variant::m_arg4, _scs_create(m_argname4)));
/* STRING */
ADDFUNC1(STRING, INT, String, casecmp_to, STRING, "to", varray());
@@ -1545,7 +1573,7 @@ void register_variant_methods() {
ADDFUNC0(DICTIONARY, INT, Dictionary, size, varray());
ADDFUNC0(DICTIONARY, BOOL, Dictionary, empty, varray());
- ADDFUNC0(DICTIONARY, NIL, Dictionary, clear, varray());
+ ADDFUNC0NC(DICTIONARY, NIL, Dictionary, clear, varray());
ADDFUNC1(DICTIONARY, BOOL, Dictionary, has, NIL, "key", varray());
ADDFUNC1(DICTIONARY, BOOL, Dictionary, has_all, ARRAY, "keys", varray());
ADDFUNC1(DICTIONARY, NIL, Dictionary, erase, NIL, "key", varray());
@@ -1555,15 +1583,15 @@ void register_variant_methods() {
ADDFUNC0(ARRAY, INT, Array, size, varray());
ADDFUNC0(ARRAY, BOOL, Array, empty, varray());
- ADDFUNC0(ARRAY, NIL, Array, clear, varray());
+ ADDFUNC0NC(ARRAY, NIL, Array, clear, varray());
ADDFUNC0(ARRAY, INT, Array, hash, varray());
- ADDFUNC1(ARRAY, NIL, Array, push_back, NIL, "value", varray());
- ADDFUNC1(ARRAY, NIL, Array, push_front, NIL, "value", varray());
- ADDFUNC1(ARRAY, NIL, Array, append, NIL, "value", varray());
- ADDFUNC1(ARRAY, NIL, Array, resize, INT, "size", varray());
- ADDFUNC2(ARRAY, NIL, Array, insert, INT, "position", NIL, "value", varray());
- ADDFUNC1(ARRAY, NIL, Array, remove, INT, "position", varray());
- ADDFUNC1(ARRAY, NIL, Array, erase, NIL, "value", varray());
+ ADDFUNC1NC(ARRAY, NIL, Array, push_back, NIL, "value", varray());
+ ADDFUNC1NC(ARRAY, NIL, Array, push_front, NIL, "value", varray());
+ ADDFUNC1NC(ARRAY, NIL, Array, append, NIL, "value", varray());
+ ADDFUNC1NC(ARRAY, NIL, Array, resize, INT, "size", varray());
+ ADDFUNC2NC(ARRAY, NIL, Array, insert, INT, "position", NIL, "value", varray());
+ ADDFUNC1NC(ARRAY, NIL, Array, remove, INT, "position", varray());
+ ADDFUNC1NC(ARRAY, NIL, Array, erase, NIL, "value", varray());
ADDFUNC0(ARRAY, NIL, Array, front, varray());
ADDFUNC0(ARRAY, NIL, Array, back, varray());
ADDFUNC2(ARRAY, INT, Array, find, NIL, "what", INT, "from", varray(0));
@@ -1571,12 +1599,12 @@ void register_variant_methods() {
ADDFUNC1(ARRAY, INT, Array, find_last, NIL, "value", varray());
ADDFUNC1(ARRAY, INT, Array, count, NIL, "value", varray());
ADDFUNC1(ARRAY, BOOL, Array, has, NIL, "value", varray());
- ADDFUNC0(ARRAY, NIL, Array, pop_back, varray());
- ADDFUNC0(ARRAY, NIL, Array, pop_front, varray());
- ADDFUNC0(ARRAY, NIL, Array, sort, varray());
- ADDFUNC2(ARRAY, NIL, Array, sort_custom, OBJECT, "obj", STRING, "func", varray());
- ADDFUNC0(ARRAY, NIL, Array, invert, varray());
- ADDFUNC0(ARRAY, ARRAY, Array, duplicate, varray());
+ ADDFUNC0NC(ARRAY, NIL, Array, pop_back, varray());
+ ADDFUNC0NC(ARRAY, NIL, Array, pop_front, varray());
+ ADDFUNC0NC(ARRAY, NIL, Array, sort, varray());
+ ADDFUNC2NC(ARRAY, NIL, Array, sort_custom, OBJECT, "obj", STRING, "func", varray());
+ ADDFUNC0NC(ARRAY, NIL, Array, invert, varray());
+ ADDFUNC0NC(ARRAY, ARRAY, Array, duplicate, varray());
ADDFUNC0(POOL_BYTE_ARRAY, INT, PoolByteArray, size, varray());
ADDFUNC2(POOL_BYTE_ARRAY, NIL, PoolByteArray, set, INT, "idx", INT, "byte", varray());
diff --git a/core/variant_op.cpp b/core/variant_op.cpp
index 1c5a4ce8d0..4065b6a844 100644
--- a/core/variant_op.cpp
+++ b/core/variant_op.cpp
@@ -334,6 +334,13 @@ bool Variant::booleanize() const {
DEFAULT_OP_ARRAY_OP_BODY(m_prefix, m_op_name, m_name, m_type, !=, !=, true, false, false) \
}
+#define DEFAULT_OP_ARRAY_NEQ(m_prefix, m_op_name, m_name, m_type) \
+ CASE_TYPE(m_prefix, m_op_name, m_name) { \
+ if (p_b.type == NIL) \
+ _RETURN(true) \
+ DEFAULT_OP_ARRAY_OP_BODY(m_prefix, m_op_name, m_name, m_type, !=, ==, true, true, false) \
+ }
+
#define DEFAULT_OP_ARRAY_LT(m_prefix, m_op_name, m_name, m_type) \
DEFAULT_OP_ARRAY_OP(m_prefix, m_op_name, m_name, m_type, <, !=, false, a_len < array_b.size(), true)
@@ -555,14 +562,13 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a,
DEFAULT_OP_STR_NULL(math, OP_NOT_EQUAL, NODE_PATH, !=, NodePath);
DEFAULT_OP_LOCALMEM_NULL(math, OP_NOT_EQUAL, _RID, !=, RID);
- CASE_TYPE(math, OP_NOT_EQUAL, POOL_BYTE_ARRAY);
- CASE_TYPE(math, OP_NOT_EQUAL, POOL_INT_ARRAY);
- CASE_TYPE(math, OP_NOT_EQUAL, POOL_REAL_ARRAY);
- CASE_TYPE(math, OP_NOT_EQUAL, POOL_STRING_ARRAY);
- CASE_TYPE(math, OP_NOT_EQUAL, POOL_VECTOR2_ARRAY);
- CASE_TYPE(math, OP_NOT_EQUAL, POOL_VECTOR3_ARRAY);
- CASE_TYPE(math, OP_NOT_EQUAL, POOL_COLOR_ARRAY);
- _RETURN_FAIL;
+ DEFAULT_OP_ARRAY_NEQ(math, OP_NOT_EQUAL, POOL_BYTE_ARRAY, uint8_t);
+ DEFAULT_OP_ARRAY_NEQ(math, OP_NOT_EQUAL, POOL_INT_ARRAY, int);
+ DEFAULT_OP_ARRAY_NEQ(math, OP_NOT_EQUAL, POOL_REAL_ARRAY, real_t);
+ DEFAULT_OP_ARRAY_NEQ(math, OP_NOT_EQUAL, POOL_STRING_ARRAY, String);
+ DEFAULT_OP_ARRAY_NEQ(math, OP_NOT_EQUAL, POOL_VECTOR2_ARRAY, Vector2);
+ DEFAULT_OP_ARRAY_NEQ(math, OP_NOT_EQUAL, POOL_VECTOR3_ARRAY, Vector3);
+ DEFAULT_OP_ARRAY_NEQ(math, OP_NOT_EQUAL, POOL_COLOR_ARRAY, Color);
}
SWITCH_OP(math, OP_LESS, p_a.type) {
@@ -1214,54 +1220,486 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a,
void Variant::set_named(const StringName &p_index, const Variant &p_value, bool *r_valid) {
- if (type == OBJECT) {
+ bool valid = false;
+ switch (type) {
+ case VECTOR2: {
+ if (p_value.type == Variant::INT) {
+ Vector2 *v = reinterpret_cast<Vector2 *>(_data._mem);
+ if (p_index == CoreStringNames::singleton->x) {
+ v->x = p_value._data._int;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->y) {
+ v->y = p_value._data._int;
+ valid = true;
+ }
+ } else if (p_value.type == Variant::REAL) {
+ Vector2 *v = reinterpret_cast<Vector2 *>(_data._mem);
+ if (p_index == CoreStringNames::singleton->x) {
+ v->x = p_value._data._real;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->y) {
+ v->y = p_value._data._real;
+ valid = true;
+ }
+ }
-#ifdef DEBUG_ENABLED
- if (!_get_obj().obj) {
- if (r_valid)
- *r_valid = false;
- return;
- } else {
+ } break;
+ case RECT2: {
- if (ScriptDebugger::get_singleton() && _get_obj().ref.is_null() && !ObjectDB::instance_validate(_get_obj().obj)) {
- if (r_valid)
- *r_valid = false;
- return;
+ if (p_value.type == Variant::VECTOR2) {
+ Rect2 *v = reinterpret_cast<Rect2 *>(_data._mem);
+ //scalar name
+ if (p_index == CoreStringNames::singleton->position) {
+ v->position = *reinterpret_cast<const Vector2 *>(p_value._data._mem);
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->size) {
+ v->size = *reinterpret_cast<const Vector2 *>(p_value._data._mem);
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->end) {
+ v->size = *reinterpret_cast<const Vector2 *>(p_value._data._mem) - v->position;
+ valid = true;
+ }
+ }
+ } break;
+ case TRANSFORM2D: {
+
+ if (p_value.type == Variant::VECTOR2) {
+ Transform2D *v = _data._transform2d;
+ if (p_index == CoreStringNames::singleton->x) {
+ v->elements[0] = *reinterpret_cast<const Vector2 *>(p_value._data._mem);
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->y) {
+ v->elements[1] = *reinterpret_cast<const Vector2 *>(p_value._data._mem);
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->origin) {
+ v->elements[2] = *reinterpret_cast<const Vector2 *>(p_value._data._mem);
+ valid = true;
+ }
+ }
+
+ } break;
+ case VECTOR3: {
+
+ if (p_value.type == Variant::INT) {
+ Vector3 *v = reinterpret_cast<Vector3 *>(_data._mem);
+ if (p_index == CoreStringNames::singleton->x) {
+ v->x = p_value._data._int;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->y) {
+ v->y = p_value._data._int;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->z) {
+ v->z = p_value._data._int;
+ valid = true;
+ }
+ } else if (p_value.type == Variant::REAL) {
+ Vector3 *v = reinterpret_cast<Vector3 *>(_data._mem);
+ if (p_index == CoreStringNames::singleton->x) {
+ v->x = p_value._data._real;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->y) {
+ v->y = p_value._data._real;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->z) {
+ v->z = p_value._data._real;
+ valid = true;
+ }
+ }
+
+ } break;
+ case PLANE: {
+
+ if (p_value.type == Variant::INT) {
+ Plane *v = reinterpret_cast<Plane *>(_data._mem);
+ if (p_index == CoreStringNames::singleton->x) {
+ v->normal.x = p_value._data._int;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->y) {
+ v->normal.y = p_value._data._int;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->z) {
+ v->normal.z = p_value._data._int;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->d) {
+ v->d = p_value._data._int;
+ valid = true;
+ }
+ } else if (p_value.type == Variant::REAL) {
+ Plane *v = reinterpret_cast<Plane *>(_data._mem);
+ if (p_index == CoreStringNames::singleton->x) {
+ v->normal.x = p_value._data._real;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->y) {
+ v->normal.y = p_value._data._real;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->z) {
+ v->normal.z = p_value._data._real;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->d) {
+ v->d = p_value._data._real;
+ valid = true;
+ }
+
+ } else if (p_value.type == Variant::VECTOR3) {
+ Plane *v = reinterpret_cast<Plane *>(_data._mem);
+ if (p_index == CoreStringNames::singleton->normal) {
+ v->normal = *reinterpret_cast<const Vector3 *>(p_value._data._mem);
+ valid = true;
+ }
+ }
+
+ } break;
+ case QUAT: {
+
+ if (p_value.type == Variant::INT) {
+ Quat *v = reinterpret_cast<Quat *>(_data._mem);
+ if (p_index == CoreStringNames::singleton->x) {
+ v->x = p_value._data._int;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->y) {
+ v->y = p_value._data._int;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->z) {
+ v->z = p_value._data._int;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->w) {
+ v->w = p_value._data._int;
+ valid = true;
+ }
+ } else if (p_value.type == Variant::REAL) {
+ Quat *v = reinterpret_cast<Quat *>(_data._mem);
+ if (p_index == CoreStringNames::singleton->x) {
+ v->x = p_value._data._real;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->y) {
+ v->y = p_value._data._real;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->z) {
+ v->z = p_value._data._real;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->w) {
+ v->w = p_value._data._real;
+ valid = true;
+ }
+ }
+
+ } break; // 10
+ case RECT3: {
+
+ if (p_value.type == Variant::VECTOR3) {
+ Rect3 *v = _data._rect3;
+ //scalar name
+ if (p_index == CoreStringNames::singleton->position) {
+ v->position = *reinterpret_cast<const Vector3 *>(p_value._data._mem);
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->size) {
+ v->size = *reinterpret_cast<const Vector3 *>(p_value._data._mem);
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->end) {
+ v->size = *reinterpret_cast<const Vector3 *>(p_value._data._mem) - v->position;
+ valid = true;
+ }
+ }
+ } break;
+ case BASIS: {
+
+ if (p_value.type == Variant::VECTOR3) {
+ Basis *v = _data._basis;
+ //scalar name
+ if (p_index == CoreStringNames::singleton->x) {
+ v->set_axis(0, *reinterpret_cast<const Vector3 *>(p_value._data._mem));
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->y) {
+ v->set_axis(1, *reinterpret_cast<const Vector3 *>(p_value._data._mem));
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->z) {
+ v->set_axis(2, *reinterpret_cast<const Vector3 *>(p_value._data._mem));
+ valid = true;
+ }
+ }
+ } break;
+ case TRANSFORM: {
+
+ if (p_value.type == Variant::BASIS && p_index == CoreStringNames::singleton->basis) {
+ _data._transform->basis = *p_value._data._basis;
+ valid = true;
+ } else if (p_value.type == Variant::VECTOR3 && p_index == CoreStringNames::singleton->origin) {
+ _data._transform->origin = *reinterpret_cast<const Vector3 *>(p_value._data._mem);
+ valid = true;
+ }
+
+ } break;
+ case COLOR: {
+
+ if (p_value.type == Variant::INT) {
+ Color *v = reinterpret_cast<Color *>(_data._mem);
+ if (p_index == CoreStringNames::singleton->r) {
+ v->r = p_value._data._int;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->g) {
+ v->g = p_value._data._int;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->b) {
+ v->b = p_value._data._int;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->a) {
+ v->a = p_value._data._int;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->r8) {
+ v->r = p_value._data._int / 255.0;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->g8) {
+ v->g = p_value._data._int / 255.0;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->b8) {
+ v->b = p_value._data._int / 255.0;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->a8) {
+ v->a = p_value._data._int / 255.0;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->h) {
+ v->set_hsv(p_value._data._int, v->get_s(), v->get_v());
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->s) {
+ v->set_hsv(v->get_h(), p_value._data._int, v->get_v());
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->v) {
+ v->set_hsv(v->get_h(), v->get_v(), p_value._data._int);
+ valid = true;
+ }
+ } else if (p_value.type == Variant::REAL) {
+ Color *v = reinterpret_cast<Color *>(_data._mem);
+ if (p_index == CoreStringNames::singleton->r) {
+ v->r = p_value._data._real;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->g) {
+ v->g = p_value._data._real;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->b) {
+ v->b = p_value._data._real;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->a) {
+ v->a = p_value._data._real;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->r8) {
+ v->r = p_value._data._real / 255.0;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->g8) {
+ v->g = p_value._data._real / 255.0;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->b8) {
+ v->b = p_value._data._real / 255.0;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->a8) {
+ v->a = p_value._data._real / 255.0;
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->h) {
+ v->set_hsv(p_value._data._real, v->get_s(), v->get_v());
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->s) {
+ v->set_hsv(v->get_h(), p_value._data._real, v->get_v());
+ valid = true;
+ } else if (p_index == CoreStringNames::singleton->v) {
+ v->set_hsv(v->get_h(), v->get_v(), p_value._data._real);
+ valid = true;
+ }
+ }
+ } break;
+ case OBJECT: {
+
+#ifdef DEBUG_ENABLED
+ if (!_get_obj().obj) {
+ break;
+ } else if (ScriptDebugger::get_singleton() && _get_obj().ref.is_null() && !ObjectDB::instance_validate(_get_obj().obj)) {
+ break;
}
- }
#endif
- _get_obj().obj->set(p_index, p_value, r_valid);
- return;
+ _get_obj().obj->set(p_index, p_value, &valid);
+
+ } break;
+ default: {
+ set(p_index.operator String(), p_value, &valid);
+ } break;
}
- set(p_index.operator String(), p_value, r_valid);
+ if (r_valid) {
+ *r_valid = valid;
+ }
}
Variant Variant::get_named(const StringName &p_index, bool *r_valid) const {
- if (type == OBJECT) {
+ if (r_valid) {
+ *r_valid = true;
+ }
+ switch (type) {
+ case VECTOR2: {
+ const Vector2 *v = reinterpret_cast<const Vector2 *>(_data._mem);
+ if (p_index == CoreStringNames::singleton->x) {
+ return v->x;
+ } else if (p_index == CoreStringNames::singleton->y) {
+ return v->y;
+ }
-#ifdef DEBUG_ENABLED
- if (!_get_obj().obj) {
- if (r_valid)
- *r_valid = false;
- return "Instance base is null.";
- } else {
+ } break;
+ case RECT2: {
- if (ScriptDebugger::get_singleton() && _get_obj().ref.is_null() && !ObjectDB::instance_validate(_get_obj().obj)) {
+ const Rect2 *v = reinterpret_cast<const Rect2 *>(_data._mem);
+ //scalar name
+ if (p_index == CoreStringNames::singleton->position) {
+ return v->position;
+ } else if (p_index == CoreStringNames::singleton->size) {
+ return v->size;
+ } else if (p_index == CoreStringNames::singleton->end) {
+ return v->size + v->position;
+ }
+ } break;
+ case TRANSFORM2D: {
+
+ const Transform2D *v = _data._transform2d;
+ if (p_index == CoreStringNames::singleton->x) {
+ return v->elements[0];
+ } else if (p_index == CoreStringNames::singleton->y) {
+ return v->elements[1];
+ } else if (p_index == CoreStringNames::singleton->origin) {
+ return v->elements[2];
+ }
+
+ } break;
+ case VECTOR3: {
+
+ const Vector3 *v = reinterpret_cast<const Vector3 *>(_data._mem);
+ if (p_index == CoreStringNames::singleton->x) {
+ return v->x;
+ } else if (p_index == CoreStringNames::singleton->y) {
+ return v->y;
+ } else if (p_index == CoreStringNames::singleton->z) {
+ return v->z;
+ }
+
+ } break;
+ case PLANE: {
+
+ const Plane *v = reinterpret_cast<const Plane *>(_data._mem);
+ if (p_index == CoreStringNames::singleton->x) {
+ return v->normal.x;
+ } else if (p_index == CoreStringNames::singleton->y) {
+ return v->normal.y;
+ } else if (p_index == CoreStringNames::singleton->z) {
+ return v->normal.z;
+ } else if (p_index == CoreStringNames::singleton->d) {
+ return v->d;
+ } else if (p_index == CoreStringNames::singleton->normal) {
+ return v->normal;
+ }
+
+ } break;
+ case QUAT: {
+
+ const Quat *v = reinterpret_cast<const Quat *>(_data._mem);
+ if (p_index == CoreStringNames::singleton->x) {
+ return v->x;
+ } else if (p_index == CoreStringNames::singleton->y) {
+ return v->y;
+ } else if (p_index == CoreStringNames::singleton->z) {
+ return v->z;
+ } else if (p_index == CoreStringNames::singleton->w) {
+ return v->w;
+ }
+
+ } break; // 10
+ case RECT3: {
+
+ const Rect3 *v = _data._rect3;
+ //scalar name
+ if (p_index == CoreStringNames::singleton->position) {
+ return v->position;
+ } else if (p_index == CoreStringNames::singleton->size) {
+ return v->size;
+ } else if (p_index == CoreStringNames::singleton->end) {
+ return v->size + v->position;
+ }
+ } break;
+ case BASIS: {
+
+ const Basis *v = _data._basis;
+ //scalar name
+ if (p_index == CoreStringNames::singleton->x) {
+ return v->get_axis(0);
+ } else if (p_index == CoreStringNames::singleton->y) {
+ return v->get_axis(1);
+ } else if (p_index == CoreStringNames::singleton->z) {
+ return v->get_axis(2);
+ }
+
+ } break;
+ case TRANSFORM: {
+
+ if (p_index == CoreStringNames::singleton->basis) {
+ return _data._transform->basis;
+ } else if (p_index == CoreStringNames::singleton->origin) {
+ return _data._transform->origin;
+ }
+
+ } break;
+ case COLOR: {
+
+ const Color *v = reinterpret_cast<const Color *>(_data._mem);
+ if (p_index == CoreStringNames::singleton->r) {
+ return v->r;
+ } else if (p_index == CoreStringNames::singleton->g) {
+ return v->g;
+ } else if (p_index == CoreStringNames::singleton->b) {
+ return v->b;
+ } else if (p_index == CoreStringNames::singleton->a) {
+ return v->a;
+ } else if (p_index == CoreStringNames::singleton->r8) {
+ return v->r * 255.0;
+ } else if (p_index == CoreStringNames::singleton->g8) {
+ return v->g * 255.0;
+ } else if (p_index == CoreStringNames::singleton->b8) {
+ return v->b * 255.0;
+ } else if (p_index == CoreStringNames::singleton->a8) {
+ return v->a * 255.0;
+ } else if (p_index == CoreStringNames::singleton->h) {
+ return v->get_h();
+ } else if (p_index == CoreStringNames::singleton->s) {
+ return v->get_s();
+ } else if (p_index == CoreStringNames::singleton->v) {
+ return v->get_v();
+ }
+ } break;
+ case OBJECT: {
+
+#ifdef DEBUG_ENABLED
+ if (!_get_obj().obj) {
if (r_valid)
*r_valid = false;
- return "Attempted use of stray pointer object.";
+ return "Instance base is null.";
+ } else {
+
+ if (ScriptDebugger::get_singleton() && _get_obj().ref.is_null() && !ObjectDB::instance_validate(_get_obj().obj)) {
+ if (r_valid)
+ *r_valid = false;
+ return "Attempted use of stray pointer object.";
+ }
}
- }
#endif
- return _get_obj().obj->get(p_index, r_valid);
+ return _get_obj().obj->get(p_index, r_valid);
+
+ } break;
+ default: {
+ return get(p_index.operator String(), r_valid);
+ }
}
- return get(p_index.operator String(), r_valid);
+ if (r_valid) {
+ *r_valid = false;
+ }
+ return Variant();
}
#define DEFAULT_OP_ARRAY_CMD(m_name, m_type, skip_test, cmd) \
diff --git a/doc/classes/Area.xml b/doc/classes/Area.xml
index c59bbee084..8797575038 100644
--- a/doc/classes/Area.xml
+++ b/doc/classes/Area.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Area" inherits="CollisionObject" category="Core" version="3.0.alpha.custom_build">
<brief_description>
- General purpose area detection and influence for 3D physics.
+ General purpose area node for detection and 3D physics influence.
</brief_description>
<description>
- General purpose area detection for 3D physics. Areas can be used for detection of objects that enter/exit them, as well as overriding space parameters (changing gravity, damping, etc). For this, use any space override different from AREA_SPACE_OVERRIDE_DISABLE and point gravity at the center of mass.
+ 3D area that detects [CollisionObject] nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping).
</description>
<tutorials>
</tutorials>
@@ -88,14 +88,14 @@
<return type="Array">
</return>
<description>
- Return a list of the areas that are totally or partially inside this area.
+ Returns a list of intersecting [Area]\ s.
</description>
</method>
<method name="get_overlapping_bodies" qualifiers="const">
<return type="Array">
</return>
<description>
- Return a list of the bodies ([PhysicsBody]) that are totally or partially inside this area.
+ Returns a list of intersecting [PhysicsBody]\ s.
</description>
</method>
<method name="get_priority" qualifiers="const">
@@ -169,7 +169,7 @@
<argument index="0" name="area" type="Node">
</argument>
<description>
- Return whether the area passed is totally or partially inside this area.
+ If [code]true[/code] the given area overlaps the Area.
</description>
</method>
<method name="overlaps_body" qualifiers="const">
@@ -178,7 +178,7 @@
<argument index="0" name="body" type="Node">
</argument>
<description>
- Return whether the body passed is totally or partially inside this area.
+ If [code]true[/code] the given body overlaps the Area.
</description>
</method>
<method name="set_angular_damp">
@@ -374,30 +374,43 @@
</methods>
<members>
<member name="angular_damp" type="float" setter="set_angular_damp" getter="get_angular_damp">
+ The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. Values range from [code]0[/code] (no damping) to [code]1[/code] (full damping).
</member>
<member name="audio_bus_name" type="String" setter="set_audio_bus" getter="get_audio_bus">
+ The name of the area's audio bus.
</member>
<member name="audio_bus_override" type="bool" setter="set_audio_bus_override" getter="is_overriding_audio_bus">
+ If [code]true[/code] the area's audio bus overrides the default audio bus. Default value: [code]false[/code].
</member>
<member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer">
+ The area's physics layer(s). Collidable objects can exist in any of 32 different layers. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See also [code]collision_mask[/code].
</member>
<member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask">
+ The physics layers this area scans to determine collision detection.
</member>
<member name="gravity" type="float" setter="set_gravity" getter="get_gravity">
+ The area's gravity intensity (ranges from -1024 to 1024). This value multiplies the gravity vector. This is useful to alter the force of gravity without altering its direction.
</member>
<member name="gravity_distance_scale" type="float" setter="set_gravity_distance_scale" getter="get_gravity_distance_scale">
+ The falloff factor for point gravity. The greater the value, the faster gravity decreases with distance.
</member>
<member name="gravity_point" type="bool" setter="set_gravity_is_point" getter="is_gravity_a_point">
+ If [code]true[/code] gravity is calculated from a point (set via [code]gravity_vec[/code]). Also see [code]space_override[/code]. Default value: [code]false[/code].
</member>
<member name="gravity_vec" type="Vector3" setter="set_gravity_vector" getter="get_gravity_vector">
+ The area's gravity vector (not normalized). If gravity is a point (see [method is_gravity_a_point]), this will be the point of attraction.
</member>
<member name="linear_damp" type="float" setter="set_linear_damp" getter="get_linear_damp">
+ The rate at which objects stop moving in this area. Represents the linear velocity lost per second. Values range from [code]0[/code] (no damping) to [code]1[/code] (full damping).
</member>
<member name="monitorable" type="bool" setter="set_monitorable" getter="is_monitorable">
+ If [code]true[/code] other monitoring areas can detect this area. Default value: [code]true[/code].
</member>
<member name="monitoring" type="bool" setter="set_monitoring" getter="is_monitoring">
+ If [code]true[/code] the area detects bodies or areas entering and exiting it. Default value: [code]true[/code].
</member>
<member name="priority" type="float" setter="set_priority" getter="get_priority">
+ The area's priority. Higher priority areas are processed first. Default value: 0.
</member>
<member name="reverb_bus_amount" type="float" setter="set_reverb_amount" getter="get_reverb_amount">
</member>
@@ -408,6 +421,7 @@
<member name="reverb_bus_uniformity" type="float" setter="set_reverb_uniformity" getter="get_reverb_uniformity">
</member>
<member name="space_override" type="int" setter="set_space_override_mode" getter="get_space_override_mode" enum="Area.SpaceOverride">
+ Override mode for gravity and damping calculations within this area. See the SPACE_OVERRIDE_* constants for values.
</member>
</members>
<signals>
@@ -415,14 +429,14 @@
<argument index="0" name="area" type="Object">
</argument>
<description>
- This signal is triggered only once when an area enters this area. The only parameter passed is the area that entered this area.
+ Emitted when another area enters.
</description>
</signal>
<signal name="area_exited">
<argument index="0" name="area" type="Object">
</argument>
<description>
- This signal is triggered only once when an area exits this area. The only parameter passed is the area that exited this area.
+ Emitted when another area exits.
</description>
</signal>
<signal name="area_shape_entered">
@@ -435,7 +449,7 @@
<argument index="3" name="self_shape" type="int">
</argument>
<description>
- This signal triggers only once when an area enters this area. The first parameter is the area's [RID]. The second one is the area as an object. The third one is the index of the shape entering this area, and the fourth one is the index of the shape in this area that reported the entering.
+ Emitted when another area enters, reporting which areas overlapped.
</description>
</signal>
<signal name="area_shape_exited">
@@ -448,21 +462,21 @@
<argument index="3" name="self_shape" type="int">
</argument>
<description>
- This signal triggers only once when an area exits this area. The first parameter is the area's [RID]. The second one is the area as an object. The third one is the index of the shape entering this area, and the fourth one is the index of the shape in this area that reported the entering.
+ Emitted when another area exits, reporting which areas were overlapping.
</description>
</signal>
<signal name="body_entered">
<argument index="0" name="body" type="Object">
</argument>
<description>
- This signal is triggered only once when a body enters this area. The only parameter passed is the body that entered this area.
+ Emitted when a [PhysicsBody] object enters.
</description>
</signal>
<signal name="body_exited">
<argument index="0" name="body" type="Object">
</argument>
<description>
- This signal is triggered only once when a body exits this area. The only parameter passed is the body that exited this area.
+ Emitted when a [PhysicsBody2D] object exits.
</description>
</signal>
<signal name="body_shape_entered">
@@ -475,7 +489,7 @@
<argument index="3" name="area_shape" type="int">
</argument>
<description>
- This signal triggers only once when a body enters this area. The first parameter is the body's [RID]. The second one is the body as an object. The third one is the index of the shape of the body that entered this area, and the fourth one is the index of the shape in this area that reported the entering.
+ Emitted when a [PhysicsBody2D] object enters, reporting which shapes overlapped.
</description>
</signal>
<signal name="body_shape_exited">
@@ -488,20 +502,25 @@
<argument index="3" name="area_shape" type="int">
</argument>
<description>
- This signal triggers only once when a body exits this area. The first parameter is the body's [RID]. The second one is the body as an object. The third one is the index of the shape exiting this area, and the fourth one is the index of the shape in this area that reported the exit.
+ Emitted when a [PhysicsBody2D] object exits, reporting which shapes were overlapping.
</description>
</signal>
</signals>
<constants>
<constant name="SPACE_OVERRIDE_DISABLED" value="0">
+ This area does not affect gravity/damping.
</constant>
<constant name="SPACE_OVERRIDE_COMBINE" value="1">
+ This area adds its gravity/damping values to whatever has been calculated so far (in [code]priority[/code] order).
</constant>
<constant name="SPACE_OVERRIDE_COMBINE_REPLACE" value="2">
+ This area adds its gravity/damping values to whatever has been calculated so far (in [code]priority[/code] order), ignoring any lower priority areas.
</constant>
<constant name="SPACE_OVERRIDE_REPLACE" value="3">
+ This area replaces any gravity/damping, even the defaults, ignoring any lower priority areas.
</constant>
<constant name="SPACE_OVERRIDE_REPLACE_COMBINE" value="4">
+ This area replaces any gravity/damping calculated so far (in [code]priority[/code] order), but keeps calculating the rest of the areas.
</constant>
</constants>
</class>
diff --git a/doc/classes/Area2D.xml b/doc/classes/Area2D.xml
index cef5053289..0cbc079962 100644
--- a/doc/classes/Area2D.xml
+++ b/doc/classes/Area2D.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Area2D" inherits="CollisionObject2D" category="Core" version="3.0.alpha.custom_build">
<brief_description>
- 2D area that detects nodes that enter or exit it. Can override 2D physics properties within range.
+ 2D area for detection and 2D physics influence.
</brief_description>
<description>
- 2D area that detects nodes that enter or exit it. Change the 'space_override' property SPACE_OVERRIDE_* to override physics parameters for nodes like [Rigidbody2D]. E.g. gravity, damping... See [CollisionObject2D] for usage.
+ 2D area that detects [CollisionObject2D] nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping).
</description>
<tutorials>
</tutorials>
@@ -88,14 +88,14 @@
<return type="Array">
</return>
<description>
- Returns a list of the [Area2D]s that intersect with this area.
+ Returns a list of intersecting [Area2D]\ s.
</description>
</method>
<method name="get_overlapping_bodies" qualifiers="const">
<return type="Array">
</return>
<description>
- Return a list of the [PhysicsBody2D]s that intersect with this area.
+ Returns a list of intersecting [PhysicsBody2D]\ s.
</description>
</method>
<method name="get_priority" qualifiers="const">
@@ -145,7 +145,7 @@
<argument index="0" name="area" type="Node">
</argument>
<description>
- Return whether the area passed is totally or partially inside this area.
+ If [code]true[/code] the given area overlaps the Area2D.
</description>
</method>
<method name="overlaps_body" qualifiers="const">
@@ -154,7 +154,7 @@
<argument index="0" name="body" type="Node">
</argument>
<description>
- Return whether the body passed is totally or partially inside this area.
+ If [code]true[/code] the given body overlaps the Area2D.
</description>
</method>
<method name="set_angular_damp">
@@ -318,49 +318,46 @@
</methods>
<members>
<member name="angular_damp" type="float" setter="set_angular_damp" getter="get_angular_damp">
- The rate at which objects stop spinning in this area. Represents the amount of speed lost per second. If 1.0, physics bodies in the area stop rotating immediately. If 0.0, they never slow down. Does not incorporate external forces. The physics-update's rate affects 'angular_damp'.
+ The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. Values range from [code]0[/code] (no damping) to [code]1[/code] (full damping).
</member>
<member name="audio_bus_name" type="String" setter="set_audio_bus_name" getter="get_audio_bus_name">
- The name of the Area2D's audio bus.
+ The name of the area's audio bus.
</member>
<member name="audio_bus_override" type="bool" setter="set_audio_bus_override" getter="is_overriding_audio_bus">
- If [code]true[/code], overrides the default audio bus with the Area2D's. Defaults to [code]false[/code].
+ If [code]true[/code] the area's audio bus overrides the default audio bus. Default value: [code]false[/code].
</member>
<member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer">
- The physics layer this Area2D is in.
- Collidable objects can exist in any of 32 different layers. These layers are not visual, but more of a tagging system instead. A collidable can use these layers/tags to select with which objects it can collide, using [method set_collision_mask].
- A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans.
+ The area's physics layer(s). Collidable objects can exist in any of 32 different layers. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See also [code]collision_mask[/code].
</member>
<member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask">
- The physics layers this Area2D scans to determine collision detections.
+ The physics layers this area scans to determine collision detection.
</member>
<member name="gravity" type="float" setter="set_gravity" getter="get_gravity">
- The gravity intensity within the Area2D (ranges -1024 to 1024). This is useful to alter the force of gravity without altering its direction.
- This value multiplies the gravity vector, whether it is the given vector ([method set_gravity_vector]), or a calculated one (when using a center of gravity).
+ The area's gravity intensity (ranges from -1024 to 1024). This value multiplies the gravity vector. This is useful to alter the force of gravity without altering its direction.
</member>
<member name="gravity_distance_scale" type="float" setter="set_gravity_distance_scale" getter="get_gravity_distance_scale">
- The falloff factor for point gravity. The greater this value is, the faster the strength of gravity decreases with the square of distance.
+ The falloff factor for point gravity. The greater the value, the faster gravity decreases with distance.
</member>
<member name="gravity_point" type="bool" setter="set_gravity_is_point" getter="is_gravity_a_point">
- If [code]true[/code], calculates gravity from a particular point during a space override (see [method set_space_override_mode]). If a point, [Vector2] position is set with [method set_gravity_vector]. Defaults to [code]false[/code].
+ If [code]true[/code] gravity is calculated from a point (set via [code]gravity_vec[/code]). Also see [code]space_override[/code]. Default value: [code]false[/code].
</member>
<member name="gravity_vec" type="Vector2" setter="set_gravity_vector" getter="get_gravity_vector">
- The gravitational direction/strength as a vector (not normalized). If gravity is a point (see [method is_gravity_a_point]), this will be the attraction center.
+ The area's gravity vector (not normalized). If gravity is a point (see [method is_gravity_a_point]), this will be the point of attraction.
</member>
<member name="linear_damp" type="float" setter="set_linear_damp" getter="get_linear_damp">
- The rate at which objects stop spinning in this area. Represents the amount of speed lost per second. If 1.0, physics bodies in the area stop rotating immediately. If 0.0, they never slow down. Does not incorporate external forces. The physics-update's rate affects 'angular_damp'.
+ The rate at which objects stop moving in this area. Represents the linear velocity lost per second. Values range from [code]0[/code] (no damping) to [code]1[/code] (full damping).
</member>
<member name="monitorable" type="bool" setter="set_monitorable" getter="is_monitorable">
- If [code]true[/code], other monitoring areas can detect this Area2D (is it undetectable at the moment?). Defaults to [code]true[/code].
+ If [code]true[/code] other monitoring areas can detect this area. Default value: [code]true[/code].
</member>
<member name="monitoring" type="bool" setter="set_monitoring" getter="is_monitoring">
- If [code]true[/code], this detects bodies/areas entering/exiting it (can it detect others at the moment?). Defaults to [code]true[/code].
+ If [code]true[/code] the area detects bodies or areas entering and exiting it. Default value: [code]true[/code].
</member>
<member name="priority" type="float" setter="set_priority" getter="get_priority">
- The processing order for this priority. Ranges from 0 to 128. Defaults to 0. Higher priorities are processed first.
+ The area's priority. Higher priority areas are processed first. Default value: 0.
</member>
<member name="space_override" type="int" setter="set_space_override_mode" getter="get_space_override_mode" enum="Area2D.SpaceOverride">
- How to override gravity and damping calculations within this Area2D, if at all. Consult the SPACE_OVERRIDE_* constants for available options.
+ Override mode for gravity and damping calculations within this area. See the SPACE_OVERRIDE_* constants for values.
</member>
</members>
<signals>
@@ -368,14 +365,14 @@
<argument index="0" name="area" type="Object">
</argument>
<description>
- This signal is triggered only once when an area enters this area. The only parameter passed is the area that entered this area.
+ Emitted when another area enters.
</description>
</signal>
<signal name="area_exited">
<argument index="0" name="area" type="Object">
</argument>
<description>
- This signal is triggered only once when an area exits this area. The only parameter passed is the area that exited this area.
+ Emitted when another area exits.
</description>
</signal>
<signal name="area_shape_entered">
@@ -388,7 +385,7 @@
<argument index="3" name="self_shape" type="int">
</argument>
<description>
- This signal triggers only once when an area enters this area. The first parameter is the area's [RID]. The second one is the area as an object. The third one is the index of the shape entering this area, and the fourth one is the index of the shape in this area that reported the entering.
+ Emitted when another area enters, reporting which shapes overlapped.
</description>
</signal>
<signal name="area_shape_exited">
@@ -401,21 +398,21 @@
<argument index="3" name="self_shape" type="int">
</argument>
<description>
- This signal triggers only once when an area exits this area. The first parameter is the area's [RID]. The second one is the area as an object. The third one is the index of the shape entering this area, and the fourth one is the index of the shape in this area that reported the entering.
+ Emitted when another area exits, reporting which shapes were overlapping.
</description>
</signal>
<signal name="body_entered">
<argument index="0" name="body" type="Object">
</argument>
<description>
- This signal is triggered only once when a body enters this area. The only parameter passed is the body that entered this area.
+ Emitted when a [PhysicsBody2D] object enters.
</description>
</signal>
<signal name="body_exited">
<argument index="0" name="body" type="Object">
</argument>
<description>
- This signal is triggered only once when a body exits this area. The only parameter passed is the body that exited this area.
+ Emitted when a [PhysicsBody2D] object exits.
</description>
</signal>
<signal name="body_shape_entered">
@@ -428,7 +425,7 @@
<argument index="3" name="area_shape" type="int">
</argument>
<description>
- This signal triggers only once when a body enters this area. The first parameter is the body's [RID]. The second one is the body as an object. The third one is the index of the shape of the body that entered this area, and the fourth one is the index of the shape in this area that reported the entering.
+ Emitted when a [PhysicsBody2D] object enters, reporting which shapes overlapped.
</description>
</signal>
<signal name="body_shape_exited">
@@ -441,25 +438,25 @@
<argument index="3" name="area_shape" type="int">
</argument>
<description>
- This signal triggers only once when a body exits this area. The first parameter is the body's [RID]. The second one is the body as an object. The third one is the index of the shape exiting this area, and the fourth one is the index of the shape in this area that reported the exit.
+ Emitted when a [PhysicsBody2D] object exits, reporting which shapes were overlapping.
</description>
</signal>
</signals>
<constants>
<constant name="SPACE_OVERRIDE_DISABLED" value="0">
- This area does not affect gravity/damp. These are areas that exist only to detect collisions and objects entering or exiting them.
+ This area does not affect gravity/damping.
</constant>
<constant name="SPACE_OVERRIDE_COMBINE" value="1">
- This area adds its gravity/damp values to whatever has been calculated so far. This way, many overlapping areas can combine their physics to make interesting effects.
+ This area adds its gravity/damping values to whatever has been calculated so far (in [code]priority[/code] order).
</constant>
<constant name="SPACE_OVERRIDE_COMBINE_REPLACE" value="2">
- This area adds its gravity/damp values to whatever has been calculated so far. Then stops taking into account the rest of the areas, even the default one.
+ This area adds its gravity/damping values to whatever has been calculated so far (in [code]priority[/code] order), ignoring any lower priority areas.
</constant>
<constant name="SPACE_OVERRIDE_REPLACE" value="3">
- This area replaces any gravity/damp, even the default one, and stops taking into account the rest of the areas.
+ This area replaces any gravity/damping, even the defaults, ignoring any lower priority areas.
</constant>
<constant name="SPACE_OVERRIDE_REPLACE_COMBINE" value="4">
- This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the areas, down to the default one.
+ This area replaces any gravity/damping calculated so far (in [code]priority[/code] order), but keeps calculating the rest of the areas.
</constant>
</constants>
</class>
diff --git a/doc/classes/CollisionObject.xml b/doc/classes/CollisionObject.xml
index 98023a5898..64e9e07925 100644
--- a/doc/classes/CollisionObject.xml
+++ b/doc/classes/CollisionObject.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="CollisionObject" inherits="Spatial" category="Core" version="3.0.alpha.custom_build">
<brief_description>
+ Base node for collision objects.
</brief_description>
<description>
+ CollisionObject is the base class for physics objects. It can hold any number of collision [Shape]\ s. Each shape must be assigned to a [i]shape owner[/i]. The CollisionObject can have any number of shape owners. Shape owners are not nodes and do not appear in the editor, but are accessible through code using the [code]shape_owner_*[/code] methods.
</description>
<tutorials>
</tutorials>
@@ -31,7 +33,7 @@
<argument index="0" name="owner" type="Object">
</argument>
<description>
- Creates new holder for the shapes. Argument is a [CollisionShape] node. It will return owner_id which usually you will want to save for later use.
+ Creates a new shape owner for the given object. Returns [code]owner_id[/code] of the new owner for future reference.
</description>
</method>
<method name="get_capture_input_on_drag" qualifiers="const">
@@ -44,13 +46,14 @@
<return type="RID">
</return>
<description>
+ Returns the object's [RID].
</description>
</method>
<method name="get_shape_owners">
<return type="Array">
</return>
<description>
- Shape owner is a node which is holding concrete shape resources. This method will return an array which is holding an integer numbers that are representing unique ID of each owner. You can use those ids when you are using others shape_owner methods.
+ Returns an [Array] of [code]owner_id[/code] identifiers. You can use these ids in other methods that take [code]owner_id[/code] as an argument.
</description>
</method>
<method name="is_ray_pickable" qualifiers="const">
@@ -65,6 +68,7 @@
<argument index="0" name="owner_id" type="int">
</argument>
<description>
+ If [code]true[/code] the shape owner and its shapes are disabled.
</description>
</method>
<method name="remove_shape_owner">
@@ -73,6 +77,7 @@
<argument index="0" name="owner_id" type="int">
</argument>
<description>
+ Removes the given shape owner.
</description>
</method>
<method name="set_capture_input_on_drag">
@@ -97,6 +102,7 @@
<argument index="0" name="shape_index" type="int">
</argument>
<description>
+ Returns the [code]owner_id[/code] of the given shape.
</description>
</method>
<method name="shape_owner_add_shape">
@@ -107,6 +113,7 @@
<argument index="1" name="shape" type="Shape">
</argument>
<description>
+ Adds a [Shape] to the shape owner.
</description>
</method>
<method name="shape_owner_clear_shapes">
@@ -115,7 +122,7 @@
<argument index="0" name="owner_id" type="int">
</argument>
<description>
- Will remove all the shapes associated with given owner.
+ Removes all shapes from the shape owner.
</description>
</method>
<method name="shape_owner_get_owner" qualifiers="const">
@@ -124,6 +131,7 @@
<argument index="0" name="owner_id" type="int">
</argument>
<description>
+ Returns the parent object of the given shape owner.
</description>
</method>
<method name="shape_owner_get_shape" qualifiers="const">
@@ -134,7 +142,7 @@
<argument index="1" name="shape_id" type="int">
</argument>
<description>
- Will return a [Shape]. First argument owner_id is an integer that can be obtained from [method get_shape_owners]. Shape_id is a position of the shape inside owner; it's a value in range from 0 to [method shape_owner_get_shape_count].
+ Returns the [Shape] with the given id from the given shape owner.
</description>
</method>
<method name="shape_owner_get_shape_count" qualifiers="const">
@@ -143,7 +151,7 @@
<argument index="0" name="owner_id" type="int">
</argument>
<description>
- Returns number of shapes to which given owner is associated to.
+ Returns the number of shapes the given shape owner contains.
</description>
</method>
<method name="shape_owner_get_shape_index" qualifiers="const">
@@ -162,7 +170,7 @@
<argument index="0" name="owner_id" type="int">
</argument>
<description>
- Will return [Transform] of an owner node.
+ Returns the shape owner's [Transform].
</description>
</method>
<method name="shape_owner_remove_shape">
@@ -173,7 +181,7 @@
<argument index="1" name="shape_id" type="int">
</argument>
<description>
- Removes related shape from the owner.
+ Removes a shape from the given shape owner.
</description>
</method>
<method name="shape_owner_set_disabled">
@@ -184,6 +192,7 @@
<argument index="1" name="disabled" type="bool">
</argument>
<description>
+ If [code]true[/code] disables the given shape owner.
</description>
</method>
<method name="shape_owner_set_transform">
@@ -194,6 +203,7 @@
<argument index="1" name="transform" type="Transform">
</argument>
<description>
+ Sets the [Transform] of the given shape owner.
</description>
</method>
</methods>
@@ -220,10 +230,12 @@
</signal>
<signal name="mouse_entered">
<description>
+ Emitted when the mouse pointer enters any of this object's shapes.
</description>
</signal>
<signal name="mouse_exited">
<description>
+ Emitted when the mouse pointer exits all this object's shapes.
</description>
</signal>
</signals>
diff --git a/doc/classes/CollisionObject2D.xml b/doc/classes/CollisionObject2D.xml
index db1412805f..52743bd37d 100644
--- a/doc/classes/CollisionObject2D.xml
+++ b/doc/classes/CollisionObject2D.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="CollisionObject2D" inherits="Node2D" category="Core" version="3.0.alpha.custom_build">
<brief_description>
- Base node for 2D collisionables.
+ Base node for 2D collision objects.
</brief_description>
<description>
- CollisionObject2D is the base class for 2D physics collisionables. They can hold any number of 2D collision shapes. Usually, they are edited by placing [CollisionShape2D] and/or [CollisionPolygon2D] nodes as children. Such nodes are for reference and not present outside the editor, so code should use the regular shape API.
+ CollisionObject2D is the base class for 2D physics objects. It can hold any number of 2D collision [Shape2D]\ s. Each shape must be assigned to a [i]shape owner[/i]. The CollisionObject2D can have any number of shape owners. Shape owners are not nodes and do not appear in the editor, but are accessible through code using the [code]shape_owner_*[/code] methods.
</description>
<tutorials>
</tutorials>
@@ -29,21 +29,21 @@
<argument index="0" name="owner" type="Object">
</argument>
<description>
- Creates new holder for the shapes. Argument is a [CollisionShape2D] node. It will return owner_id which usually you will want to save for later use.
+ Creates a new shape owner for the given object. Returns [code]owner_id[/code] of the new owner for future reference.
</description>
</method>
<method name="get_rid" qualifiers="const">
<return type="RID">
</return>
<description>
- Return the RID of this object.
+ Returns the object's [RID].
</description>
</method>
<method name="get_shape_owners">
<return type="Array">
</return>
<description>
- Shape owner is a node which is holding concrete shape resources. This method will return an array which is holding an integer numbers that are representing unique ID of each owner. You can use those ids when you are using others shape_owner methods.
+ Returns an [Array] of [code]owner_id[/code] identifiers. You can use these ids in other methods that take [code]owner_id[/code] as an argument.
</description>
</method>
<method name="is_pickable" qualifiers="const">
@@ -59,6 +59,7 @@
<argument index="0" name="owner_id" type="int">
</argument>
<description>
+ If [code]true[/code] the shape owner and its shapes are disabled.
</description>
</method>
<method name="is_shape_owner_one_way_collision_enabled" qualifiers="const">
@@ -75,6 +76,7 @@
<argument index="0" name="owner_id" type="int">
</argument>
<description>
+ Removes the given shape owner.
</description>
</method>
<method name="set_pickable">
@@ -92,6 +94,7 @@
<argument index="0" name="shape_index" type="int">
</argument>
<description>
+ Returns the [code]owner_id[/code] of the given shape.
</description>
</method>
<method name="shape_owner_add_shape">
@@ -102,6 +105,7 @@
<argument index="1" name="shape" type="Shape2D">
</argument>
<description>
+ Adds a [Shape2D] to the shape owner.
</description>
</method>
<method name="shape_owner_clear_shapes">
@@ -110,7 +114,7 @@
<argument index="0" name="owner_id" type="int">
</argument>
<description>
- Will remove all the shapes associated with given owner.
+ Removes all shapes from the shape owner.
</description>
</method>
<method name="shape_owner_get_owner" qualifiers="const">
@@ -119,6 +123,7 @@
<argument index="0" name="owner_id" type="int">
</argument>
<description>
+ Returns the parent object of the given shape owner.
</description>
</method>
<method name="shape_owner_get_shape" qualifiers="const">
@@ -129,7 +134,7 @@
<argument index="1" name="shape_id" type="int">
</argument>
<description>
- Will return a [Shape2D]. First argument owner_id is an integer that can be obtained from [method get_shape_owners]. Shape_id is a position of the shape inside owner; it's a value in range from 0 to [method shape_owner_get_shape_count].
+ Returns the [Shape2D] with the given id from the given shape owner.
</description>
</method>
<method name="shape_owner_get_shape_count" qualifiers="const">
@@ -138,7 +143,7 @@
<argument index="0" name="owner_id" type="int">
</argument>
<description>
- Returns number of shapes to which given owner is associated to.
+ Returns the number of shapes the given shape owner contains.
</description>
</method>
<method name="shape_owner_get_shape_index" qualifiers="const">
@@ -157,7 +162,7 @@
<argument index="0" name="owner_id" type="int">
</argument>
<description>
- Will return [Transform2D] of an owner node.
+ Returns the shape owner's [Transform2D].
</description>
</method>
<method name="shape_owner_remove_shape">
@@ -168,7 +173,7 @@
<argument index="1" name="shape_id" type="int">
</argument>
<description>
- Removes related shape from the owner.
+ Removes a shape from the given shape owner.
</description>
</method>
<method name="shape_owner_set_disabled">
@@ -179,6 +184,7 @@
<argument index="1" name="disabled" type="bool">
</argument>
<description>
+ If [code]true[/code] disables the given shape owner.
</description>
</method>
<method name="shape_owner_set_one_way_collision">
@@ -199,11 +205,13 @@
<argument index="1" name="transform" type="Transform2D">
</argument>
<description>
+ Sets the [Transform2D] of the given shape owner.
</description>
</method>
</methods>
<members>
<member name="input_pickable" type="bool" setter="set_pickable" getter="is_pickable">
+ If [code]true[/code] this object is pickable. A pickable object can detect the mouse pointer entering/leaving, and if the mouse is inside it, report input events.
</member>
</members>
<signals>
@@ -215,16 +223,17 @@
<argument index="2" name="shape_idx" type="int">
</argument>
<description>
+ Emitted when an input event occurs and [code]input_pickable[/code] is [code]true[/code].
</description>
</signal>
<signal name="mouse_entered">
<description>
- This event fires only once when the mouse pointer enters any shape of this object.
+ Emitted when the mouse pointer enters any of this object's shapes.
</description>
</signal>
<signal name="mouse_exited">
<description>
- This event fires only once when the mouse pointer exits all shapes of this object.
+ Emitted when the mouse pointer exits all this object's shapes.
</description>
</signal>
</signals>
diff --git a/doc/classes/Range.xml b/doc/classes/Range.xml
index 9af6abf7b8..cd75c2b658 100644
--- a/doc/classes/Range.xml
+++ b/doc/classes/Range.xml
@@ -138,29 +138,38 @@
<argument index="0" name="with" type="Node">
</argument>
<description>
+ Binds two Ranges together along with any Ranges previously grouped with either of them. When any of Range's member variables change, it will share the new value with all other Ranges in its group.
</description>
</method>
<method name="unshare">
<return type="void">
</return>
<description>
+ Stop Range from sharing its member variables with any other Range.
</description>
</method>
</methods>
<members>
<member name="exp_edit" type="bool" setter="set_exp_ratio" getter="is_ratio_exp">
+ If [code]true[/code] and [code]min_value[/code] is greater than 0, [code]value[/code] will be represented exponentially rather than linearly.
</member>
<member name="max_value" type="float" setter="set_max" getter="get_max">
+ Maximum value. Range is clamped if [code]value[/code] is greater than [code]max_value[/code]. Default value: 100.
</member>
<member name="min_value" type="float" setter="set_min" getter="get_min">
+ Minimum value. Range is clamped if [code]value[/code] is less than [code]min_value[/code]. Default value: 0.
</member>
<member name="page" type="float" setter="set_page" getter="get_page">
+ Page size. Used mainly for [ScrollBar]. ScrollBar's length is its size multiplied by [code]page[/code] over the difference between [code]min_value[/code] and [code]max_value[/code].
</member>
<member name="rounded" type="bool" setter="set_use_rounded_values" getter="is_using_rounded_values">
+ If [code]true[/code], [code]value[/code] will always be rounded to the nearest integer.
</member>
<member name="step" type="float" setter="set_step" getter="get_step">
+ If greater than 0, [code]value[/code] will always be rounded to a multiple of [code]step[/code]. If [code]rounded[/code] is also [code]true[/code], [code]value[/code] will first be rounded to a multiple of [code]step[/code] then rounded to the nearest integer.
</member>
<member name="value" type="float" setter="set_value" getter="get_value">
+ Range's current value.
</member>
</members>
<signals>
diff --git a/doc/classes/SpriteFrames.xml b/doc/classes/SpriteFrames.xml
index f4a8eeabe4..e46fdc80e0 100644
--- a/doc/classes/SpriteFrames.xml
+++ b/doc/classes/SpriteFrames.xml
@@ -4,7 +4,7 @@
Sprite frame library for AnimatedSprite.
</brief_description>
<description>
- Sprite frame library for [AnimatedSprite].
+ Sprite frame library for [AnimatedSprite]. Contains frames and animation data for playback.
</description>
<tutorials>
</tutorials>
@@ -17,6 +17,7 @@
<argument index="0" name="anim" type="String">
</argument>
<description>
+ Adds a new animation to the the library.
</description>
</method>
<method name="add_frame">
@@ -29,6 +30,7 @@
<argument index="2" name="at_position" type="int" default="-1">
</argument>
<description>
+ Adds a frame to the given animation.
</description>
</method>
<method name="clear">
@@ -37,12 +39,14 @@
<argument index="0" name="anim" type="String">
</argument>
<description>
+ Removes all frames from the given animation.
</description>
</method>
<method name="clear_all">
<return type="void">
</return>
<description>
+ Removes all animations. A "default" animation will be created.
</description>
</method>
<method name="get_animation_loop" qualifiers="const">
@@ -51,6 +55,7 @@
<argument index="0" name="anim" type="String">
</argument>
<description>
+ If [code]true[/code] the given animation will loop.
</description>
</method>
<method name="get_animation_speed" qualifiers="const">
@@ -59,6 +64,7 @@
<argument index="0" name="anim" type="String">
</argument>
<description>
+ The animation's speed in frames per second.
</description>
</method>
<method name="get_frame" qualifiers="const">
@@ -69,6 +75,7 @@
<argument index="1" name="idx" type="int">
</argument>
<description>
+ Returns the animation's selected frame.
</description>
</method>
<method name="get_frame_count" qualifiers="const">
@@ -77,6 +84,7 @@
<argument index="0" name="anim" type="String">
</argument>
<description>
+ Returns the number of frames in the animation.
</description>
</method>
<method name="has_animation" qualifiers="const">
@@ -85,6 +93,7 @@
<argument index="0" name="anim" type="String">
</argument>
<description>
+ If [code]true[/code] the named animation exists.
</description>
</method>
<method name="remove_animation">
@@ -93,6 +102,7 @@
<argument index="0" name="anim" type="String">
</argument>
<description>
+ Removes the given animation.
</description>
</method>
<method name="remove_frame">
@@ -103,6 +113,7 @@
<argument index="1" name="idx" type="int">
</argument>
<description>
+ Removes the animation's selected frame.
</description>
</method>
<method name="rename_animation">
@@ -113,6 +124,7 @@
<argument index="1" name="newname" type="String">
</argument>
<description>
+ Changes the animation's name to [code]newname[/code].
</description>
</method>
<method name="set_animation_loop">
@@ -123,6 +135,7 @@
<argument index="1" name="loop" type="bool">
</argument>
<description>
+ If [code]true[/code] the animation will loop.
</description>
</method>
<method name="set_animation_speed">
@@ -133,6 +146,7 @@
<argument index="1" name="speed" type="float">
</argument>
<description>
+ The animation's speed in frames per second.
</description>
</method>
<method name="set_frame">
@@ -145,11 +159,13 @@
<argument index="2" name="txt" type="Texture">
</argument>
<description>
+ Sets the texture of the given frame.
</description>
</method>
</methods>
<members>
<member name="animations" type="Array" setter="_set_animations" getter="_get_animations">
+ An [Array] containing the [code]name[/code], [code]speed[/code], [code]loop[/code], and [code]frames[/code] of each animation.
</member>
<member name="frames" type="Array" setter="_set_frames" getter="_get_frames">
</member>
diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp
index b99817fb12..ae41a936c6 100644
--- a/drivers/gles3/rasterizer_storage_gles3.cpp
+++ b/drivers/gles3/rasterizer_storage_gles3.cpp
@@ -1564,6 +1564,7 @@ void RasterizerStorageGLES3::_update_shader(Shader *p_shader) const {
p_shader->canvas_item.blend_mode = Shader::CanvasItem::BLEND_MODE_MIX;
p_shader->canvas_item.uses_screen_texture = false;
p_shader->canvas_item.uses_screen_uv = false;
+ p_shader->canvas_item.uses_time = false;
shaders.actions_canvas.render_mode_values["blend_add"] = Pair<int *, int>(&p_shader->canvas_item.blend_mode, Shader::CanvasItem::BLEND_MODE_ADD);
shaders.actions_canvas.render_mode_values["blend_mix"] = Pair<int *, int>(&p_shader->canvas_item.blend_mode, Shader::CanvasItem::BLEND_MODE_MIX);
@@ -1595,6 +1596,7 @@ void RasterizerStorageGLES3::_update_shader(Shader *p_shader) const {
p_shader->spatial.unshaded = false;
p_shader->spatial.no_depth_test = false;
p_shader->spatial.uses_sss = false;
+ p_shader->spatial.uses_time = false;
p_shader->spatial.uses_vertex_lighting = false;
p_shader->spatial.uses_screen_texture = false;
p_shader->spatial.uses_vertex = false;
diff --git a/drivers/gles3/shader_compiler_gles3.cpp b/drivers/gles3/shader_compiler_gles3.cpp
index b3b2517ad6..9a5b53c84b 100644
--- a/drivers/gles3/shader_compiler_gles3.cpp
+++ b/drivers/gles3/shader_compiler_gles3.cpp
@@ -787,6 +787,7 @@ ShaderCompilerGLES3::ShaderCompilerGLES3() {
actions[VS::SHADER_SPATIAL].renames["SSS_STRENGTH"] = "sss_strength";
actions[VS::SHADER_SPATIAL].renames["TRANSMISSION"] = "transmission";
actions[VS::SHADER_SPATIAL].renames["AO"] = "ao";
+ actions[VS::SHADER_SPATIAL].renames["AO_LIGHT_AFFECT"] = "ao_light_affect";
actions[VS::SHADER_SPATIAL].renames["EMISSION"] = "emission";
//actions[VS::SHADER_SPATIAL].renames["SCREEN_UV"]=ShaderLanguage::TYPE_VEC2;
actions[VS::SHADER_SPATIAL].renames["POINT_COORD"] = "gl_PointCoord";
@@ -806,6 +807,7 @@ ShaderCompilerGLES3::ShaderCompilerGLES3() {
actions[VS::SHADER_SPATIAL].usage_defines["ANISOTROPY"] = "#define LIGHT_USE_ANISOTROPY\n";
actions[VS::SHADER_SPATIAL].usage_defines["ANISOTROPY_FLOW"] = "@ANISOTROPY";
actions[VS::SHADER_SPATIAL].usage_defines["AO"] = "#define ENABLE_AO\n";
+ actions[VS::SHADER_SPATIAL].usage_defines["AO_LIGHT_AFFECT"] = "#define ENABLE_AO\n";
actions[VS::SHADER_SPATIAL].usage_defines["UV"] = "#define ENABLE_UV_INTERP\n";
actions[VS::SHADER_SPATIAL].usage_defines["UV2"] = "#define ENABLE_UV2_INTERP\n";
actions[VS::SHADER_SPATIAL].usage_defines["NORMALMAP"] = "#define ENABLE_NORMALMAP\n";
diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl
index 0eb26ae58f..25115bc18a 100644
--- a/drivers/gles3/shaders/scene.glsl
+++ b/drivers/gles3/shaders/scene.glsl
@@ -1536,6 +1536,7 @@ void main() {
#if defined(ENABLE_AO)
float ao=1.0;
+ float ao_light_affect=0.0;
#endif
float alpha = 1.0;
@@ -1920,9 +1921,13 @@ FRAGMENT_SHADER_CODE
#if defined(ENABLE_AO)
ambient_light*=ao;
+ ao_light_affect = mix(1.0,ao,ao_light_affect);
+ specular_light*=ao_light_affect;
+ diffuse_light*=ao_light_affect;
#endif
+
//energu conservation
diffuse_light=mix(diffuse_light,vec3(0.0),metallic);
ambient_light=mix(ambient_light,vec3(0.0),metallic);
diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp
index 4caf2641fc..db12998dd2 100644
--- a/editor/editor_export.cpp
+++ b/editor/editor_export.cpp
@@ -273,6 +273,8 @@ void EditorExportPlatform::gen_debug_flags(Vector<String> &r_flags, int p_flags)
}
Error EditorExportPlatform::_save_pack_file(void *p_userdata, const String &p_path, const Vector<uint8_t> &p_data, int p_file, int p_total) {
+ if (p_path.ends_with(".so") || p_path.ends_with(".dylib") || p_path.ends_with(".dll"))
+ return OK;
PackData *pd = (PackData *)p_userdata;
diff --git a/editor/editor_fonts.cpp b/editor/editor_fonts.cpp
index 6e5726a16d..110b2a6a8c 100644
--- a/editor/editor_fonts.cpp
+++ b/editor/editor_fonts.cpp
@@ -158,6 +158,16 @@ void editor_register_fonts(Ref<Theme> p_theme) {
p_theme->set_font("doc_source", "EditorFonts", df_doc_code);
+ Ref<DynamicFont> df_output_code;
+ df_output_code.instance();
+ df_output_code->set_size(int(EDITOR_DEF("run/output/font_size", 13)) * EDSCALE);
+ df_output_code->set_spacing(DynamicFont::SPACING_TOP, -EDSCALE);
+ df_output_code->set_spacing(DynamicFont::SPACING_BOTTOM, -EDSCALE);
+ df_output_code->set_font_data(dfmono);
+ MAKE_FALLBACKS(df_output_code);
+
+ p_theme->set_font("output_source", "EditorFonts", df_output_code);
+
//replace default theme
Ref<Texture> di;
Ref<StyleBox> ds;
diff --git a/editor/editor_log.cpp b/editor/editor_log.cpp
index 481f2aaecf..3b20660013 100644
--- a/editor/editor_log.cpp
+++ b/editor/editor_log.cpp
@@ -31,6 +31,7 @@
#include "editor_node.h"
#include "scene/gui/center_container.h"
+#include "scene/resources/dynamic_font.h"
#include "version.h"
void EditorLog::_error_handler(void *p_self, const char *p_func, const char *p_file, int p_line, const char *p_error, const char *p_errorexp, ErrorHandlerType p_type) {
@@ -51,7 +52,6 @@ void EditorLog::_error_handler(void *p_self, const char *p_func, const char *p_f
self->emit_signal("show_request");
*/
- err_str = " " + err_str;
self->add_message(err_str, true);
}
@@ -60,6 +60,13 @@ void EditorLog::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE) {
//button->set_icon(get_icon("Console","EditorIcons"));
+ log->add_font_override("normal_font", get_font("output_source", "EditorFonts"));
+ } else if (p_what == NOTIFICATION_THEME_CHANGED) {
+ Ref<DynamicFont> df_output_code = get_font("output_source", "EditorFonts");
+ if (df_output_code.is_valid()) {
+ df_output_code->set_size(int(EDITOR_DEF("run/output/font_size", 13)) * EDSCALE);
+ log->add_font_override("normal_font", get_font("output_source", "EditorFonts"));
+ }
}
/*if (p_what==NOTIFICATION_DRAW) {
@@ -85,15 +92,13 @@ void EditorLog::clear() {
void EditorLog::add_message(const String &p_msg, bool p_error) {
- Ref<Font> doc_code_font = get_font("doc_source", "EditorFonts");
- log->push_font(doc_code_font);
-
log->add_newline();
if (p_error) {
log->push_color(get_color("error_color", "Editor"));
Ref<Texture> icon = get_icon("Error", "EditorIcons");
log->add_image(icon);
+ log->add_text(" ");
//button->set_icon(icon);
} else {
//button->set_icon(Ref<Texture>());
@@ -104,8 +109,6 @@ void EditorLog::add_message(const String &p_msg, bool p_error) {
if (p_error)
log->pop();
-
- log->pop(); // pop font;
}
/*
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index 02a9999eae..cec3bc7f2d 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -690,11 +690,11 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
hints["editors/3d/navigation_feel/orbit_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/orbit_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01");
set("editors/3d/navigation_feel/translation_inertia", 0.15);
hints["editors/3d/navigation_feel/translation_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/translation_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01");
- set("editors/3d/navigation_feel/zoom_inertia", 0.1);
+ set("editors/3d/navigation_feel/zoom_inertia", 0.075);
hints["editors/3d/navigation_feel/zoom_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/zoom_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01");
- set("editors/3d/navigation_feel/manipulation_orbit_inertia", 0.1);
+ set("editors/3d/navigation_feel/manipulation_orbit_inertia", 0.075);
hints["editors/3d/navigation_feel/manipulation_orbit_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/manipulation_orbit_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01");
- set("editors/3d/navigation_feel/manipulation_translation_inertia", 0.1);
+ set("editors/3d/navigation_feel/manipulation_translation_inertia", 0.075);
hints["editors/3d/navigation_feel/manipulation_translation_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/manipulation_translation_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01");
// freelook
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp
index 51fdef37cf..ca337551eb 100644
--- a/editor/editor_themes.cpp
+++ b/editor/editor_themes.cpp
@@ -802,7 +802,8 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
style_tooltip->set_bg_color(Color(mono_color.r, mono_color.g, mono_color.b, 0.9));
style_tooltip->set_border_width_all(border_width);
style_tooltip->set_border_color_all(mono_color);
- theme->set_color("font_color", "TooltipPanel", font_color);
+ theme->set_color("font_color", "TooltipLabel", font_color.inverted());
+ theme->set_color("font_color_shadow", "TooltipLabel", mono_color.inverted() * Color(1, 1, 1, 0.1));
theme->set_stylebox("panel", "TooltipPanel", style_tooltip);
// PopupPanel
diff --git a/editor/icons/icon_status_error.svg b/editor/icons/icon_status_error.svg
new file mode 100644
index 0000000000..4da9471835
--- /dev/null
+++ b/editor/icons/icon_status_error.svg
@@ -0,0 +1,7 @@
+<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
+<g transform="translate(0 -1036.4)">
+<g transform="translate(0 -1.6949e-5)">
+<path transform="translate(0 1036.4)" d="m8 1c-3.866 0-7 3.134-7 7 0 3.866 3.134 7 7 7 3.866 0 7-3.134 7-7 0-3.866-3.134-7-7-7zm-2.8281 2.7578l2.8281 2.8281 2.8281-2.8281 1.4141 1.4141-2.8281 2.8281 2.8281 2.8281-1.4141 1.4141-2.8281-2.8281-2.8281 2.8281-1.4141-1.4141 2.8281-2.8281-2.8281-2.8281 1.4141-1.4141z" fill="#ff5d5d"/>
+</g>
+</g>
+</svg>
diff --git a/editor/icons/icon_status_success.svg b/editor/icons/icon_status_success.svg
new file mode 100644
index 0000000000..6a6e2d6d30
--- /dev/null
+++ b/editor/icons/icon_status_success.svg
@@ -0,0 +1,7 @@
+<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
+<g transform="translate(0 -1036.4)">
+<g transform="translate(0 -1.6949e-5)">
+<path transform="translate(0 1036.4)" d="m8 1c-3.866 0-7 3.134-7 7 0 3.866 3.134 7 7 7 3.866 0 7-3.134 7-7 0-3.866-3.134-7-7-7zm3.293 3.877 1.4141 1.4141-5.707 5.709-3.707-3.709 1.4141-1.4141 2.293 2.293z" fill="#45ff8b"/>
+</g>
+</g>
+</svg>
diff --git a/editor/icons/icon_status_warning.svg b/editor/icons/icon_status_warning.svg
new file mode 100644
index 0000000000..f92021379d
--- /dev/null
+++ b/editor/icons/icon_status_warning.svg
@@ -0,0 +1,7 @@
+<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
+<g transform="translate(0 -1036.4)">
+<g transform="translate(0 -1.6949e-5)">
+<path transform="translate(0 1036.4)" d="m8 1a7 7 0 0 0 -7 7 7 7 0 0 0 7 7 7 7 0 0 0 7 -7 7 7 0 0 0 -7 -7zm-1 2h2v7h-2v-7zm0 8h2v2h-2v-2z" fill="#ffdd65"/>
+</g>
+</g>
+</svg>
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index c591bc733b..d3a0685777 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -3823,7 +3823,6 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
snap_config_menu = memnew(MenuButton);
hb->add_child(snap_config_menu);
- snap_config_menu->get_popup()->connect("id_pressed", this, "_popup_callback");
snap_config_menu->set_h_size_flags(SIZE_SHRINK_END);
snap_config_menu->set_tooltip(TTR("Snapping options"));
@@ -3877,7 +3876,6 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
p = skeleton_menu->get_popup();
p->set_hide_on_checkable_item_selection(false);
- p->connect("id_pressed", this, "_popup_callback");
p->add_shortcut(ED_SHORTCUT("canvas_item_editor/skeleton_make_bones", TTR("Make Bones"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_B), SKELETON_MAKE_BONES);
p->add_shortcut(ED_SHORTCUT("canvas_item_editor/skeleton_clear_bones", TTR("Clear Bones")), SKELETON_CLEAR_BONES);
p->add_separator();
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp
index 008dcac2c1..bfdbdda8fe 100644
--- a/editor/plugins/spatial_editor_plugin.cpp
+++ b/editor/plugins/spatial_editor_plugin.cpp
@@ -70,20 +70,17 @@
#define MAX_FOV 179
void SpatialEditorViewport::_update_camera(float p_interp_delta) {
- if (orthogonal) {
- //camera->set_orthogonal(size.width*cursor.distance,get_znear(),get_zfar());
- camera->set_orthogonal(2 * cursor.distance, 0.1, 8192);
- } else
- camera->set_perspective(get_fov(), get_znear(), get_zfar());
+
+ bool is_orthogonal = camera->get_projection() == Camera::PROJECTION_ORTHOGONAL;
//when not being manipulated, move softly
- float free_orbit_inertia = EDITOR_DEF("editors/3d/navigation_feel/orbit_inertia", 0.15);
- float free_translation_inertia = EDITOR_DEF("editors/3d/navigation_feel/translation_inertia", 0.15);
+ float free_orbit_inertia = EDITOR_GET("editors/3d/navigation_feel/orbit_inertia");
+ float free_translation_inertia = EDITOR_GET("editors/3d/navigation_feel/translation_inertia");
//when being manipulated, move more quickly
- float manip_orbit_inertia = EDITOR_DEF("editors/3d/navigation_feel/manipulation_orbit_inertia", 0.1);
- float manip_translation_inertia = EDITOR_DEF("editors/3d/navigation_feel/manipulation_translation_inertia", 0.1);
+ float manip_orbit_inertia = EDITOR_GET("editors/3d/navigation_feel/manipulation_orbit_inertia");
+ float manip_translation_inertia = EDITOR_GET("editors/3d/navigation_feel/manipulation_translation_inertia");
- float zoom_inertia = EDITOR_DEF("editors/3d/navigation_feel/zoom_inertia", 0.1);
+ float zoom_inertia = EDITOR_GET("editors/3d/navigation_feel/zoom_inertia");
//determine if being manipulated
bool manipulated = (Input::get_singleton()->get_mouse_button_mask() & (2 | 4)) || Input::get_singleton()->is_key_pressed(KEY_SHIFT) || Input::get_singleton()->is_key_pressed(KEY_ALT) || Input::get_singleton()->is_key_pressed(KEY_CONTROL);
@@ -104,21 +101,30 @@ void SpatialEditorViewport::_update_camera(float p_interp_delta) {
camera_cursor = cursor;
}
- float tolerance = 0.0001;
+ float tolerance = 0.001;
bool equal = true;
- if (Math::abs(old_camera_cursor.x_rot - camera_cursor.x_rot) > tolerance || Math::abs(old_camera_cursor.y_rot - camera_cursor.y_rot) > tolerance)
+ if (Math::abs(old_camera_cursor.x_rot - camera_cursor.x_rot) > tolerance || Math::abs(old_camera_cursor.y_rot - camera_cursor.y_rot) > tolerance) {
equal = false;
+ }
- if (equal && old_camera_cursor.pos.distance_squared_to(camera_cursor.pos) > tolerance * tolerance)
+ if (equal && old_camera_cursor.pos.distance_squared_to(camera_cursor.pos) > tolerance * tolerance) {
equal = false;
+ }
- if (equal && Math::abs(old_camera_cursor.distance - camera_cursor.distance) > tolerance)
+ if (equal && Math::abs(old_camera_cursor.distance - camera_cursor.distance) > tolerance) {
equal = false;
+ }
- if (!equal || p_interp_delta == 0 || is_freelook_active()) {
+ if (!equal || p_interp_delta == 0 || is_freelook_active() || is_orthogonal != orthogonal) {
camera->set_global_transform(to_camera_transform(camera_cursor));
update_transform_gizmo_view();
+
+ if (orthogonal) {
+ //camera->set_orthogonal(size.width*cursor.distance,get_znear(),get_zfar());
+ camera->set_orthogonal(2 * cursor.distance, 0.1, 8192);
+ } else
+ camera->set_perspective(get_fov(), get_znear(), get_zfar());
}
}
diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp
index b85ffd6c67..328d07d7a8 100644
--- a/editor/plugins/tile_map_editor_plugin.cpp
+++ b/editor/plugins/tile_map_editor_plugin.cpp
@@ -351,6 +351,10 @@ PoolVector<Vector2> TileMapEditor::_bucket_fill(const Point2i &p_start, bool era
return PoolVector<Vector2>();
}
+ if (id == prev_id) {
+ return PoolVector<Vector2>();
+ }
+
Rect2i r = node->get_item_rect();
r.position = r.position / node->get_cell_size();
r.size = r.size / node->get_cell_size();
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index f8f222ac2e..5ab0253d6d 100644
--- a/editor/project_manager.cpp
+++ b/editor/project_manager.cpp
@@ -51,9 +51,9 @@
#include "version.h"
#include "version_hash.gen.h"
-class NewProjectDialog : public ConfirmationDialog {
+class ProjectDialog : public ConfirmationDialog {
- GDCLASS(NewProjectDialog, ConfirmationDialog);
+ GDCLASS(ProjectDialog, ConfirmationDialog);
public:
enum Mode {
@@ -64,20 +64,56 @@ public:
};
private:
+ enum MessageType {
+ MESSAGE_ERROR,
+ MESSAGE_WARNING,
+ MESSAGE_SUCCESS
+ };
+
Mode mode;
Button *browse;
- Label *pp, *pn;
- Label *error;
+ Button *create_dir;
+ Container *name_container;
+ Container *path_container;
+ Label *msg;
LineEdit *project_path;
LineEdit *project_name;
+ ToolButton *status_btn;
FileDialog *fdialog;
String zip_path;
String zip_title;
AcceptDialog *dialog_error;
+ String fav_dir;
+
+ String created_folder_path;
+
+ void set_message(const String &p_msg, MessageType p_type = MESSAGE_SUCCESS) {
+ msg->set_text(p_msg);
+ if (p_msg == "") {
+ status_btn->set_icon(get_icon("StatusSuccess", "EditorIcons"));
+ return;
+ }
+ msg->hide();
+ switch (p_type) {
+ case MESSAGE_ERROR:
+ msg->add_color_override("font_color", get_color("error_color", "Editor"));
+ status_btn->set_icon(get_icon("StatusError", "EditorIcons"));
+ msg->show();
+ break;
+ case MESSAGE_WARNING:
+ msg->add_color_override("font_color", get_color("warning_color", "Editor"));
+ status_btn->set_icon(get_icon("StatusWarning", "EditorIcons"));
+ break;
+ case MESSAGE_SUCCESS:
+ msg->add_color_override("font_color", get_color("success_color", "Editor"));
+ status_btn->set_icon(get_icon("StatusSuccess", "EditorIcons"));
+ break;
+ }
+ }
String _test_path() {
- error->set_text("");
+ set_message(" ");
get_ok()->set_disabled(true);
DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
String valid_path;
@@ -88,7 +124,7 @@ private:
}
if (valid_path == "") {
- error->set_text(TTR("Invalid project path, the path must exist!"));
+ set_message(TTR("The path does not exists."), MESSAGE_ERROR);
memdelete(d);
return "";
}
@@ -97,16 +133,35 @@ private:
if (valid_path != "" && !d->file_exists("project.godot")) {
- error->set_text(TTR("Invalid project path, project.godot must exist."));
+ set_message(TTR("Please choose a 'project.godot' file."), MESSAGE_ERROR);
memdelete(d);
return "";
}
+ } else if (mode == MODE_NEW) {
+
+ // check if the specified folder is empty, even though this is not an error, it is good to check here
+ d->list_dir_begin();
+ bool is_empty = true;
+ String n = d->get_next();
+ while (n != String()) {
+ if (!n.begins_with(".")) { // i dont know if this is enough to guarantee an empty dir
+ is_empty = false;
+ break;
+ }
+ n = d->get_next();
+ }
+ d->list_dir_end();
+
+ if (!is_empty) {
+ set_message(TTR("Your project will be created in a non empty folder (you might want to create a new folder)."), MESSAGE_WARNING);
+ }
+
} else {
if (d->file_exists("project.godot")) {
- error->set_text(TTR("Invalid project path, project.godot must not exist."));
+ set_message(TTR("Please choose a folder that does not contain a 'project.godot' file."), MESSAGE_ERROR);
memdelete(d);
return "";
}
@@ -122,16 +177,23 @@ private:
String sp = _test_path();
if (sp != "") {
- sp = sp.replace("\\", "/");
- int lidx = sp.find_last("/");
+ // set the project name to the select folder name
+ if (project_name->get_text() == "") {
+ sp = sp.replace("\\", "/");
+ int lidx = sp.find_last("/");
- if (lidx != -1) {
- sp = sp.substr(lidx + 1, sp.length());
+ if (lidx != -1) {
+ sp = sp.substr(lidx + 1, sp.length());
+ }
+ if (sp == "" && mode == MODE_IMPORT)
+ sp = TTR("Imported Project");
+
+ project_name->set_text(sp);
}
- if (sp == "" && mode == MODE_IMPORT)
- sp = TTR("Imported Project");
+ }
- project_name->set_text(sp);
+ if (created_folder_path != "" && created_folder_path != p_path) {
+ _remove_created_folder();
}
}
@@ -140,13 +202,17 @@ private:
String p = p_path;
if (mode == MODE_IMPORT) {
if (p.ends_with("project.godot")) {
-
p = p.get_base_dir();
+ get_ok()->set_disabled(false);
+ } else {
+ set_message(TTR("Please choose a 'project.godot' file."), MESSAGE_ERROR);
+ get_ok()->set_disabled(true);
+ return;
}
}
String sp = p.simplify_path();
project_path->set_text(sp);
- _path_text_changed(sp);
+ set_message(TTR(" ")); // just so it does not disappear
get_ok()->call_deferred("grab_focus");
}
@@ -155,12 +221,13 @@ private:
String p = p_path;
String sp = p.simplify_path();
project_path->set_text(sp);
- _path_text_changed(sp);
get_ok()->call_deferred("grab_focus");
}
void _browse_path() {
+ fdialog->set_current_dir(project_path->get_text());
+
if (mode == MODE_IMPORT) {
fdialog->set_mode(FileDialog::MODE_OPEN_FILE);
@@ -172,34 +239,46 @@ private:
fdialog->popup_centered_ratio();
}
- void _text_changed(const String &p_text) {
- _test_path();
- error->set_text("");
- if (p_text == "") {
+ void _create_folder() {
- error->set_text(TTR("Name cannot be empty"));
- get_ok()->set_disabled(true);
+ if (project_name->get_text() == "" || created_folder_path != "") {
return;
}
- get_ok()->set_disabled(false);
+
+ DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
+ if (d->change_dir(project_path->get_text()) == OK) {
+ if (!d->dir_exists(project_name->get_text())) {
+ if (d->make_dir(project_name->get_text()) == OK) {
+ d->change_dir(project_name->get_text());
+ project_path->set_text(d->get_current_dir());
+ created_folder_path = d->get_current_dir();
+ create_dir->set_disabled(true);
+ }
+ }
+ }
+ memdelete(d);
}
- void _name_changed(const String &p_text) {
+ void _text_changed(const String &p_text) {
+
+ if (mode != MODE_NEW)
+ return;
+
+ _test_path();
+
+ if (p_text == "")
+ set_message(TTR("It would be a good idea to name your project."), MESSAGE_WARNING);
}
void ok_pressed() {
- String dir = _test_path();
- if (dir == "") {
- error->set_text(TTR("Invalid project path (changed anything?)."));
- return;
- }
+ String dir = project_path->get_text();
if (mode == MODE_RENAME) {
String dir = _test_path();
if (dir == "") {
- error->set_text(TTR("Invalid project path (changed anything?)."));
+ set_message(TTR("Invalid project path (changed anything?)."), MESSAGE_ERROR);
return;
}
@@ -207,13 +286,13 @@ private:
current->add_singleton(ProjectSettings::Singleton("Current"));
if (current->setup(dir, "")) {
- error->set_text(TTR("Couldn't get project.godot in project path."));
+ set_message(TTR("Couldn't get project.godot in project path."), MESSAGE_ERROR);
} else {
ProjectSettings::CustomMap edited_settings;
edited_settings["application/config/name"] = project_name->get_text();
if (current->save_custom(dir.plus_file("/project.godot"), edited_settings, Vector<String>(), true)) {
- error->set_text(TTR("Couldn't edit project.godot in project path."));
+ set_message(TTR("Couldn't edit project.godot in project path."), MESSAGE_ERROR);
}
}
@@ -232,13 +311,13 @@ private:
initial_settings["rendering/environment/default_environment"] = "res://default_env.tres";
if (ProjectSettings::get_singleton()->save_custom(dir.plus_file("/project.godot"), initial_settings, Vector<String>(), false)) {
- error->set_text(TTR("Couldn't create project.godot in project path."));
+ set_message(TTR("Couldn't create project.godot in project path."), MESSAGE_ERROR);
} else {
ResourceSaver::save(dir.plus_file("/icon.png"), get_icon("DefaultProjectIcon", "EditorIcons"));
FileAccess *f = FileAccess::open(dir.plus_file("/default_env.tres"), FileAccess::WRITE);
if (!f) {
- error->set_text(TTR("Couldn't create project.godot in project path."));
+ set_message(TTR("Couldn't create project.godot in project path."), MESSAGE_ERROR);
} else {
f->store_line("[gd_resource type=\"Environment\" load_steps=2 format=2]");
f->store_line("[sub_resource type=\"ProceduralSky\" id=1]");
@@ -356,14 +435,40 @@ private:
}
}
+ void _remove_created_folder() {
+
+ if (created_folder_path != "") {
+ DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
+ d->remove(created_folder_path);
+ memdelete(d);
+
+ create_dir->set_disabled(false);
+ created_folder_path = "";
+ }
+ }
+
+ void _toggle_message() {
+ msg->set_visible(!msg->is_visible());
+ }
+
+ void cancel_pressed() {
+
+ _remove_created_folder();
+
+ project_path->clear();
+ project_name->clear();
+ }
+
protected:
static void _bind_methods() {
- ClassDB::bind_method("_browse_path", &NewProjectDialog::_browse_path);
- ClassDB::bind_method("_text_changed", &NewProjectDialog::_text_changed);
- ClassDB::bind_method("_path_text_changed", &NewProjectDialog::_path_text_changed);
- ClassDB::bind_method("_path_selected", &NewProjectDialog::_path_selected);
- ClassDB::bind_method("_file_selected", &NewProjectDialog::_file_selected);
+ ClassDB::bind_method("_browse_path", &ProjectDialog::_browse_path);
+ ClassDB::bind_method("_create_folder", &ProjectDialog::_create_folder);
+ ClassDB::bind_method("_text_changed", &ProjectDialog::_text_changed);
+ ClassDB::bind_method("_path_text_changed", &ProjectDialog::_path_text_changed);
+ ClassDB::bind_method("_path_selected", &ProjectDialog::_path_selected);
+ ClassDB::bind_method("_file_selected", &ProjectDialog::_file_selected);
+ ClassDB::bind_method("_toggle_message", &ProjectDialog::_toggle_message);
ADD_SIGNAL(MethodInfo("project_created"));
ADD_SIGNAL(MethodInfo("project_renamed"));
}
@@ -390,129 +495,129 @@ public:
if (mode == MODE_RENAME) {
project_path->set_editable(false);
- browse->set_disabled(true);
+ browse->hide();
set_title(TTR("Rename Project"));
get_ok()->set_text(TTR("Rename"));
- pp->set_text(TTR("Project Path:"));
- pn->set_text(TTR("Project Name:"));
- pn->show();
- project_name->show();
+ name_container->show();
- String dir = _test_path();
- if (dir == "") {
- error->set_text(TTR("Invalid project path (changed anything?)."));
- return;
- }
ProjectSettings *current = memnew(ProjectSettings);
current->add_singleton(ProjectSettings::Singleton("Current"));
- if (current->setup(dir, "")) {
- error->set_text(TTR("Couldn't get project.godot in project path."));
- } else {
- if (current->has("application/config/name")) {
- String appname = current->get("application/config/name");
- project_name->set_text(appname);
- }
+ if (current->setup(project_path->get_text(), "")) {
+ set_message(TTR("Couldn't get project.godot in the project path."), MESSAGE_ERROR);
+ } else if (current->has("application/config/name")) {
+ project_name->set_text(current->get("application/config/name"));
}
-
- popup_centered(Size2(500, 125) * EDSCALE);
project_name->grab_focus();
+ create_dir->hide();
+ status_btn->hide();
+
} else {
- project_path->clear();
- project_name->clear();
+ fav_dir = EditorSettings::get_singleton()->get("filesystem/directories/default_project_path");
+ if (fav_dir != "") {
+ project_path->set_text(fav_dir);
+ fdialog->set_current_dir(fav_dir);
+ } else {
+ DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
+ project_path->set_text(d->get_current_dir());
+ fdialog->set_current_dir(d->get_current_dir());
+ memdelete(d);
+ }
+ project_name->set_text(TTR("New Game Project"));
+
project_path->set_editable(true);
browse->set_disabled(false);
+ browse->show();
+ create_dir->show();
+ status_btn->show();
if (mode == MODE_IMPORT) {
set_title(TTR("Import Existing Project"));
get_ok()->set_text(TTR("Import"));
- pp->set_text(TTR("Project Path (Must Exist):"));
- pn->set_text(TTR("Project Name:"));
- pn->hide();
- project_name->hide();
-
- popup_centered(Size2(500, 125) * EDSCALE);
+ name_container->hide();
+ project_path->grab_focus();
} else if (mode == MODE_NEW) {
set_title(TTR("Create New Project"));
get_ok()->set_text(TTR("Create"));
- pp->set_text(TTR("Project Path:"));
- pn->set_text(TTR("Project Name:"));
- pn->show();
- project_name->show();
+ name_container->show();
+ project_name->grab_focus();
- popup_centered(Size2(500, 145) * EDSCALE);
} else if (mode == MODE_INSTALL) {
set_title(TTR("Install Project:") + " " + zip_title);
get_ok()->set_text(TTR("Install"));
- pp->set_text(TTR("Project Path:"));
- pn->hide();
- project_name->hide();
-
- popup_centered(Size2(500, 125) * EDSCALE);
+ name_container->hide();
+ project_path->grab_focus();
}
- project_path->grab_focus();
_test_path();
}
+
+ popup_centered(Size2(500, 125) * EDSCALE);
}
- NewProjectDialog() {
+ ProjectDialog() {
VBoxContainer *vb = memnew(VBoxContainer);
add_child(vb);
- //set_child_rect(vb);
+
+ name_container = memnew(VBoxContainer);
+ vb->add_child(name_container);
Label *l = memnew(Label);
+ l->set_text(TTR("Project Name:"));
+ name_container->add_child(l);
+
+ HBoxContainer *pnhb = memnew(HBoxContainer);
+ name_container->add_child(pnhb);
+
+ project_name = memnew(LineEdit);
+ project_name->set_h_size_flags(SIZE_EXPAND_FILL);
+ pnhb->add_child(project_name);
+
+ create_dir = memnew(Button);
+ pnhb->add_child(create_dir);
+ create_dir->set_text(TTR("Create folder"));
+ create_dir->connect("pressed", this, "_create_folder");
+
+ path_container = memnew(VBoxContainer);
+ vb->add_child(path_container);
+
+ l = memnew(Label);
l->set_text(TTR("Project Path:"));
- vb->add_child(l);
- pp = l;
+ path_container->add_child(l);
- project_path = memnew(LineEdit);
- MarginContainer *mc = memnew(MarginContainer);
- vb->add_child(mc);
HBoxContainer *pphb = memnew(HBoxContainer);
- mc->add_child(pphb);
- pphb->add_child(project_path);
+ path_container->add_child(pphb);
+
+ project_path = memnew(LineEdit);
project_path->set_h_size_flags(SIZE_EXPAND_FILL);
+ pphb->add_child(project_path);
+
+ // status button
+ status_btn = memnew(ToolButton);
+ status_btn->connect("pressed", this, "_toggle_message");
+ pphb->add_child(status_btn);
browse = memnew(Button);
- pphb->add_child(browse);
browse->set_text(TTR("Browse"));
browse->connect("pressed", this, "_browse_path");
+ pphb->add_child(browse);
- l = memnew(Label);
- l->set_text(TTR("Project Name:"));
- l->set_position(Point2(5, 50));
- vb->add_child(l);
- pn = l;
-
- project_name = memnew(LineEdit);
- mc = memnew(MarginContainer);
- vb->add_child(mc);
- mc->add_child(project_name);
- project_name->set_text(TTR("New Game Project"));
-
- l = memnew(Label);
- l->set_text(TTR("That's a BINGO!"));
- vb->add_child(l);
- error = l;
- l->add_color_override("font_color", Color(1, 0.4, 0.3, 0.8));
- l->set_align(Label::ALIGN_CENTER);
-
- DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
- project_path->set_text(d->get_current_dir());
- memdelete(d);
+ msg = memnew(Label);
+ msg->set_text(TTR("That's a BINGO!"));
+ msg->set_align(Label::ALIGN_CENTER);
+ msg->hide();
+ vb->add_child(msg);
fdialog = memnew(FileDialog);
- add_child(fdialog);
fdialog->set_access(FileDialog::ACCESS_FILESYSTEM);
- fdialog->set_current_dir(EditorSettings::get_singleton()->get("filesystem/directories/default_project_path"));
+ add_child(fdialog);
project_name->connect("text_changed", this, "_text_changed");
project_path->connect("text_changed", this, "_path_text_changed");
fdialog->connect("dir_selected", this, "_path_selected");
@@ -564,7 +669,7 @@ void ProjectManager::_panel_draw(Node *p_hb) {
hb->draw_line(Point2(0, hb->get_size().y + 1), Point2(hb->get_size().x - 10, hb->get_size().y + 1), get_color("guide_color", "Tree"));
if (selected_list.has(hb->get_meta("name"))) {
- hb->draw_style_box(gui_base->get_stylebox("selected", "Tree"), Rect2(Point2(), hb->get_size() - Size2(10, 0)));
+ hb->draw_style_box(gui_base->get_stylebox("selected", "Tree"), Rect2(Point2(), hb->get_size() - Size2(10, 0) * EDSCALE));
}
}
@@ -1168,13 +1273,13 @@ void ProjectManager::_scan_projects() {
void ProjectManager::_new_project() {
- npdialog->set_mode(NewProjectDialog::MODE_NEW);
+ npdialog->set_mode(ProjectDialog::MODE_NEW);
npdialog->show_dialog();
}
void ProjectManager::_import_project() {
- npdialog->set_mode(NewProjectDialog::MODE_IMPORT);
+ npdialog->set_mode(ProjectDialog::MODE_IMPORT);
npdialog->show_dialog();
}
@@ -1188,7 +1293,7 @@ void ProjectManager::_rename_project() {
const String &selected = E->key();
String path = EditorSettings::get_singleton()->get("projects/" + selected);
npdialog->set_project_path(path);
- npdialog->set_mode(NewProjectDialog::MODE_RENAME);
+ npdialog->set_mode(ProjectDialog::MODE_RENAME);
npdialog->show_dialog();
}
}
@@ -1224,7 +1329,7 @@ void ProjectManager::_exit_dialog() {
void ProjectManager::_install_project(const String &p_zip_path, const String &p_title) {
- npdialog->set_mode(NewProjectDialog::MODE_INSTALL);
+ npdialog->set_mode(ProjectDialog::MODE_INSTALL);
npdialog->set_zip_path(p_zip_path);
npdialog->set_zip_title(p_title);
npdialog->show_dialog();
@@ -1511,7 +1616,7 @@ ProjectManager::ProjectManager() {
OS::get_singleton()->set_low_processor_usage_mode(true);
- npdialog = memnew(NewProjectDialog);
+ npdialog = memnew(ProjectDialog);
gui_base->add_child(npdialog);
npdialog->connect("project_renamed", this, "_on_project_renamed");
diff --git a/editor/project_manager.h b/editor/project_manager.h
index 8a3e7c0457..bfae0b2297 100644
--- a/editor/project_manager.h
+++ b/editor/project_manager.h
@@ -37,7 +37,7 @@
#include "scene/gui/tool_button.h"
#include "scene/gui/tree.h"
-class NewProjectDialog;
+class ProjectDialog;
class ProjectListFilter;
class ProjectManager : public Control {
@@ -60,7 +60,7 @@ class ProjectManager : public Control {
ConfirmationDialog *multi_scan_ask;
AcceptDialog *run_error_diag;
AcceptDialog *dialog_error;
- NewProjectDialog *npdialog;
+ ProjectDialog *npdialog;
ScrollContainer *scroll;
VBoxContainer *scroll_childs;
Map<String, String> selected_list; // name -> main_scene
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp
index 76e75cff0a..d71bc1838b 100644
--- a/editor/script_editor_debugger.cpp
+++ b/editor/script_editor_debugger.cpp
@@ -1065,7 +1065,7 @@ void ScriptEditorDebugger::start() {
int remote_port = (int)EditorSettings::get_singleton()->get("network/debug/remote_port");
if (server->listen(remote_port) != OK) {
- EditorNode::get_log()->add_message(String("** Error listening on port ") + itos(remote_port) + String(" **"));
+ EditorNode::get_log()->add_message(String("Error listening on port ") + itos(remote_port), true);
return;
}
set_process(true);
diff --git a/main/main.cpp b/main/main.cpp
index 1f7418ba2a..9096b935c2 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -74,6 +74,7 @@
#include "performance.h"
#include "translation.h"
#include "version.h"
+#include "version_hash.gen.h"
static ProjectSettings *globals = NULL;
static Engine *engine = NULL;
@@ -122,6 +123,14 @@ static String unescape_cmdline(const String &p_str) {
return p_str.replace("%20", " ");
}
+static String get_full_version_string() {
+
+ String hash = String(VERSION_HASH);
+ if (hash.length() != 0)
+ hash = "." + hash.left(7);
+ return String(VERSION_MKSTRING) + hash;
+}
+
//#define DEBUG_INIT
#ifdef DEBUG_INIT
@@ -132,7 +141,7 @@ static String unescape_cmdline(const String &p_str) {
void Main::print_help(const char *p_binary) {
- OS::get_singleton()->print(VERSION_FULL_NAME " - https://godotengine.org\n");
+ print_line(String(_MKSTR(VERSION_NAME)) + " v" + get_full_version_string() + " - https://godotengine.org");
OS::get_singleton()->print("(c) 2007-2017 Juan Linietsky, Ariel Manzur.\n");
OS::get_singleton()->print("(c) 2014-2017 Godot Engine contributors.\n");
OS::get_singleton()->print("\n");
@@ -141,6 +150,7 @@ void Main::print_help(const char *p_binary) {
OS::get_singleton()->print("General options:\n");
OS::get_singleton()->print(" -h, --help Display this help message.\n");
+ OS::get_singleton()->print(" --version Display the version string.\n");
OS::get_singleton()->print(" -v, --verbose Use verbose stdout mode.\n");
OS::get_singleton()->print(" --quiet Quiet mode, silences stdout messages. Errors are still displayed.\n");
OS::get_singleton()->print("\n");
@@ -195,7 +205,7 @@ void Main::print_help(const char *p_binary) {
OS::get_singleton()->print(" --time-scale <scale> Force time scale (higher values are faster, 1.0 is normal speed).\n");
OS::get_singleton()->print(" --disable-render-loop Disable render loop so rendering only occurs when called explicitly from script.\n");
OS::get_singleton()->print(" --disable-crash-handler Disable crash handler when supported by the platform code.\n");
- OS::get_singleton()->print(" --fixed-fps <fps> Forces a fixed ratio between process and fixed_process timing, for use when precision is required, or when rendering to video files. Setting this will disable real-time syncronization, so that run speed is only capped by performance\n");
+ OS::get_singleton()->print(" --fixed-fps <fps> Force a fixed number of frames per second. This setting disables real-time synchronization.\n");
OS::get_singleton()->print("\n");
OS::get_singleton()->print("Standalone tools:\n");
@@ -203,7 +213,7 @@ void Main::print_help(const char *p_binary) {
#ifdef TOOLS_ENABLED
OS::get_singleton()->print(" --export <target> Export the project using the given export target.\n");
OS::get_singleton()->print(" --export-debug Use together with --export, enables debug mode for the template.\n");
- OS::get_singleton()->print(" --doctool <file> Dump the whole engine API to <file> in XML format. If <file> exists, it will be merged.\n");
+ OS::get_singleton()->print(" --doctool <path> Dump the engine API reference to the given <path> in XML format, merging if existing files are found.\n");
OS::get_singleton()->print(" --no-docbase Disallow dumping the base types (used with --doctool).\n");
#ifdef DEBUG_METHODS_ENABLED
OS::get_singleton()->print(" --gdnative-generate-json-api Generate JSON dump of the Godot API for GDNative bindings.\n");
@@ -268,7 +278,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
while (I) {
I->get() = unescape_cmdline(I->get().strip_escapes());
- //print_line("CMD: "+I->get());
I = I->next();
}
@@ -318,6 +327,11 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
show_help = true;
goto error;
+ } else if (I->get() == "--version") {
+
+ print_line(get_full_version_string());
+ goto error;
+
} else if (I->get() == "--resolution") { // force resolution
if (I->next()) {
diff --git a/misc/dist/ios_xcode/export_options.plist b/misc/dist/ios_xcode/export_options.plist
new file mode 100644
index 0000000000..86d89a6e42
--- /dev/null
+++ b/misc/dist/ios_xcode/export_options.plist
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>method</key>
+ <string>$export_method</string>
+ <key>teamID</key>
+ <string>$team_id</string>
+</dict>
+</plist> \ No newline at end of file
diff --git a/misc/dist/ios_xcode/godot_debug.iphone b/misc/dist/ios_xcode/godot.iphone.debug.arm
index e69de29bb2..e69de29bb2 100755
--- a/misc/dist/ios_xcode/godot_debug.iphone
+++ b/misc/dist/ios_xcode/godot.iphone.debug.arm
diff --git a/misc/dist/ios_xcode/godot_opt.iphone b/misc/dist/ios_xcode/godot.iphone.debug.arm64
index e69de29bb2..e69de29bb2 100755
--- a/misc/dist/ios_xcode/godot_opt.iphone
+++ b/misc/dist/ios_xcode/godot.iphone.debug.arm64
diff --git a/misc/dist/ios_xcode/godot.iphone.debug.fat b/misc/dist/ios_xcode/godot.iphone.debug.fat
new file mode 100755
index 0000000000..e69de29bb2
--- /dev/null
+++ b/misc/dist/ios_xcode/godot.iphone.debug.fat
diff --git a/misc/dist/ios_xcode/godot.iphone.release.arm b/misc/dist/ios_xcode/godot.iphone.release.arm
new file mode 100755
index 0000000000..e69de29bb2
--- /dev/null
+++ b/misc/dist/ios_xcode/godot.iphone.release.arm
diff --git a/misc/dist/ios_xcode/godot.iphone.release.arm64 b/misc/dist/ios_xcode/godot.iphone.release.arm64
new file mode 100755
index 0000000000..e69de29bb2
--- /dev/null
+++ b/misc/dist/ios_xcode/godot.iphone.release.arm64
diff --git a/misc/dist/ios_xcode/godot.iphone.release.fat b/misc/dist/ios_xcode/godot.iphone.release.fat
new file mode 100755
index 0000000000..e69de29bb2
--- /dev/null
+++ b/misc/dist/ios_xcode/godot.iphone.release.fat
diff --git a/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj b/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj
index bdba8488c8..3f2db94193 100644
--- a/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj
+++ b/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj
@@ -7,18 +7,17 @@
objects = {
/* Begin PBXBuildFile section */
- D07CD43F1C5D573600B7FB28 /* Default-568h@2x~iphone.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD4331C5D573600B7FB28 /* Default-568h@2x~iphone.png */; };
- D07CD4401C5D573600B7FB28 /* Default-667h.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD4341C5D573600B7FB28 /* Default-667h.png */; };
+ 1F1575721F582BE20003B888 /* dylibs in Resources */ = {isa = PBXBuildFile; fileRef = 1F1575711F582BE20003B888 /* dylibs */; };
+ 1FF4C1851F584E3F00A41E41 /* GameKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FF4C1841F584E3F00A41E41 /* GameKit.framework */; };
+ 1FF4C1871F584E5600A41E41 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FF4C1861F584E5600A41E41 /* StoreKit.framework */; };
+ D07CD43F1C5D573600B7FB28 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD4331C5D573600B7FB28 /* Default-568h@2x.png */; };
D07CD4411C5D573600B7FB28 /* Default-667h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD4351C5D573600B7FB28 /* Default-667h@2x.png */; };
- D07CD4421C5D573600B7FB28 /* Default-736h.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD4361C5D573600B7FB28 /* Default-736h.png */; };
- D07CD4431C5D573600B7FB28 /* Default-736h@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD4371C5D573600B7FB28 /* Default-736h@3x.png */; };
- D07CD4441C5D573600B7FB28 /* Default-Landscape-736h.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD4381C5D573600B7FB28 /* Default-Landscape-736h.png */; };
- D07CD4451C5D573600B7FB28 /* Default-Landscape@2x~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD4391C5D573600B7FB28 /* Default-Landscape@2x~ipad.png */; };
- D07CD4461C5D573600B7FB28 /* Default-Landscape~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD43A1C5D573600B7FB28 /* Default-Landscape~ipad.png */; };
- D07CD4471C5D573600B7FB28 /* Default-Portrait@2x~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD43B1C5D573600B7FB28 /* Default-Portrait@2x~ipad.png */; };
- D07CD4481C5D573600B7FB28 /* Default-Portrait~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD43C1C5D573600B7FB28 /* Default-Portrait~ipad.png */; };
- D07CD4491C5D573600B7FB28 /* Default@2x~iphone.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD43D1C5D573600B7FB28 /* Default@2x~iphone.png */; };
- D07CD44A1C5D573600B7FB28 /* Default~iphone.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD43E1C5D573600B7FB28 /* Default~iphone.png */; };
+ D07CD4421C5D573600B7FB28 /* Default-Portrait-736h@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD4361C5D573600B7FB28 /* Default-Portrait-736h@3x.png */; };
+ D07CD4441C5D573600B7FB28 /* Default-Landscape-736h@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD4381C5D573600B7FB28 /* Default-Landscape-736h@3x.png */; };
+ D07CD4451C5D573600B7FB28 /* Default-Landscape@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD4391C5D573600B7FB28 /* Default-Landscape@2x.png */; };
+ D07CD4461C5D573600B7FB28 /* Default-Landscape-1366h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD43A1C5D573600B7FB28 /* Default-Landscape-1366h@2x.png */; };
+ D07CD4471C5D573600B7FB28 /* Default-Portrait@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD43B1C5D573600B7FB28 /* Default-Portrait@2x.png */; };
+ D07CD4481C5D573600B7FB28 /* Default-Portrait-1366h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD43C1C5D573600B7FB28 /* Default-Portrait-1366h@2x.png */; };
D07CD44E1C5D589C00B7FB28 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D07CD44D1C5D589C00B7FB28 /* Images.xcassets */; };
D0BCFE3818AEBDA2004A7AAE /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0BCFE3718AEBDA2004A7AAE /* Foundation.framework */; };
D0BCFE3A18AEBDA2004A7AAE /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0BCFE3918AEBDA2004A7AAE /* CoreGraphics.framework */; };
@@ -26,36 +25,36 @@
D0BCFE3E18AEBDA2004A7AAE /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0BCFE3D18AEBDA2004A7AAE /* GLKit.framework */; };
D0BCFE4018AEBDA2004A7AAE /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0BCFE3F18AEBDA2004A7AAE /* OpenGLES.framework */; };
D0BCFE4618AEBDA2004A7AAE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = D0BCFE4418AEBDA2004A7AAE /* InfoPlist.strings */; };
- D0BCFE7818AEBFEB004A7AAE /* data.pck in Resources */ = {isa = PBXBuildFile; fileRef = D0BCFE7718AEBFEB004A7AAE /* data.pck */; };
- D0BCFE7A18AEC06A004A7AAE /* godot_opt.iphone in Resources */ = {isa = PBXBuildFile; fileRef = D0BCFE7918AEC06A004A7AAE /* godot_opt.iphone */; };
+ D0BCFE7818AEBFEB004A7AAE /* $binary.pck in Resources */ = {isa = PBXBuildFile; fileRef = D0BCFE7718AEBFEB004A7AAE /* $binary.pck */; };
+ D0BCFE7A18AEC06A004A7AAE /* $binary.iphone in Resources */ = {isa = PBXBuildFile; fileRef = D0BCFE7918AEC06A004A7AAE /* $binary.iphone */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
- D07CD4331C5D573600B7FB28 /* Default-568h@2x~iphone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x~iphone.png"; sourceTree = "<group>"; };
- D07CD4341C5D573600B7FB28 /* Default-667h.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-667h.png"; sourceTree = "<group>"; };
+ 1F1575711F582BE20003B888 /* dylibs */ = {isa = PBXFileReference; lastKnownFileType = folder; name = dylibs; path = dylibs; sourceTree = "<group>"; };
+ 1FF4C1841F584E3F00A41E41 /* GameKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameKit.framework; path = System/Library/Frameworks/GameKit.framework; sourceTree = SDKROOT; };
+ 1FF4C1861F584E5600A41E41 /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; };
+ 1FF4C1881F584E6300A41E41 /* $binary.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = $binary.entitlements; sourceTree = "<group>"; };
+ D07CD4331C5D573600B7FB28 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; };
D07CD4351C5D573600B7FB28 /* Default-667h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-667h@2x.png"; sourceTree = "<group>"; };
- D07CD4361C5D573600B7FB28 /* Default-736h.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-736h.png"; sourceTree = "<group>"; };
- D07CD4371C5D573600B7FB28 /* Default-736h@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-736h@3x.png"; sourceTree = "<group>"; };
- D07CD4381C5D573600B7FB28 /* Default-Landscape-736h.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Landscape-736h.png"; sourceTree = "<group>"; };
- D07CD4391C5D573600B7FB28 /* Default-Landscape@2x~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Landscape@2x~ipad.png"; sourceTree = "<group>"; };
- D07CD43A1C5D573600B7FB28 /* Default-Landscape~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Landscape~ipad.png"; sourceTree = "<group>"; };
- D07CD43B1C5D573600B7FB28 /* Default-Portrait@2x~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Portrait@2x~ipad.png"; sourceTree = "<group>"; };
- D07CD43C1C5D573600B7FB28 /* Default-Portrait~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Portrait~ipad.png"; sourceTree = "<group>"; };
- D07CD43D1C5D573600B7FB28 /* Default@2x~iphone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x~iphone.png"; sourceTree = "<group>"; };
- D07CD43E1C5D573600B7FB28 /* Default~iphone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default~iphone.png"; sourceTree = "<group>"; };
+ D07CD4361C5D573600B7FB28 /* Default-Portrait-736h@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Portrait-736h@3x.png"; sourceTree = "<group>"; };
+ D07CD4381C5D573600B7FB28 /* Default-Landscape-736h@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Landscape-736h@3x.png"; sourceTree = "<group>"; };
+ D07CD4391C5D573600B7FB28 /* Default-Landscape@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Landscape@2x.png"; sourceTree = "<group>"; };
+ D07CD43A1C5D573600B7FB28 /* Default-Landscape-1366h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Landscape-1366h@2x.png"; sourceTree = "<group>"; };
+ D07CD43B1C5D573600B7FB28 /* Default-Portrait@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Portrait@2x.png"; sourceTree = "<group>"; };
+ D07CD43C1C5D573600B7FB28 /* Default-Portrait-1366h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Portrait-1366h@2x.png"; sourceTree = "<group>"; };
D07CD44D1C5D589C00B7FB28 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
- D0BCFE3418AEBDA2004A7AAE /* godot_ios.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = godot_ios.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0BCFE3418AEBDA2004A7AAE /* $binary.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = $binary.app; sourceTree = BUILT_PRODUCTS_DIR; };
D0BCFE3718AEBDA2004A7AAE /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
D0BCFE3918AEBDA2004A7AAE /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
D0BCFE3B18AEBDA2004A7AAE /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
D0BCFE3D18AEBDA2004A7AAE /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; };
D0BCFE3F18AEBDA2004A7AAE /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
- D0BCFE4318AEBDA2004A7AAE /* godot_ios-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "godot_ios-Info.plist"; sourceTree = "<group>"; };
+ D0BCFE4318AEBDA2004A7AAE /* $binary-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "$binary-Info.plist"; sourceTree = "<group>"; };
D0BCFE4518AEBDA2004A7AAE /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
- D0BCFE4918AEBDA2004A7AAE /* godot_ios-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "godot_ios-Prefix.pch"; sourceTree = "<group>"; };
+ D0BCFE4918AEBDA2004A7AAE /* $binary-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "$binary-Prefix.pch"; sourceTree = "<group>"; };
D0BCFE6118AEBDA3004A7AAE /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
- D0BCFE7718AEBFEB004A7AAE /* data.pck */ = {isa = PBXFileReference; lastKnownFileType = text; path = data.pck; sourceTree = "<group>"; };
- D0BCFE7918AEC06A004A7AAE /* godot_opt.iphone */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; path = godot_opt.iphone; sourceTree = "<group>"; };
+ D0BCFE7718AEBFEB004A7AAE /* $binary.pck */ = {isa = PBXFileReference; lastKnownFileType = file; path = $binary.pck; sourceTree = "<group>"; };
+ D0BCFE7918AEC06A004A7AAE /* $binary.iphone */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; path = $binary.iphone; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -64,8 +63,10 @@
buildActionMask = 2147483647;
files = (
D0BCFE4018AEBDA2004A7AAE /* OpenGLES.framework in Frameworks */,
+ 1FF4C1871F584E5600A41E41 /* StoreKit.framework in Frameworks */,
D0BCFE3A18AEBDA2004A7AAE /* CoreGraphics.framework in Frameworks */,
D0BCFE3C18AEBDA2004A7AAE /* UIKit.framework in Frameworks */,
+ 1FF4C1851F584E3F00A41E41 /* GameKit.framework in Frameworks */,
D0BCFE3E18AEBDA2004A7AAE /* GLKit.framework in Frameworks */,
D0BCFE3818AEBDA2004A7AAE /* Foundation.framework in Frameworks */,
);
@@ -77,9 +78,10 @@
D0BCFE2B18AEBDA2004A7AAE = {
isa = PBXGroup;
children = (
- D0BCFE7918AEC06A004A7AAE /* godot_opt.iphone */,
- D0BCFE7718AEBFEB004A7AAE /* data.pck */,
- D0BCFE4118AEBDA2004A7AAE /* godot_ios */,
+ 1F1575711F582BE20003B888 /* dylibs */,
+ D0BCFE7918AEC06A004A7AAE /* $binary.iphone */,
+ D0BCFE7718AEBFEB004A7AAE /* $binary.pck */,
+ D0BCFE4118AEBDA2004A7AAE /* $binary */,
D0BCFE3618AEBDA2004A7AAE /* Frameworks */,
D0BCFE3518AEBDA2004A7AAE /* Products */,
);
@@ -88,7 +90,7 @@
D0BCFE3518AEBDA2004A7AAE /* Products */ = {
isa = PBXGroup;
children = (
- D0BCFE3418AEBDA2004A7AAE /* godot_ios.app */,
+ D0BCFE3418AEBDA2004A7AAE /* $binary.app */,
);
name = Products;
sourceTree = "<group>";
@@ -96,6 +98,8 @@
D0BCFE3618AEBDA2004A7AAE /* Frameworks */ = {
isa = PBXGroup;
children = (
+ 1FF4C1861F584E5600A41E41 /* StoreKit.framework */,
+ 1FF4C1841F584E3F00A41E41 /* GameKit.framework */,
D0BCFE3718AEBDA2004A7AAE /* Foundation.framework */,
D0BCFE3918AEBDA2004A7AAE /* CoreGraphics.framework */,
D0BCFE3B18AEBDA2004A7AAE /* UIKit.framework */,
@@ -106,33 +110,30 @@
name = Frameworks;
sourceTree = "<group>";
};
- D0BCFE4118AEBDA2004A7AAE /* godot_ios */ = {
+ D0BCFE4118AEBDA2004A7AAE /* $binary */ = {
isa = PBXGroup;
children = (
- D07CD4331C5D573600B7FB28 /* Default-568h@2x~iphone.png */,
- D07CD4341C5D573600B7FB28 /* Default-667h.png */,
+ 1FF4C1881F584E6300A41E41 /* $binary.entitlements */,
+ D07CD4331C5D573600B7FB28 /* Default-568h@2x.png */,
D07CD4351C5D573600B7FB28 /* Default-667h@2x.png */,
- D07CD4361C5D573600B7FB28 /* Default-736h.png */,
- D07CD4371C5D573600B7FB28 /* Default-736h@3x.png */,
- D07CD4381C5D573600B7FB28 /* Default-Landscape-736h.png */,
- D07CD4391C5D573600B7FB28 /* Default-Landscape@2x~ipad.png */,
- D07CD43A1C5D573600B7FB28 /* Default-Landscape~ipad.png */,
- D07CD43B1C5D573600B7FB28 /* Default-Portrait@2x~ipad.png */,
- D07CD43C1C5D573600B7FB28 /* Default-Portrait~ipad.png */,
- D07CD43D1C5D573600B7FB28 /* Default@2x~iphone.png */,
- D07CD43E1C5D573600B7FB28 /* Default~iphone.png */,
+ D07CD4361C5D573600B7FB28 /* Default-Portrait-736h@3x.png */,
+ D07CD4381C5D573600B7FB28 /* Default-Landscape-736h@3x.png */,
+ D07CD4391C5D573600B7FB28 /* Default-Landscape@2x.png */,
+ D07CD43A1C5D573600B7FB28 /* Default-Landscape-1366h@2x.png */,
+ D07CD43B1C5D573600B7FB28 /* Default-Portrait@2x.png */,
+ D07CD43C1C5D573600B7FB28 /* Default-Portrait-1366h@2x.png */,
D07CD44D1C5D589C00B7FB28 /* Images.xcassets */,
D0BCFE4218AEBDA2004A7AAE /* Supporting Files */,
);
- path = godot_ios;
+ path = $binary;
sourceTree = "<group>";
};
D0BCFE4218AEBDA2004A7AAE /* Supporting Files */ = {
isa = PBXGroup;
children = (
- D0BCFE4318AEBDA2004A7AAE /* godot_ios-Info.plist */,
+ D0BCFE4318AEBDA2004A7AAE /* $binary-Info.plist */,
D0BCFE4418AEBDA2004A7AAE /* InfoPlist.strings */,
- D0BCFE4918AEBDA2004A7AAE /* godot_ios-Prefix.pch */,
+ D0BCFE4918AEBDA2004A7AAE /* $binary-Prefix.pch */,
);
name = "Supporting Files";
sourceTree = "<group>";
@@ -140,9 +141,9 @@
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
- D0BCFE3318AEBDA2004A7AAE /* godot_ios */ = {
+ D0BCFE3318AEBDA2004A7AAE /* $binary */ = {
isa = PBXNativeTarget;
- buildConfigurationList = D0BCFE7118AEBDA3004A7AAE /* Build configuration list for PBXNativeTarget "godot_ios" */;
+ buildConfigurationList = D0BCFE7118AEBDA3004A7AAE /* Build configuration list for PBXNativeTarget "$binary" */;
buildPhases = (
D0BCFE3018AEBDA2004A7AAE /* Sources */,
D0BCFE3118AEBDA2004A7AAE /* Frameworks */,
@@ -152,9 +153,9 @@
);
dependencies = (
);
- name = godot_ios;
- productName = godot_ios;
- productReference = D0BCFE3418AEBDA2004A7AAE /* godot_ios.app */;
+ name = "$binary";
+ productName = "$name";
+ productReference = D0BCFE3418AEBDA2004A7AAE /* $binary.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
@@ -165,8 +166,24 @@
attributes = {
LastUpgradeCheck = 0500;
ORGANIZATIONNAME = GodotEngine;
+ TargetAttributes = {
+ D0BCFE3318AEBDA2004A7AAE = {
+ DevelopmentTeam = $team_id;
+ SystemCapabilities = {
+ com.apple.GameCenter = {
+ enabled = 1;
+ };
+ com.apple.InAppPurchase = {
+ enabled = 1;
+ };
+ com.apple.Push = {
+ enabled = 1;
+ };
+ };
+ };
+ };
};
- buildConfigurationList = D0BCFE2F18AEBDA2004A7AAE /* Build configuration list for PBXProject "godot_ios" */;
+ buildConfigurationList = D0BCFE2F18AEBDA2004A7AAE /* Build configuration list for PBXProject "$binary" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
@@ -179,7 +196,7 @@
projectDirPath = "";
projectRoot = "";
targets = (
- D0BCFE3318AEBDA2004A7AAE /* godot_ios */,
+ D0BCFE3318AEBDA2004A7AAE /* $binary */,
);
};
/* End PBXProject section */
@@ -189,22 +206,19 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- D07CD4471C5D573600B7FB28 /* Default-Portrait@2x~ipad.png in Resources */,
+ 1F1575721F582BE20003B888 /* dylibs in Resources */,
D07CD44E1C5D589C00B7FB28 /* Images.xcassets in Resources */,
- D0BCFE7818AEBFEB004A7AAE /* data.pck in Resources */,
- D07CD4461C5D573600B7FB28 /* Default-Landscape~ipad.png in Resources */,
+ D0BCFE7818AEBFEB004A7AAE /* $binary.pck in Resources */,
+ D07CD4471C5D573600B7FB28 /* Default-Portrait@2x.png in Resources */,
+ D07CD4461C5D573600B7FB28 /* Default-Landscape-1366h@2x.png in Resources */,
D07CD4411C5D573600B7FB28 /* Default-667h@2x.png in Resources */,
- D07CD4401C5D573600B7FB28 /* Default-667h.png in Resources */,
- D07CD4431C5D573600B7FB28 /* Default-736h@3x.png in Resources */,
- D07CD43F1C5D573600B7FB28 /* Default-568h@2x~iphone.png in Resources */,
- D07CD4451C5D573600B7FB28 /* Default-Landscape@2x~ipad.png in Resources */,
- D07CD44A1C5D573600B7FB28 /* Default~iphone.png in Resources */,
- D07CD4491C5D573600B7FB28 /* Default@2x~iphone.png in Resources */,
- D07CD4441C5D573600B7FB28 /* Default-Landscape-736h.png in Resources */,
- D07CD4421C5D573600B7FB28 /* Default-736h.png in Resources */,
+ D07CD43F1C5D573600B7FB28 /* Default-568h@2x.png in Resources */,
+ D07CD4451C5D573600B7FB28 /* Default-Landscape@2x.png in Resources */,
+ D07CD4441C5D573600B7FB28 /* Default-Landscape-736h@3x.png in Resources */,
+ D07CD4421C5D573600B7FB28 /* Default-Portrait-736h@3x.png in Resources */,
+ D07CD4481C5D573600B7FB28 /* Default-Portrait-1366h@2x.png in Resources */,
D0BCFE4618AEBDA2004A7AAE /* InfoPlist.strings in Resources */,
- D0BCFE7A18AEC06A004A7AAE /* godot_opt.iphone in Resources */,
- D07CD4481C5D573600B7FB28 /* Default-Portrait~ipad.png in Resources */,
+ D0BCFE7A18AEC06A004A7AAE /* $binary.iphone in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -249,7 +263,7 @@
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "$code_sign_identity_debug";
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
@@ -265,7 +279,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 7.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 9.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
@@ -289,7 +303,8 @@
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ CODE_SIGN_IDENTITY = "$code_sign_identity_release";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "$code_sign_identity_release";
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
@@ -299,7 +314,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 7.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 9.0;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
@@ -311,13 +326,22 @@
buildSettings = {
ARCHS = "$(ARCHS_STANDARD)";
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CODE_SIGN_ENTITLEMENTS = $binary/$binary.entitlements;
+ CODE_SIGN_IDENTITY = "$code_sign_identity_debug";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "$code_sign_identity_debug";
CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
+ DEVELOPMENT_TEAM = $team_id;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = "godot_ios/godot_ios-Prefix.pch";
- INFOPLIST_FILE = "godot_ios/godot_ios-Info.plist";
- IPHONEOS_DEPLOYMENT_TARGET = 6.0;
- PRODUCT_BUNDLE_IDENTIFIER = org.godotengine.game.ios;
+ GCC_PREFIX_HEADER = "$binary/$binary-Prefix.pch";
+ INFOPLIST_FILE = "$binary/$binary-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 9.0;
+ LIBRARY_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PROJECT_DIR)/dylibs",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = $identifier;
PRODUCT_NAME = "$(TARGET_NAME)";
+ PROVISIONING_PROFILE = "$provisioning_profile_uuid_debug";
TARGETED_DEVICE_FAMILY = "1,2";
VALID_ARCHS = "armv7 armv7s";
WRAPPER_EXTENSION = app;
@@ -329,14 +353,22 @@
buildSettings = {
ARCHS = "$(ARCHS_STANDARD)";
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
- CODE_SIGN_IDENTITY = "iPhone Distribution: Ariel Manzur (BYC57PA2Q5)";
+ CODE_SIGN_ENTITLEMENTS = $binary/$binary.entitlements;
+ CODE_SIGN_IDENTITY = "$code_sign_identity_release";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "$code_sign_identity_release";
CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
+ DEVELOPMENT_TEAM = $team_id;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = "godot_ios/godot_ios-Prefix.pch";
- INFOPLIST_FILE = "godot_ios/godot_ios-Info.plist";
- IPHONEOS_DEPLOYMENT_TARGET = 6.0;
- PRODUCT_BUNDLE_IDENTIFIER = org.godotengine.game.ios;
+ GCC_PREFIX_HEADER = "$binary/$binary-Prefix.pch";
+ INFOPLIST_FILE = "$binary/$binary-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 9.0;
+ LIBRARY_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PROJECT_DIR)/dylibs",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = $identifier;
PRODUCT_NAME = "$(TARGET_NAME)";
+ PROVISIONING_PROFILE = "$provisioning_profile_uuid_release";
TARGETED_DEVICE_FAMILY = "1,2";
VALID_ARCHS = "armv7 armv7s";
WRAPPER_EXTENSION = app;
@@ -346,7 +378,7 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
- D0BCFE2F18AEBDA2004A7AAE /* Build configuration list for PBXProject "godot_ios" */ = {
+ D0BCFE2F18AEBDA2004A7AAE /* Build configuration list for PBXProject "$binary" */ = {
isa = XCConfigurationList;
buildConfigurations = (
D0BCFE6F18AEBDA3004A7AAE /* Debug */,
@@ -355,7 +387,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
- D0BCFE7118AEBDA3004A7AAE /* Build configuration list for PBXNativeTarget "godot_ios" */ = {
+ D0BCFE7118AEBDA3004A7AAE /* Build configuration list for PBXNativeTarget "$binary" */ = {
isa = XCConfigurationList;
buildConfigurations = (
D0BCFE7218AEBDA3004A7AAE /* Debug */,
diff --git a/misc/dist/ios_xcode/godot_ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/misc/dist/ios_xcode/godot_ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata
index 3c9ba38bbe..c9c19829f4 100644
--- a/misc/dist/ios_xcode/godot_ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata
+++ b/misc/dist/ios_xcode/godot_ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -2,6 +2,6 @@
<Workspace
version = "1.0">
<FileRef
- location = "self:godot_ios.xcodeproj">
+ location = "self:$binary.xcodeproj">
</FileRef>
</Workspace>
diff --git a/misc/dist/ios_xcode/godot_ios.xcodeproj/xcshareddata/xcschemes/godot_ios.xcscheme b/misc/dist/ios_xcode/godot_ios.xcodeproj/xcshareddata/xcschemes/godot_ios.xcscheme
new file mode 100644
index 0000000000..3f0df5c437
--- /dev/null
+++ b/misc/dist/ios_xcode/godot_ios.xcodeproj/xcshareddata/xcschemes/godot_ios.xcscheme
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0710"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "A340BDFEBCA49239A941883D"
+ BuildableName = "$binary.app"
+ BlueprintName = "$binary"
+ ReferencedContainer = "container:$binary.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ buildConfiguration = "Development"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES">
+ <Testables>
+ </Testables>
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "A340BDFEBCA49239A941883D"
+ BuildableName = "$binary.app"
+ BlueprintName = "$binary"
+ ReferencedContainer = "container:$binary.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </TestAction>
+ <LaunchAction
+ buildConfiguration = "Development"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ debugServiceExtension = "internal"
+ allowLocationSimulation = "YES">
+ <BuildableProductRunnable
+ runnableDebuggingMode = "0">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "A340BDFEBCA49239A941883D"
+ BuildableName = "$binary.app"
+ BlueprintName = "$binary"
+ ReferencedContainer = "container:$binary.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ <CommandLineArguments>
+ </CommandLineArguments>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ buildConfiguration = "Development"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ debugDocumentVersioning = "YES">
+ <BuildableProductRunnable
+ runnableDebuggingMode = "0">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "A340BDFEBCA49239A941883D"
+ BuildableName = "$binary.app"
+ BlueprintName = "$binary"
+ ReferencedContainer = "container:$binary.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Development">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Development"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
diff --git a/misc/dist/ios_xcode/godot_ios/Default-568h@2x~iphone.png b/misc/dist/ios_xcode/godot_ios/Default-568h@2x.png
index 1d5e472665..1d5e472665 100644
--- a/misc/dist/ios_xcode/godot_ios/Default-568h@2x~iphone.png
+++ b/misc/dist/ios_xcode/godot_ios/Default-568h@2x.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_ios/Default-667h.png b/misc/dist/ios_xcode/godot_ios/Default-667h.png
deleted file mode 100644
index b13a399c83..0000000000
--- a/misc/dist/ios_xcode/godot_ios/Default-667h.png
+++ /dev/null
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_ios/Default-736h@3x.png b/misc/dist/ios_xcode/godot_ios/Default-736h@3x.png
deleted file mode 100644
index 33847ac136..0000000000
--- a/misc/dist/ios_xcode/godot_ios/Default-736h@3x.png
+++ /dev/null
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_ios/Default-Landscape-1366h@2x.png b/misc/dist/ios_xcode/godot_ios/Default-Landscape-1366h@2x.png
new file mode 100644
index 0000000000..ec5b4f7888
--- /dev/null
+++ b/misc/dist/ios_xcode/godot_ios/Default-Landscape-1366h@2x.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_ios/Default-Landscape-736h.png b/misc/dist/ios_xcode/godot_ios/Default-Landscape-736h@3x.png
index 2a025b745b..2a025b745b 100644
--- a/misc/dist/ios_xcode/godot_ios/Default-Landscape-736h.png
+++ b/misc/dist/ios_xcode/godot_ios/Default-Landscape-736h@3x.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_ios/Default-Landscape@2x~ipad.png b/misc/dist/ios_xcode/godot_ios/Default-Landscape@2x.png
index 7099f3e18d..7099f3e18d 100644
--- a/misc/dist/ios_xcode/godot_ios/Default-Landscape@2x~ipad.png
+++ b/misc/dist/ios_xcode/godot_ios/Default-Landscape@2x.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_ios/Default-Landscape~ipad.png b/misc/dist/ios_xcode/godot_ios/Default-Landscape~ipad.png
deleted file mode 100644
index 4a761c339a..0000000000
--- a/misc/dist/ios_xcode/godot_ios/Default-Landscape~ipad.png
+++ /dev/null
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_ios/Default-Portrait-1366h@2x.png b/misc/dist/ios_xcode/godot_ios/Default-Portrait-1366h@2x.png
new file mode 100644
index 0000000000..a6d054ba2a
--- /dev/null
+++ b/misc/dist/ios_xcode/godot_ios/Default-Portrait-1366h@2x.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_ios/Default-736h.png b/misc/dist/ios_xcode/godot_ios/Default-Portrait-736h@3x.png
index 8c44edbccd..8c44edbccd 100644
--- a/misc/dist/ios_xcode/godot_ios/Default-736h.png
+++ b/misc/dist/ios_xcode/godot_ios/Default-Portrait-736h@3x.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_ios/Default-Portrait@2x.png b/misc/dist/ios_xcode/godot_ios/Default-Portrait@2x.png
new file mode 100644
index 0000000000..a6d054ba2a
--- /dev/null
+++ b/misc/dist/ios_xcode/godot_ios/Default-Portrait@2x.png
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_ios/Default-Portrait@2x~ipad.png b/misc/dist/ios_xcode/godot_ios/Default-Portrait@2x~ipad.png
deleted file mode 100644
index b09cf21186..0000000000
--- a/misc/dist/ios_xcode/godot_ios/Default-Portrait@2x~ipad.png
+++ /dev/null
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_ios/Default-Portrait~ipad.png b/misc/dist/ios_xcode/godot_ios/Default-Portrait~ipad.png
deleted file mode 100644
index fa698eb70c..0000000000
--- a/misc/dist/ios_xcode/godot_ios/Default-Portrait~ipad.png
+++ /dev/null
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_ios/Default@2x~iphone.png b/misc/dist/ios_xcode/godot_ios/Default@2x~iphone.png
deleted file mode 100644
index ddf2861f4d..0000000000
--- a/misc/dist/ios_xcode/godot_ios/Default@2x~iphone.png
+++ /dev/null
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_ios/Default~iphone.png b/misc/dist/ios_xcode/godot_ios/Default~iphone.png
deleted file mode 100644
index c485a33b03..0000000000
--- a/misc/dist/ios_xcode/godot_ios/Default~iphone.png
+++ /dev/null
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Contents.json b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Contents.json
deleted file mode 100644
index a458b67873..0000000000
--- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Contents.json
+++ /dev/null
@@ -1,128 +0,0 @@
-{
- "images" : [
- {
- "idiom" : "iphone",
- "size" : "29x29",
- "scale" : "1x",
- "filename": "Icon-29.png",
- },
- {
- "idiom" : "iphone",
- "size" : "29x29",
- "scale" : "2x",
- "filename": "Icon-58.png",
- },
- {
- "idiom" : "iphone",
- "size" : "29x29",
- "scale" : "3x",
- "filename": "icon-87.png",
- },
- {
- "idiom" : "iphone",
- "size" : "40x40",
- "scale" : "2x",
- "filename": "Icon-80.png",
- },
- {
- "idiom" : "iphone",
- "size" : "40x40",
- "scale" : "3x",
- "filename": "Icon-120.png",
- },
- {
- "idiom" : "iphone",
- "size" : "57x57",
- "scale" : "1x",
- "filename": "Icon-57.png",
- },
- {
- "idiom" : "iphone",
- "size" : "57x57",
- "scale" : "2x",
- "filename": "Icon-114.png",
- },
- {
- "idiom" : "iphone",
- "size" : "60x60",
- "scale" : "2x",
- "filename": "Icon-120.png",
- },
- {
- "idiom" : "iphone",
- "size" : "60x60",
- "scale" : "3x",
- "filename": "Icon-180.png",
- },
- {
- "idiom" : "ipad",
- "size" : "29x29",
- "scale" : "1x",
- "filename": "Icon-29.png",
- },
- {
- "idiom" : "ipad",
- "size" : "29x29",
- "scale" : "2x",
- "filename": "Icon-58.png",
- },
- {
- "idiom" : "ipad",
- "size" : "40x40",
- "scale" : "1x",
- "filename": "Icon-40.png",
- },
- {
- "idiom" : "ipad",
- "size" : "40x40",
- "scale" : "2x",
- "filename": "Icon-80.png",
- },
- {
- "idiom" : "ipad",
- "size" : "50x50",
- "scale" : "1x",
- "filename": "Icon-50.png",
- },
- {
- "idiom" : "ipad",
- "size" : "50x50",
- "scale" : "2x",
- "filename": "Icon-100.png",
- },
- {
- "idiom" : "ipad",
- "size" : "72x72",
- "scale" : "1x",
- "filename": "Icon-72.png",
- },
- {
- "idiom" : "ipad",
- "size" : "72x72",
- "scale" : "2x",
- "filename": "Icon-144.png",
- },
- {
- "size" : "76x76",
- "idiom" : "ipad",
- "filename" : "Icon-76.png",
- "scale" : "1x",
- },
- {
- "idiom" : "ipad",
- "size" : "76x76",
- "scale" : "2x",
- "filename": "Icon-152.png",
- },
- {
- "idiom" : "ipad",
- "size" : "83.5x83.5",
- "scale" : "2x",
- "filename": "icon-167.png",
- }
- ],
- "info" : {
- "version" : 1,
- "author" : "xcode"
- }
-}
diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-100.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-100.png
deleted file mode 100644
index 165f4423b3..0000000000
--- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-100.png
+++ /dev/null
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-114.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-114.png
deleted file mode 100644
index 2e205e920c..0000000000
--- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-114.png
+++ /dev/null
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-120.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-120.png
deleted file mode 100644
index 6245f83f48..0000000000
--- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-120.png
+++ /dev/null
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-144.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-144.png
deleted file mode 100644
index 7b24e01bc6..0000000000
--- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-144.png
+++ /dev/null
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-152.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-152.png
deleted file mode 100644
index 344b470fa3..0000000000
--- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-152.png
+++ /dev/null
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-180.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-180.png
deleted file mode 100644
index 0dcebbc3f2..0000000000
--- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-180.png
+++ /dev/null
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-29.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-29.png
deleted file mode 100644
index 9ae94e9aaf..0000000000
--- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-29.png
+++ /dev/null
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-40.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-40.png
deleted file mode 100644
index 569f24df91..0000000000
--- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-40.png
+++ /dev/null
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-50.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-50.png
deleted file mode 100644
index 9e69ed3121..0000000000
--- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-50.png
+++ /dev/null
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-57.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-57.png
deleted file mode 100644
index b970fa3067..0000000000
--- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-57.png
+++ /dev/null
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-58.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-58.png
deleted file mode 100644
index 6097a6c73b..0000000000
--- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-58.png
+++ /dev/null
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-60.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-60.png
deleted file mode 100644
index 21b9622eb6..0000000000
--- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-60.png
+++ /dev/null
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-72.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-72.png
deleted file mode 100644
index 34dea8e6ad..0000000000
--- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-72.png
+++ /dev/null
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-76.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-76.png
deleted file mode 100644
index f72eb0b345..0000000000
--- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-76.png
+++ /dev/null
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-80.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-80.png
deleted file mode 100644
index 793c9b1f5f..0000000000
--- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-80.png
+++ /dev/null
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-167.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-167.png
deleted file mode 100644
index 7cd0e054ab..0000000000
--- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-167.png
+++ /dev/null
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-87.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-87.png
deleted file mode 100644
index e9b2429754..0000000000
--- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-87.png
+++ /dev/null
Binary files differ
diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/sizes b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/sizes
deleted file mode 100644
index e328a62cb6..0000000000
--- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/sizes
+++ /dev/null
@@ -1,17 +0,0 @@
-100
-114
-120
-144
-152
-167
-180
-29
-40
-50
-57
-58
-60
-72
-76
-80
-87
diff --git a/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist b/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist
index f97b0fca36..1531a41bd0 100644
--- a/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist
+++ b/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist
@@ -5,32 +5,33 @@
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
- <string>Insert Name Here</string>
+ <string>$name</string>
<key>CFBundleExecutable</key>
- <string>godot_opt.iphone</string>
+ <string>$binary.iphone</string>
<key>CFBundleIcons</key>
<dict/>
<key>CFBundleIcons~ipad</key>
<dict/>
<key>CFBundleIdentifier</key>
- <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+ <string>$identifier</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
- <string>${PRODUCT_NAME}</string>
+ <string>$name</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>1.0</string>
+ <string>$short_version</string>
<key>CFBundleSignature</key>
- <string>????</string>
+ <string>$signature</string>
<key>CFBundleVersion</key>
- <string>1.0</string>
+ <string>$version</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
+ <string>gamekit</string>
</array>
<key>UIRequiresFullScreen</key>
<true/>
diff --git a/misc/dist/ios_xcode/godot_ios/godot_ios.entitlements b/misc/dist/ios_xcode/godot_ios/godot_ios.entitlements
new file mode 100644
index 0000000000..903def2af5
--- /dev/null
+++ b/misc/dist/ios_xcode/godot_ios/godot_ios.entitlements
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>aps-environment</key>
+ <string>development</string>
+</dict>
+</plist>
diff --git a/misc/dist/linux/godot.6 b/misc/dist/linux/godot.6
new file mode 100644
index 0000000000..946fa6c913
--- /dev/null
+++ b/misc/dist/linux/godot.6
@@ -0,0 +1,165 @@
+.TH GODOT "6" "September 2017" "godot 3.0-alpha" "Games"
+.SH NAME
+godot \- multi\-platform 2D and 3D game engine with a feature\-rich editor
+.SH SYNOPSIS
+.B godot
+[\fI\,options\/\fR] [path to scene or 'project.godot' file]
+.SH DESCRIPTION
+Godot Engine is an advanced, feature\-packed, multi\-platform 2D and 3D game
+engine.
+.br
+It provides a huge set of common tools, so you can just focus on making
+your game without reinventing the wheel.
+.SS "General options:"
+.TP
+\fB\-h\fR, \fB\-\-help\fR
+Display this help message.
+.TP
+\fB\-\-version\fR
+Display the version string.
+.TP
+\fB\-v\fR, \fB\-\-verbose\fR
+Use verbose stdout mode.
+.TP
+\fB\-\-quiet\fR
+Quiet mode, silences stdout messages. Errors are still displayed.
+.SS "Run options:"
+.TP
+\fB\-e\fR, \fB\-\-editor\fR
+Start the editor instead of running the scene.
+.TP
+\fB\-p\fR, \fB\-\-project\-manager\fR
+Start the project manager, even if a project is auto\-detected.
+.TP
+\fB\-l\fR, \fB\-\-language\fR <locale>
+Use a specific locale (<locale> being a two\-letter code).
+.TP
+\fB\-\-path\fR <directory>
+Path to a project (<directory> must contain a 'project.godot' file).
+.TP
+\fB\-\-main\-pack\fR <file>
+Path to a pack (.pck) file to load.
+.TP
+\fB\-\-render\-thread\fR <mode>
+Render thread mode ('unsafe', 'safe', 'separate').
+.TP
+\fB\-\-remote\-fs\fR <address>
+Remote filesystem (<host/IP>[:<port>] address).
+.TP
+\fB\-\-remote\-fs\-password\fR <password>
+Password for remote filesystem.
+.TP
+\fB\-\-audio\-driver\fR <driver>
+Audio driver ('PulseAudio', 'ALSA').
+.TP
+\fB\-\-video\-driver\fR <driver>
+Video driver ('GLES3').
+.SS "Display options:"
+.TP
+\fB\-f\fR, \fB\-\-fullscreen\fR
+Request fullscreen mode.
+.TP
+\fB\-m\fR, \fB\-\-maximized\fR
+Request a maximized window.
+.TP
+\fB\-w\fR, \fB\-\-windowed\fR
+Request windowed mode.
+.TP
+\fB\-\-resolution\fR <W>x<H>
+Request window resolution.
+.TP
+\fB\-\-position\fR <X>,<Y>
+Request window position.
+.TP
+\fB\-\-low\-dpi\fR
+Force low\-DPI mode (macOS and Windows only).
+.TP
+\fB\-\-no\-window\fR
+Disable window creation (Windows only). Useful together with \fB\-\-script\fR.
+.SS "Debug options:"
+.TP
+\fB\-d\fR, \fB\-\-debug\fR
+Debug (local stdout debugger).
+.TP
+\fB\-b\fR, \fB\-\-breakpoints\fR
+Breakpoint list as source::line comma\-separated pairs, no spaces (use %20 instead).
+.TP
+\fB\-\-profiling\fR
+Enable profiling in the script debugger.
+.TP
+\fB\-\-remote\-debug\fR <address>
+Remote debug (<host/IP>:<port> address).
+.TP
+\fB\-\-debug\-collisions\fR
+Show collisions shapes when running the scene.
+.TP
+\fB\-\-debug\-navigation\fR
+Show navigation polygons when running the scene.
+.TP
+\fB\-\-frame\-delay\fR <ms>
+Simulate high CPU load (delay each frame by <ms> milliseconds).
+.TP
+\fB\-\-time\-scale\fR <scale>
+Force time scale (higher values are faster, 1.0 is normal speed).
+.TP
+\fB\-\-disable\-render\-loop\fR
+Disable render loop so rendering only occurs when called explicitly from script.
+.TP
+\fB\-\-disable\-crash\-handler\fR
+Disable crash handler when supported by the platform code.
+.TP
+\fB\-\-fixed\-fps\fR <fps>
+Force a fixed number of frames per second. This setting disables real\-time synchronization.
+.SS "Standalone tools:"
+.TP
+\fB\-s\fR, \fB\-\-script\fR <script>
+Run a script.
+.TP
+\fB\-\-export\fR <target>
+Export the project using the given export target.
+.TP
+\fB\-\-export\-debug\fR
+Use together with \fB\-\-export\fR, enables debug mode for the template.
+.TP
+\fB\-\-doctool\fR <path>
+Dump the engine API reference to the given <path> in XML format, merging if existing files are found.
+.TP
+\fB\-\-no\-docbase\fR
+Disallow dumping the base types (used with \fB\-\-doctool\fR).
+.TP
+\fB\-\-gdnative\-generate\-json\-api\fR
+Generate JSON dump of the Godot API for GDNative bindings.
+.TP
+\fB\-\-test\fR <test>
+Run a unit test ('string', 'containers', 'math', 'render', 'multimesh', 'gui', 'io', 'shaderlang', 'physics', 'oa_hash_map').
+.SH FILES
+~/.godot/
+.RS
+User\-specific configuration and cache folder, contains persistent editor and game configuration and saved files, temporary metadata, etc.
+.RE
+~/.godot/app_userdata/
+.RS
+Contains the default configuration and user data folders for Godot\-made games (\fIuser://\fR path).
+.RE
+~/.godot/templates/
+.RS
+Installation folder for "export templates", compiled binaries of the engine to deploy on the many supported platforms.
+.RE
+/usr/share/doc/godot/
+.RS
+Additional documentation files.
+.RE
+/usr/share/licenses/godot/
+.RS
+Detailed licensing information.
+.RE
+.SH "SEE ALSO"
+See the project website at \fIhttps://godotengine.org\fR and the source
+code repository at \fIhttps://github.com/godotengine/godot\fR for more details.
+.SH BUGS
+Godot Engine is a free and open source project and welcomes any kind of
+contributions. In particular, you can report issues or make suggestions on
+Godot's issue tracker at \fIhttps://github.com/godotengine/godot/issues\fR.
+.SH AUTHOR
+Man page written by Rémi Verschelde <akien@godotengine.org> on behalf of the
+Godot Engine development team.
diff --git a/misc/dist/linux/godot.appdata.xml b/misc/dist/linux/godot.appdata.xml
new file mode 100644
index 0000000000..907fe1f3be
--- /dev/null
+++ b/misc/dist/linux/godot.appdata.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright 2017 Rémi Verschelde <akien@godotengine.org> -->
+<component type="desktop">
+ <id>godot.desktop</id>
+ <metadata_license>CC0-1.0</metadata_license>
+ <project_license>MIT</project_license>
+ <name>Godot Engine</name>
+ <summary>Multi-platform 2D and 3D game engine with a feature-rich editor</summary>
+ <description>
+ <p>
+ Godot is an advanced, feature-packed, multi-platform 2D and 3D game
+ engine. It provides a huge set of common tools, so you can just focus on
+ making your game without reinventing the wheel.
+ </p>
+ <p>
+ Godot is completely free and open source under the very permissive MIT
+ license. No strings attached, no royalties, nothing. Your game is yours,
+ down to the last line of engine code.
+ </p>
+ </description>
+ <screenshots>
+ <screenshot type="default" width="1330" height="720">
+ <caption>3D project loaded in the Godot Engine editor</caption>
+ <image>https://download.tuxfamily.org/godotengine/media/screenshots/editor_3d_fracteed-720p.jpg</image>
+ </screenshot>
+ </screenshots>
+ <url type="homepage">https://godotengine.org</url>
+ <url type="bugtracker">https://github.com/godotengine/godot/issues</url>
+ <url type="help">http://docs.godotengine.org</url>
+ <url type="donation">https://godotengine.org/donate</url>
+ <url type="translate">https://hosted.weblate.org/projects/godot-engine/godot</url>
+ <developer_name>The Godot Engine Community</developer_name>
+ <update_contact>akien_at_godotengine_dot_org</update_contact>
+</component>
diff --git a/misc/dist/linux/godot.desktop b/misc/dist/linux/godot.desktop
new file mode 100644
index 0000000000..545c491256
--- /dev/null
+++ b/misc/dist/linux/godot.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=Godot Engine
+GenericName=Libre game engine
+Comment=Multi-platform 2D and 3D game engine with a feature rich editor
+Exec=godot -pm
+Icon=godot
+Terminal=false
+Type=Application
+Categories=Development;IDE;
diff --git a/modules/gdnative/SCsub b/modules/gdnative/SCsub
index f386f2b542..39f5ec5378 100644
--- a/modules/gdnative/SCsub
+++ b/modules/gdnative/SCsub
@@ -11,7 +11,7 @@ gdn_env.add_source_files(env.modules_sources, "nativescript/*.cpp")
gdn_env.Append(CPPFLAGS=['-DGDAPI_BUILT_IN'])
gdn_env.Append(CPPPATH=['#modules/gdnative/include/'])
-if "platform" in env and env["platform"] == "x11": # there has to be a better solution?
+if "platform" in env and env["platform"] in ["x11", "iphone"]:
env.Append(LINKFLAGS=["-rdynamic"])
env.use_ptrcall = True
diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp
index 93a9bac11c..11856e4ffb 100644
--- a/modules/gdnative/gdnative.cpp
+++ b/modules/gdnative/gdnative.cpp
@@ -234,8 +234,11 @@ bool GDNative::initialize() {
ERR_PRINT("No library set for this platform");
return false;
}
-
+#ifdef IPHONE_ENABLED
+ String path = lib_path.replace("res://", "dylibs/");
+#else
String path = ProjectSettings::get_singleton()->globalize_path(lib_path);
+#endif
Error err = OS::get_singleton()->open_dynamic_library(path, native_handle);
if (err != OK) {
return false;
diff --git a/modules/gdnative/include/gdnative/gdnative.h b/modules/gdnative/include/gdnative/gdnative.h
index 18d51daeb3..19dd030637 100644
--- a/modules/gdnative/include/gdnative/gdnative.h
+++ b/modules/gdnative/include/gdnative/gdnative.h
@@ -49,8 +49,8 @@ extern "C" {
#elif defined(__APPLE__)
#include "TargetConditionals.h"
#if TARGET_OS_IPHONE
-#define GDCALLINGCONV
-#define GDAPI
+#define GDCALLINGCONV __attribute__((visibility("default")))
+#define GDAPI GDCALLINGCONV
#elif TARGET_OS_MAC
#define GDCALLINGCONV __attribute__((sysv_abi))
#define GDAPI GDCALLINGCONV
diff --git a/modules/gdnative/include/nativescript/godot_nativescript.h b/modules/gdnative/include/nativescript/godot_nativescript.h
index 96f213ead7..5095b7a83e 100644
--- a/modules/gdnative/include/nativescript/godot_nativescript.h
+++ b/modules/gdnative/include/nativescript/godot_nativescript.h
@@ -51,8 +51,8 @@ extern "C" {
#elif defined(__APPLE__)
#include "TargetConditionals.h"
#if TARGET_OS_IPHONE
-#define GDCALLINGCONV
-#define GDAPI
+#define GDCALLINGCONV __attribute__((visibility("default")))
+#define GDAPI GDCALLINGCONV
#elif TARGET_OS_MAC
#define GDCALLINGCONV __attribute__((sysv_abi))
#define GDAPI GDCALLINGCONV
diff --git a/modules/gdnative/nativescript/SCsub b/modules/gdnative/nativescript/SCsub
index e980e40e8e..178afec64a 100644
--- a/modules/gdnative/nativescript/SCsub
+++ b/modules/gdnative/nativescript/SCsub
@@ -7,4 +7,7 @@ mod_env.add_source_files(env.modules_sources, "*.cpp")
mod_env.Append(CPPPATH='#modules/gdnative')
mod_env.Append(CPPFLAGS=['-DGDAPI_BUILT_IN'])
+if "platform" in env and env["platform"] in ["x11", "iphone"]:
+ env.Append(LINKFLAGS=["-rdynamic"])
+
Export('mod_env')
diff --git a/modules/openssl/stream_peer_openssl.cpp b/modules/openssl/stream_peer_openssl.cpp
index d40bf73883..c19bdc4214 100644
--- a/modules/openssl/stream_peer_openssl.cpp
+++ b/modules/openssl/stream_peer_openssl.cpp
@@ -29,6 +29,17 @@
/*************************************************************************/
#include "stream_peer_openssl.h"
+// Compatibility with OpenSSL 1.1.0.
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+#define BIO_set_num(b, n)
+#else
+#define BIO_set_num(b, n) ((b)->num = (n))
+
+#define BIO_set_init(b, i) ((b)->init = (i))
+#define BIO_set_data(b, p) ((b)->ptr = (p))
+#define BIO_get_data(b) ((b)->ptr)
+#endif
+
//hostname matching code from curl
bool StreamPeerOpenSSL::_match_host_name(const char *name, const char *hostname) {
@@ -157,10 +168,10 @@ int StreamPeerOpenSSL::_cert_verify_callback(X509_STORE_CTX *x509_ctx, void *arg
}
int StreamPeerOpenSSL::_bio_create(BIO *b) {
- b->init = 1;
- b->num = 0;
- b->ptr = NULL;
- b->flags = 0;
+ BIO_set_init(b, 1);
+ BIO_set_num(b, 0);
+ BIO_set_data(b, NULL);
+ BIO_clear_flags(b, ~0);
return 1;
}
@@ -168,9 +179,9 @@ int StreamPeerOpenSSL::_bio_destroy(BIO *b) {
if (b == NULL)
return 0;
- b->ptr = NULL; /* sb_tls_remove() will free it */
- b->init = 0;
- b->flags = 0;
+ BIO_set_data(b, NULL); /* sb_tls_remove() will free it */
+ BIO_set_init(b, 0);
+ BIO_clear_flags(b, ~0);
return 1;
}
@@ -178,7 +189,7 @@ int StreamPeerOpenSSL::_bio_read(BIO *b, char *buf, int len) {
if (buf == NULL || len <= 0) return 0;
- StreamPeerOpenSSL *sp = (StreamPeerOpenSSL *)b->ptr;
+ StreamPeerOpenSSL *sp = (StreamPeerOpenSSL *)BIO_get_data(b);
ERR_FAIL_COND_V(sp == NULL, 0);
@@ -212,7 +223,7 @@ int StreamPeerOpenSSL::_bio_write(BIO *b, const char *buf, int len) {
if (buf == NULL || len <= 0) return 0;
- StreamPeerOpenSSL *sp = (StreamPeerOpenSSL *)b->ptr;
+ StreamPeerOpenSSL *sp = (StreamPeerOpenSSL *)BIO_get_data(b);
ERR_FAIL_COND_V(sp == NULL, 0);
@@ -258,6 +269,26 @@ int StreamPeerOpenSSL::_bio_puts(BIO *b, const char *str) {
return _bio_write(b, str, strlen(str));
}
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+BIO_METHOD *StreamPeerOpenSSL::_bio_method = NULL;
+
+BIO_METHOD *StreamPeerOpenSSL::_get_bio_method() {
+ if (_bio_method) // already initialized.
+ return _bio_method;
+
+ /* it's a source/sink BIO */
+ _bio_method = BIO_meth_new(100 | 0x400, "streampeer glue");
+ BIO_meth_set_write(_bio_method, _bio_write);
+ BIO_meth_set_read(_bio_method, _bio_read);
+ BIO_meth_set_puts(_bio_method, _bio_puts);
+ BIO_meth_set_gets(_bio_method, _bio_gets);
+ BIO_meth_set_ctrl(_bio_method, _bio_ctrl);
+ BIO_meth_set_create(_bio_method, _bio_create);
+ BIO_meth_set_destroy(_bio_method, _bio_destroy);
+
+ return _bio_method;
+}
+#else
BIO_METHOD StreamPeerOpenSSL::_bio_method = {
/* it's a source/sink BIO */
(100 | 0x400),
@@ -271,6 +302,11 @@ BIO_METHOD StreamPeerOpenSSL::_bio_method = {
_bio_destroy
};
+BIO_METHOD *StreamPeerOpenSSL::_get_bio_method() {
+ return &_bio_method;
+}
+#endif
+
Error StreamPeerOpenSSL::connect_to_stream(Ref<StreamPeer> p_base, bool p_validate_certs, const String &p_for_hostname) {
if (connected)
@@ -330,8 +366,8 @@ Error StreamPeerOpenSSL::connect_to_stream(Ref<StreamPeer> p_base, bool p_valida
}
ssl = SSL_new(ctx);
- bio = BIO_new(&_bio_method);
- bio->ptr = this;
+ bio = BIO_new(_get_bio_method());
+ BIO_set_data(bio, this);
SSL_set_bio(ssl, bio, bio);
if (p_for_hostname != String()) {
@@ -532,7 +568,9 @@ void StreamPeerOpenSSL::initialize_ssl() {
load_certs_func = _load_certs;
_create = _create_func;
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
CRYPTO_malloc_init(); // Initialize malloc, free, etc for OpenSSL's use
+#endif
SSL_library_init(); // Initialize OpenSSL's SSL libraries
SSL_load_error_strings(); // Load SSL error strings
ERR_load_BIO_strings(); // Load BIO error strings
diff --git a/modules/openssl/stream_peer_openssl.h b/modules/openssl/stream_peer_openssl.h
index 1e445ef681..535114058d 100644
--- a/modules/openssl/stream_peer_openssl.h
+++ b/modules/openssl/stream_peer_openssl.h
@@ -53,7 +53,12 @@ private:
static int _bio_gets(BIO *b, char *buf, int len);
static int _bio_puts(BIO *b, const char *str);
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+ static BIO_METHOD *_bio_method;
+#else
static BIO_METHOD _bio_method;
+#endif
+ static BIO_METHOD *_get_bio_method();
static bool _match_host_name(const char *name, const char *hostname);
static Error _match_common_name(const char *hostname, const X509 *server_cert);
diff --git a/modules/visual_script/visual_script_func_nodes.cpp b/modules/visual_script/visual_script_func_nodes.cpp
index f02e797fe6..c17265d275 100644
--- a/modules/visual_script/visual_script_func_nodes.cpp
+++ b/modules/visual_script/visual_script_func_nodes.cpp
@@ -42,7 +42,7 @@
int VisualScriptFunctionCall::get_output_sequence_port_count() const {
- if (method_cache.flags & METHOD_FLAG_CONST || call_mode == CALL_MODE_BASIC_TYPE)
+ if (method_cache.flags & METHOD_FLAG_CONST || (call_mode == CALL_MODE_BASIC_TYPE && Variant::is_method_const(basic_type, function)))
return 0;
else
return 1;
@@ -50,7 +50,7 @@ int VisualScriptFunctionCall::get_output_sequence_port_count() const {
bool VisualScriptFunctionCall::has_input_sequence_port() const {
- if (method_cache.flags & METHOD_FLAG_CONST || call_mode == CALL_MODE_BASIC_TYPE)
+ if (method_cache.flags & METHOD_FLAG_CONST || (call_mode == CALL_MODE_BASIC_TYPE && Variant::is_method_const(basic_type, function)))
return false;
else
return true;
diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp
index 8bb7f23ead..c91781ce1d 100644
--- a/platform/iphone/export/export.cpp
+++ b/platform/iphone/export/export.cpp
@@ -52,7 +52,14 @@ class EditorExportPlatformIOS : public EditorExportPlatform {
Ref<ImageTexture> logo;
- void _fix_config_file(const Ref<EditorExportPreset> &p_preset, Vector<uint8_t> &pfile, const String &p_name, const String &p_binary);
+ typedef Error (*FileHandler)(String p_file, void *p_userdata);
+ static Error _walk_dir_recursive(DirAccess *p_da, FileHandler p_handler, void *p_userdata);
+ static Error _codesign(String p_file, void *p_userdata);
+
+ void _fix_config_file(const Ref<EditorExportPreset> &p_preset, Vector<uint8_t> &pfile, const String &p_name, const String &p_binary, bool p_debug);
+ static Error _export_dylibs(void *p_userdata, const String &p_path, const Vector<uint8_t> &p_data, int p_file, int p_total);
+ Error _export_loading_screens(const Ref<EditorExportPreset> &p_preset, const String &p_dest_dir);
+ Error _export_icons(const Ref<EditorExportPreset> &p_preset, const String &p_iconset_dir);
protected:
virtual void get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features);
@@ -63,7 +70,7 @@ public:
virtual String get_os_name() const { return "iOS"; }
virtual Ref<Texture> get_logo() const { return logo; }
- virtual String get_binary_extension() const { return "xcodeproj"; }
+ virtual String get_binary_extension() const { return "ipa"; }
virtual Error export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags = 0);
virtual bool can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const;
@@ -96,16 +103,44 @@ void EditorExportPlatformIOS::get_export_options(List<ExportOption> *r_options)
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_package/debug", PROPERTY_HINT_GLOBAL_FILE, "zip"), ""));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_package/release", PROPERTY_HINT_GLOBAL_FILE, "zip"), ""));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/app_store_team_id"), ""));
+
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/provisioning_profile_uuid_debug"), ""));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/code_sign_identity_debug"), "iPhone Developer"));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "application/export_method_debug", PROPERTY_HINT_ENUM, "App Store,Development,Ad-Hoc,Enterprise"), 1));
+
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/provisioning_profile_uuid_release"), ""));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/code_sign_identity_release"), "iPhone Distribution"));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "application/export_method_release", PROPERTY_HINT_ENUM, "App Store,Development,Ad-Hoc,Enterprise"), 0));
+
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/name"), ""));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/info"), "Made with Godot Engine"));
- // r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/icon", PROPERTY_HINT_FILE, "png"), ""));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/identifier"), "org.godotengine.iosgame"));
- r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/signature"), "godotiosgame"));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/signature"), "????"));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/short_version"), "1.0"));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/version"), "1.0"));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/copyright"), ""));
r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "application/bits_mode", PROPERTY_HINT_ENUM, "Fat (32 & 64 bits),64 bits,32 bits"), 1));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "required_icons/iphone_120x120", PROPERTY_HINT_FILE, "png"), "")); // Home screen on iPhone/iPod Touch with retina display
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "required_icons/ipad_76x76", PROPERTY_HINT_FILE, "png"), "")); // Home screen on iPad
+
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "optional_icons/iphone_180x180", PROPERTY_HINT_FILE, "png"), "")); // Home screen on iPhone with retina HD display
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "optional_icons/ipad_152x152", PROPERTY_HINT_FILE, "png"), "")); // Home screen on iPad with retina display
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "optional_icons/ipad_167x167", PROPERTY_HINT_FILE, "png"), "")); // Home screen on iPad Pro
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "optional_icons/spotlight_40x40", PROPERTY_HINT_FILE, "png"), "")); // Spotlight
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "optional_icons/spotlight_80x80", PROPERTY_HINT_FILE, "png"), "")); // Spotlight on devices with retina display
+
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "landscape_launch_screens/iphone_2208x1242", PROPERTY_HINT_FILE, "png"), "")); // iPhone 6 Plus, 6s Plus, 7 Plus
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "landscape_launch_screens/ipad_2732x2048", PROPERTY_HINT_FILE, "png"), "")); // 12.9-inch iPad Pro
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "landscape_launch_screens/ipad_2048x1536", PROPERTY_HINT_FILE, "png"), "")); // Other iPads
+
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "portrait_launch_screens/iphone_640x1136", PROPERTY_HINT_FILE, "png"), "")); // iPhone 5, 5s, SE
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "portrait_launch_screens/iphone_750x1334", PROPERTY_HINT_FILE, "png"), "")); // iPhone 6, 6s, 7
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "portrait_launch_screens/iphone_1242x2208", PROPERTY_HINT_FILE, "png"), "")); // iPhone 6 Plus, 6s Plus, 7 Plus
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "portrait_launch_screens/ipad_2048x2732", PROPERTY_HINT_FILE, "png"), "")); // 12.9-inch iPad Pro
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "portrait_launch_screens/ipad_1536x2048", PROPERTY_HINT_FILE, "png"), "")); // Other iPads
+
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/s3tc"), false));
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/etc"), false));
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/etc2"), true));
@@ -113,11 +148,17 @@ void EditorExportPlatformIOS::get_export_options(List<ExportOption> *r_options)
/* probably need some more info */
}
-void EditorExportPlatformIOS::_fix_config_file(const Ref<EditorExportPreset> &p_preset, Vector<uint8_t> &pfile, const String &p_name, const String &p_binary) {
-
+void EditorExportPlatformIOS::_fix_config_file(const Ref<EditorExportPreset> &p_preset, Vector<uint8_t> &pfile, const String &p_name, const String &p_binary, bool p_debug) {
+ static const String export_method_string[] = {
+ "app-store",
+ "development",
+ "ad-hoc",
+ "enterprise"
+ };
String str;
String strnew;
str.parse_utf8((const char *)pfile.ptr(), pfile.size());
+ print_line(str);
Vector<String> lines = str.split("\n");
for (int i = 0; i < lines.size(); i++) {
if (lines[i].find("$binary") != -1) {
@@ -136,6 +177,19 @@ void EditorExportPlatformIOS::_fix_config_file(const Ref<EditorExportPreset> &p_
strnew += lines[i].replace("$signature", p_preset->get("application/signature")) + "\n";
} else if (lines[i].find("$copyright") != -1) {
strnew += lines[i].replace("$copyright", p_preset->get("application/copyright")) + "\n";
+ } else if (lines[i].find("$team_id") != -1) {
+ strnew += lines[i].replace("$team_id", p_preset->get("application/app_store_team_id")) + "\n";
+ } else if (lines[i].find("$export_method") != -1) {
+ int export_method = p_preset->get(p_debug ? "application/export_method_debug" : "application/export_method_release");
+ strnew += lines[i].replace("$export_method", export_method_string[export_method]) + "\n";
+ } else if (lines[i].find("$provisioning_profile_uuid_release") != -1) {
+ strnew += lines[i].replace("$provisioning_profile_uuid_release", p_preset->get("application/provisioning_profile_uuid_release")) + "\n";
+ } else if (lines[i].find("$provisioning_profile_uuid_debug") != -1) {
+ strnew += lines[i].replace("$provisioning_profile_uuid_debug", p_preset->get("application/provisioning_profile_uuid_debug")) + "\n";
+ } else if (lines[i].find("$code_sign_identity_debug") != -1) {
+ strnew += lines[i].replace("$code_sign_identity_debug", p_preset->get("application/code_sign_identity_debug")) + "\n";
+ } else if (lines[i].find("$code_sign_identity_release") != -1) {
+ strnew += lines[i].replace("$code_sign_identity_release", p_preset->get("application/code_sign_identity_release")) + "\n";
} else {
strnew += lines[i] + "\n";
}
@@ -150,12 +204,214 @@ void EditorExportPlatformIOS::_fix_config_file(const Ref<EditorExportPreset> &p_
}
}
+Error EditorExportPlatformIOS::_export_dylibs(void *p_userdata, const String &p_path, const Vector<uint8_t> &p_data, int p_file, int p_total) {
+ if (!p_path.ends_with(".dylib")) return OK;
+ const String &dest_dir = *(String *)p_userdata;
+ String rel_path = p_path.replace_first("res://", "dylibs/");
+ DirAccess *dest_dir_access = DirAccess::open(dest_dir);
+ ERR_FAIL_COND_V(!dest_dir_access, ERR_CANT_OPEN);
+
+ String base_dir = rel_path.get_base_dir();
+ Error make_dir_err = OK;
+ if (!dest_dir_access->dir_exists(base_dir)) {
+ make_dir_err = dest_dir_access->make_dir_recursive(base_dir);
+ }
+ if (make_dir_err != OK) {
+ memdelete(dest_dir_access);
+ return make_dir_err;
+ }
+
+ Error copy_err = dest_dir_access->copy(p_path, dest_dir + rel_path);
+ memdelete(dest_dir_access);
+
+ return copy_err;
+}
+
+struct IconInfo {
+ const char *preset_key;
+ const char *idiom;
+ const char *export_name;
+ const char *actual_size_side;
+ const char *scale;
+ const char *unscaled_size;
+ bool is_required;
+};
+
+static const IconInfo icon_infos[] = {
+ { "required_icons/iphone_120x120", "iphone", "Icon-120.png", "120", "2x", "60x60", true },
+ { "required_icons/iphone_120x120", "iphone", "Icon-120.png", "120", "3x", "40x40", true },
+
+ { "required_icons/ipad_76x76", "ipad", "Icon-76.png", "76", "1x", "76x76", false },
+
+ { "optional_icons/iphone_180x180", "iphone", "Icon-180.png", "180", "3x", "60x60", false },
+
+ { "optional_icons/ipad_152x152", "ipad", "Icon-152.png", "152", "2x", "76x76", false },
+
+ { "optional_icons/ipad_167x167", "ipad", "Icon-167.png", "167", "2x", "83.5x83.5", false },
+
+ { "optional_icons/spotlight_40x40", "ipad", "Icon-40.png", "40", "1x", "40x40", false },
+
+ { "optional_icons/spotlight_80x80", "iphone", "Icon-80.png", "80", "2x", "40x40", false },
+ { "optional_icons/spotlight_80x80", "ipad", "Icon-80.png", "80", "2x", "40x40", false }
+
+};
+
+Error EditorExportPlatformIOS::_export_icons(const Ref<EditorExportPreset> &p_preset, const String &p_iconset_dir) {
+ String json_description = "{\"images\":[";
+ String sizes;
+
+ DirAccess *da = DirAccess::open(p_iconset_dir);
+ ERR_FAIL_COND_V(!da, ERR_CANT_OPEN);
+
+ for (int i = 0; i < (sizeof(icon_infos) / sizeof(icon_infos[0])); ++i) {
+ IconInfo info = icon_infos[i];
+ String icon_path = p_preset->get(info.preset_key);
+ if (icon_path.length() == 0) {
+ if (info.is_required) {
+ ERR_PRINT("Required icon is not specified in the preset");
+ return ERR_UNCONFIGURED;
+ }
+ continue;
+ }
+ Error err = da->copy(icon_path, p_iconset_dir + info.export_name);
+ if (err) {
+ memdelete(da);
+ String err_str = String("Failed to export icon: ") + icon_path;
+ ERR_PRINT(err_str.utf8().get_data());
+ return err;
+ }
+ sizes += String(info.actual_size_side) + "\n";
+ if (i > 0) {
+ json_description += ",";
+ }
+ json_description += String("{");
+ json_description += String("\"idiom\":") + "\"" + info.idiom + "\",";
+ json_description += String("\"size\":") + "\"" + info.unscaled_size + "\",";
+ json_description += String("\"scale\":") + "\"" + info.scale + "\",";
+ json_description += String("\"filename\":") + "\"" + info.export_name + "\"";
+ json_description += String("}");
+ }
+ json_description += "]}";
+ memdelete(da);
+
+ FileAccess *json_file = FileAccess::open(p_iconset_dir + "Contents.json", FileAccess::WRITE);
+ ERR_FAIL_COND_V(!json_file, ERR_CANT_CREATE);
+ CharString json_utf8 = json_description.utf8();
+ json_file->store_buffer((const uint8_t *)json_utf8.get_data(), json_utf8.length());
+ memdelete(json_file);
+
+ FileAccess *sizes_file = FileAccess::open(p_iconset_dir + "sizes", FileAccess::WRITE);
+ ERR_FAIL_COND_V(!sizes_file, ERR_CANT_CREATE);
+ CharString sizes_utf8 = sizes.utf8();
+ sizes_file->store_buffer((const uint8_t *)sizes_utf8.get_data(), sizes_utf8.length());
+ memdelete(sizes_file);
+
+ return OK;
+}
+
+struct LoadingScreenInfo {
+ const char *preset_key;
+ const char *export_name;
+};
+
+static const LoadingScreenInfo loading_screen_infos[] = {
+ { "landscape_launch_screens/iphone_2208x1242", "Default-Landscape-736h@3x.png" },
+ { "landscape_launch_screens/ipad_2732x2048", "Default-Landscape-1366h@2x.png" },
+ { "landscape_launch_screens/ipad_2048x1536", "Default-Landscape@2x.png" },
+
+ { "portrait_launch_screens/iphone_640x1136", "Default-568h@2x.png" },
+ { "portrait_launch_screens/iphone_750x1334", "Default-667h@2x.png" },
+ { "portrait_launch_screens/iphone_1242x2208", "Default-Portrait-736h@3x.png" },
+ { "portrait_launch_screens/ipad_2048x2732", "Default-Portrait-1366h@2x.png" },
+ { "portrait_launch_screens/ipad_1536x2048", "Default-Portrait@2x.png" }
+};
+
+Error EditorExportPlatformIOS::_export_loading_screens(const Ref<EditorExportPreset> &p_preset, const String &p_dest_dir) {
+ DirAccess *da = DirAccess::open(p_dest_dir);
+ ERR_FAIL_COND_V(!da, ERR_CANT_OPEN);
+
+ for (int i = 0; i < sizeof(loading_screen_infos) / sizeof(loading_screen_infos[0]); ++i) {
+ LoadingScreenInfo info = loading_screen_infos[i];
+ String loading_screen_file = p_preset->get(info.preset_key);
+ Error err = da->copy(loading_screen_file, p_dest_dir + info.export_name);
+ if (err) {
+ memdelete(da);
+ String err_str = String("Failed to export loading screen: ") + loading_screen_file;
+ ERR_PRINT(err_str.utf8().get_data());
+ return err;
+ }
+ }
+ memdelete(da);
+
+ return OK;
+}
+
+Error EditorExportPlatformIOS::_walk_dir_recursive(DirAccess *p_da, FileHandler p_handler, void *p_userdata) {
+ Vector<String> dirs;
+ String path;
+ String current_dir = p_da->get_current_dir();
+ p_da->list_dir_begin();
+ while ((path = p_da->get_next()).length() != 0) {
+ if (p_da->current_is_dir()) {
+ if (path != "." && path != "..") {
+ dirs.push_back(path);
+ }
+ } else {
+ Error err = p_handler(current_dir + "/" + path, p_userdata);
+ if (err) {
+ p_da->list_dir_end();
+ return err;
+ }
+ }
+ }
+ p_da->list_dir_end();
+
+ for (int i = 0; i < dirs.size(); ++i) {
+ String dir = dirs[i];
+ p_da->change_dir(dir);
+ Error err = _walk_dir_recursive(p_da, p_handler, p_userdata);
+ p_da->change_dir("..");
+ if (err) {
+ return err;
+ }
+ }
+
+ return OK;
+}
+
+struct CodesignData {
+ const Ref<EditorExportPreset> &preset;
+ bool debug;
+
+ CodesignData(const Ref<EditorExportPreset> &p_preset, bool p_debug)
+ : preset(p_preset), debug(p_debug) {
+ }
+};
+
+Error EditorExportPlatformIOS::_codesign(String p_file, void *p_userdata) {
+ if (p_file.ends_with(".dylib")) {
+ CodesignData *data = (CodesignData *)p_userdata;
+ print_line(String("Signing ") + p_file);
+ List<String> codesign_args;
+ codesign_args.push_back("-f");
+ codesign_args.push_back("-s");
+ codesign_args.push_back(data->preset->get(data->debug ? "application/code_sign_identity_debug" : "application/code_sign_identity_release"));
+ codesign_args.push_back(p_file);
+ return OS::get_singleton()->execute("/usr/bin/codesign", codesign_args, true);
+ }
+ return OK;
+}
+
Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags) {
String src_pkg_name;
String dest_dir = p_path.get_base_dir() + "/";
String binary_name = p_path.get_file().get_basename();
- EditorProgress ep("export", "Exporting for iOS", 3);
+ EditorProgress ep("export", "Exporting for iOS", 5);
+
+ String team_id = p_preset->get("application/app_store_team_id");
+ ERR_EXPLAIN("App Store Team ID not specified - cannot configure the project.");
+ ERR_FAIL_COND_V(team_id.length() == 0, ERR_CANT_OPEN);
if (p_debug)
src_pkg_name = p_preset->get("custom_package/debug");
@@ -206,6 +462,15 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p
bool found_binary = false;
int total_size = 0;
+ Set<String> files_to_parse;
+ files_to_parse.insert("godot_ios/godot_ios-Info.plist");
+ files_to_parse.insert("godot_ios.xcodeproj/project.pbxproj");
+ files_to_parse.insert("export_options.plist");
+ files_to_parse.insert("godot_ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata");
+ files_to_parse.insert("godot_ios.xcodeproj/xcshareddata/xcschemes/godot_ios.xcscheme");
+
+ print_line("Unzipping...");
+
while (ret == UNZ_OK) {
bool is_execute = false;
@@ -229,12 +494,9 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p
file = file.replace_first("iphone/", "");
- if (file == "godot_ios.xcodeproj/project.pbxproj") {
- print_line("parse pbxproj");
- _fix_config_file(p_preset, data, pkg_name, binary_name);
- } else if (file == "godot_ios/godot_ios-Info.plist") {
- print_line("parse plist");
- _fix_config_file(p_preset, data, pkg_name, binary_name);
+ if (files_to_parse.has(file)) {
+ print_line(String("parse ") + file);
+ _fix_config_file(p_preset, data, pkg_name, binary_name, p_debug);
} else if (file.begins_with("godot.iphone")) {
if (file != binary_to_use) {
ret = unzGoToNextFile(src_pkg_zip);
@@ -264,6 +526,7 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p
if (dir_err) {
ERR_PRINTS("Can't create '" + dir_name + "'.");
unzClose(src_pkg_zip);
+ memdelete(tmp_app_path);
return ERR_CANT_CREATE;
}
}
@@ -273,6 +536,7 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p
if (!f) {
ERR_PRINTS("Can't write '" + file + "'.");
unzClose(src_pkg_zip);
+ memdelete(tmp_app_path);
return ERR_CANT_CREATE;
};
f->store_buffer(data.ptr(), data.size());
@@ -295,26 +559,79 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p
if (!found_binary) {
ERR_PRINTS("Requested template binary '" + binary_to_use + "' not found. It might be missing from your template archive.");
- unzClose(src_pkg_zip);
+ memdelete(tmp_app_path);
return ERR_FILE_NOT_FOUND;
}
- ep.step("Making PKG", 1);
+ String iconset_dir = dest_dir + binary_name + "/Images.xcassets/AppIcon.appiconset/";
+ Error err = OK;
+ if (!tmp_app_path->dir_exists(iconset_dir)) {
+ Error err = tmp_app_path->make_dir_recursive(iconset_dir);
+ }
+ memdelete(tmp_app_path);
+ if (err)
+ return err;
+
+ err = _export_icons(p_preset, iconset_dir);
+ if (err)
+ return err;
+
+ err = _export_loading_screens(p_preset, dest_dir + binary_name + "/");
+ if (err)
+ return err;
+
+ ep.step("Making .pck", 1);
String pack_path = dest_dir + binary_name + ".pck";
- Error err = save_pack(p_preset, pack_path);
+ err = save_pack(p_preset, pack_path);
+ if (err)
+ return err;
- if (err) {
+ err = export_project_files(p_preset, _export_dylibs, &dest_dir);
+ if (err)
return err;
- }
#ifdef OSX_ENABLED
- /* and open up xcode with our new project.... */
- List<String> args;
- args.push_back(p_path);
- err = OS::get_singleton()->execute("/usr/bin/open", args, false);
+ ep.step("Making .xcarchive", 2);
+ String archive_path = p_path.get_basename() + ".xcarchive";
+ List<String> archive_args;
+ archive_args.push_back("-project");
+ archive_args.push_back(dest_dir + binary_name + ".xcodeproj");
+ archive_args.push_back("-scheme");
+ archive_args.push_back(binary_name);
+ archive_args.push_back("-sdk");
+ archive_args.push_back("iphoneos");
+ archive_args.push_back("-configuration");
+ archive_args.push_back(p_debug ? "Debug" : "Release");
+ archive_args.push_back("-destination");
+ archive_args.push_back("generic/platform=iOS");
+ archive_args.push_back("archive");
+ archive_args.push_back("-archivePath");
+ archive_args.push_back(archive_path);
+ err = OS::get_singleton()->execute("/usr/bin/xcodebuild", archive_args, true);
ERR_FAIL_COND_V(err, err);
+ ep.step("Code-signing dylibs", 3);
+ DirAccess *dylibs_dir = DirAccess::open(archive_path + "/Products/Applications/" + binary_name + ".app/dylibs");
+ ERR_FAIL_COND_V(!dylibs_dir, ERR_CANT_OPEN);
+ CodesignData codesign_data(p_preset, p_debug);
+ err = _walk_dir_recursive(dylibs_dir, _codesign, &codesign_data);
+ memdelete(dylibs_dir);
+ ERR_FAIL_COND_V(err, err);
+
+ ep.step("Making .ipa", 4);
+ List<String> export_args;
+ export_args.push_back("-exportArchive");
+ export_args.push_back("-archivePath");
+ export_args.push_back(archive_path);
+ export_args.push_back("-exportOptionsPlist");
+ export_args.push_back(dest_dir + "export_options.plist");
+ export_args.push_back("-exportPath");
+ export_args.push_back(dest_dir);
+ err = OS::get_singleton()->execute("/usr/bin/xcodebuild", export_args, true);
+ ERR_FAIL_COND_V(err, err);
+#else
+ print_line(".ipa can only be built on macOS. Leaving XCode project without building the package.");
#endif
return OK;
diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h
index c6a9aeba88..6c81da04f5 100644
--- a/platform/osx/os_osx.h
+++ b/platform/osx/os_osx.h
@@ -184,7 +184,6 @@ public:
virtual void get_fullscreen_mode_list(List<VideoMode> *p_list, int p_screen = 0) const;
virtual String get_executable_path() const;
- virtual String get_resource_dir() const;
virtual LatinKeyboardVariant get_latin_keyboard_variant() const;
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm
index 2e300c963d..9a26adc155 100644
--- a/platform/osx/os_osx.mm
+++ b/platform/osx/os_osx.mm
@@ -1733,29 +1733,6 @@ String OS_OSX::get_executable_path() const {
}
}
-String OS_OSX::get_resource_dir() const {
- /*
- Bastiaan Olij - I'm leaving this code commented out but in place so we can have a further discussion about this later on.
- For loading the package file from the resource folder it makes more sense to make this call work in ProjectSettings::setup
- instead of relying on changing the current working folder as is the case right now (see godot_main_osx.mm).
- The problem is that when this function returns a value we try and load a project.godot file from this resources folder and
- stop attempting to load anything else if that fails. That breaks our tools build.
- One possible solution is to only apply this logic in a non-tools build with an ifdef block.
-
- For now however, just returning this to working condition.
-
- // start with our executable path
- String path = get_executable_path();
-
- int pos = path.find_last("/Contents/MacOS/");
- if (pos < 0)
- return OS::get_resource_dir();
-
- return path.substr(0, pos) + "/Contents/Resources/";
-*/
- return OS::get_resource_dir();
-}
-
// Returns string representation of keys, if they are printable.
//
static NSString *createStringForKeys(const CGKeyCode *keyCode, int length) {
diff --git a/platform/server/detect.py b/platform/server/detect.py
index 2bb4b59e94..5c13297bc6 100644
--- a/platform/server/detect.py
+++ b/platform/server/detect.py
@@ -65,15 +65,6 @@ def configure(env):
# FIXME: Check for existence of the libs before parsing their flags with pkg-config
if (env['builtin_openssl'] == 'no'):
- # Currently not compatible with OpenSSL 1.1.0+
- # https://github.com/godotengine/godot/issues/8624
- import subprocess
- openssl_version = subprocess.check_output(['pkg-config', 'openssl', '--modversion']).strip('\n')
- if (openssl_version >= "1.1.0"):
- print("Error: Found system-installed OpenSSL %s, currently only supporting version 1.0.x." % openssl_version)
- print("Aborting.. You can compile with 'builtin_openssl=yes' to use the bundled version.\n")
- sys.exit(255)
-
env.ParseConfig('pkg-config openssl --cflags --libs')
if (env['builtin_libwebp'] == 'no'):
@@ -98,6 +89,9 @@ def configure(env):
if (env['builtin_squish'] == 'no' and env["tools"] == "yes"):
env.ParseConfig('pkg-config libsquish --cflags --libs')
+ if env['builtin_zstd'] == 'no':
+ env.ParseConfig('pkg-config libzstd --cflags --libs')
+
# Sound and video libraries
# Keep the order as it triggers chained dependencies (ogg needed by others, etc.)
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
index 65eb51a2f3..053ea466f3 100644
--- a/platform/windows/detect.py
+++ b/platform/windows/detect.py
@@ -64,6 +64,7 @@ def get_opts():
return [
('mingw_prefix_32', 'MinGW prefix (Win32)', mingw32),
('mingw_prefix_64', 'MinGW prefix (Win64)', mingw64),
+ ('use_lto', 'Use link time optimization (when using MingW)', 'no'),
('debug_symbols', 'Add debug symbols to release version (yes/no/full)', 'yes')
]
@@ -256,11 +257,15 @@ def configure(env):
env["CC"] = mingw_prefix + "gcc"
env['AS'] = mingw_prefix + "as"
env['CXX'] = mingw_prefix + "g++"
- env['AR'] = mingw_prefix + "ar"
- env['RANLIB'] = mingw_prefix + "ranlib"
+ env['AR'] = mingw_prefix + "gcc-ar"
+ env['RANLIB'] = mingw_prefix + "gcc-ranlib"
env['LD'] = mingw_prefix + "g++"
env["x86_libtheora_opt_gcc"] = True
+ if (env["use_lto"] == "yes"):
+ env.Append(CCFLAGS=['-flto'])
+ env.Append(LINKFLAGS=['-flto'])
+
## Compile flags
env.Append(CCFLAGS=['-DWINDOWS_ENABLED', '-mwindows'])
diff --git a/platform/x11/detect.py b/platform/x11/detect.py
index efd388e44f..b9b4ad8201 100644
--- a/platform/x11/detect.py
+++ b/platform/x11/detect.py
@@ -120,6 +120,9 @@ def configure(env):
if (env["use_lto"] == "yes"):
env.Append(CCFLAGS=['-flto'])
env.Append(LINKFLAGS=['-flto'])
+ if (env["use_llvm"] == "no"):
+ env['RANLIB'] = 'gcc-ranlib'
+ env['AR'] = 'gcc-ar'
env.Append(CCFLAGS=['-pipe'])
env.Append(LINKFLAGS=['-pipe'])
@@ -134,15 +137,6 @@ def configure(env):
# FIXME: Check for existence of the libs before parsing their flags with pkg-config
if (env['builtin_openssl'] == 'no'):
- # Currently not compatible with OpenSSL 1.1.0+
- # https://github.com/godotengine/godot/issues/8624
- import subprocess
- openssl_version = subprocess.check_output(['pkg-config', 'openssl', '--modversion']).strip('\n')
- if (openssl_version >= "1.1.0"):
- print("Error: Found system-installed OpenSSL %s, currently only supporting version 1.0.x." % openssl_version)
- print("Aborting.. You can compile with 'builtin_openssl=yes' to use the bundled version.\n")
- sys.exit(255)
-
env.ParseConfig('pkg-config openssl --cflags --libs')
if (env['builtin_libwebp'] == 'no'):
@@ -167,6 +161,9 @@ def configure(env):
if (env['builtin_squish'] == 'no' and env["tools"] == "yes"):
env.ParseConfig('pkg-config libsquish --cflags --libs')
+ if env['builtin_zstd'] == 'no':
+ env.ParseConfig('pkg-config libzstd --cflags --libs')
+
# Sound and video libraries
# Keep the order as it triggers chained dependencies (ogg needed by others, etc.)
diff --git a/scene/2d/collision_object_2d.cpp b/scene/2d/collision_object_2d.cpp
index ce56b85a9e..73e5dc6021 100644
--- a/scene/2d/collision_object_2d.cpp
+++ b/scene/2d/collision_object_2d.cpp
@@ -82,7 +82,7 @@ uint32_t CollisionObject2D::create_shape_owner(Object *p_owner) {
uint32_t id;
if (shapes.size() == 0) {
- id = 1;
+ id = 0;
} else {
id = shapes.back()->key() + 1;
}
diff --git a/scene/3d/collision_object.cpp b/scene/3d/collision_object.cpp
index 1c0633fba7..7b4770e435 100644
--- a/scene/3d/collision_object.cpp
+++ b/scene/3d/collision_object.cpp
@@ -161,7 +161,7 @@ uint32_t CollisionObject::create_shape_owner(Object *p_owner) {
uint32_t id;
if (shapes.size() == 0) {
- id = 1;
+ id = 0;
} else {
id = shapes.back()->key() + 1;
}
diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp
index 4f62d88934..b020238cac 100644
--- a/scene/main/scene_tree.cpp
+++ b/scene/main/scene_tree.cpp
@@ -2216,6 +2216,7 @@ void SceneTree::_bind_methods() {
BIND_ENUM_CONSTANT(STRETCH_ASPECT_KEEP);
BIND_ENUM_CONSTANT(STRETCH_ASPECT_KEEP_WIDTH);
BIND_ENUM_CONSTANT(STRETCH_ASPECT_KEEP_HEIGHT);
+ BIND_ENUM_CONSTANT(STRETCH_ASPECT_EXPAND);
}
SceneTree *SceneTree::singleton = NULL;
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp
index c6b434af44..da0f522ff3 100644
--- a/scene/resources/material.cpp
+++ b/scene/resources/material.cpp
@@ -268,6 +268,8 @@ void SpatialMaterial::init_shaders() {
shader_names->grow = "grow";
+ shader_names->ao_light_affect = "ao_light_affect";
+
shader_names->proximity_fade_distance = "proximity_fade_distance";
shader_names->distance_fade_min = "distance_fade_min";
shader_names->distance_fade_max = "distance_fade_max";
@@ -462,6 +464,7 @@ void SpatialMaterial::_update_shader() {
if (features[FEATURE_AMBIENT_OCCLUSION]) {
code += "uniform sampler2D texture_ambient_occlusion : hint_white;\n";
code += "uniform vec4 ao_texture_channel;\n";
+ code += "uniform float ao_light_affect;\n";
}
if (features[FEATURE_DETAIL]) {
@@ -796,6 +799,8 @@ void SpatialMaterial::_update_shader() {
code += "\tAO = dot(texture(texture_ambient_occlusion,base_uv),ao_texture_channel);\n";
}
}
+
+ code += "\tAO_LIGHT_AFFECT = ao_light_affect;\n";
}
if (features[FEATURE_SUBSURACE_SCATTERING]) {
@@ -1012,6 +1017,16 @@ float SpatialMaterial::get_rim_tint() const {
return rim_tint;
}
+void SpatialMaterial::set_ao_light_affect(float p_ao_light_affect) {
+
+ ao_light_affect = p_ao_light_affect;
+ VS::get_singleton()->material_set_param(_get_material(), shader_names->ao_light_affect, p_ao_light_affect);
+}
+float SpatialMaterial::get_ao_light_affect() const {
+
+ return ao_light_affect;
+}
+
void SpatialMaterial::set_clearcoat(float p_clearcoat) {
clearcoat = p_clearcoat;
@@ -1745,6 +1760,9 @@ void SpatialMaterial::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_grow", "amount"), &SpatialMaterial::set_grow);
ClassDB::bind_method(D_METHOD("get_grow"), &SpatialMaterial::get_grow);
+ ClassDB::bind_method(D_METHOD("set_ao_light_affect", "amount"), &SpatialMaterial::set_ao_light_affect);
+ ClassDB::bind_method(D_METHOD("get_ao_light_affect"), &SpatialMaterial::get_ao_light_affect);
+
ClassDB::bind_method(D_METHOD("set_alpha_scissor_threshold", "threshold"), &SpatialMaterial::set_alpha_scissor_threshold);
ClassDB::bind_method(D_METHOD("get_alpha_scissor_threshold"), &SpatialMaterial::get_alpha_scissor_threshold);
@@ -1853,6 +1871,7 @@ void SpatialMaterial::_bind_methods() {
ADD_GROUP("Ambient Occlusion", "ao_");
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "ao_enabled"), "set_feature", "get_feature", FEATURE_AMBIENT_OCCLUSION);
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "ao_light_affect", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_ao_light_affect", "get_ao_light_affect");
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "ao_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_texture", "get_texture", TEXTURE_AMBIENT_OCCLUSION);
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "ao_on_uv2"), "set_flag", "get_flag", FLAG_AO_ON_UV2);
ADD_PROPERTY(PropertyInfo(Variant::INT, "ao_texture_channel", PROPERTY_HINT_ENUM, "Red,Green,Blue,Alpha,Gray"), "set_ao_texture_channel", "get_ao_texture_channel");
@@ -2036,6 +2055,8 @@ SpatialMaterial::SpatialMaterial()
set_distance_fade_min_distance(0);
set_distance_fade_max_distance(10);
+ set_ao_light_affect(0.0);
+
set_metallic_texture_channel(TEXTURE_CHANNEL_RED);
set_roughness_texture_channel(TEXTURE_CHANNEL_RED);
set_ao_texture_channel(TEXTURE_CHANNEL_RED);
diff --git a/scene/resources/material.h b/scene/resources/material.h
index 721514f586..cf190f0921 100644
--- a/scene/resources/material.h
+++ b/scene/resources/material.h
@@ -315,6 +315,7 @@ private:
StringName proximity_fade_distance;
StringName distance_fade_min;
StringName distance_fade_max;
+ StringName ao_light_affect;
StringName metallic_texture_channel;
StringName roughness_texture_channel;
@@ -358,6 +359,7 @@ private:
float point_size;
float alpha_scissor_threshold;
bool grow_enabled;
+ float ao_light_affect;
float grow;
int particles_anim_h_frames;
int particles_anim_v_frames;
@@ -443,6 +445,9 @@ public:
void set_rim_tint(float p_rim_tint);
float get_rim_tint() const;
+ void set_ao_light_affect(float p_ao_light_affect);
+ float get_ao_light_affect() const;
+
void set_clearcoat(float p_clearcoat);
float get_clearcoat() const;
diff --git a/servers/audio/effects/audio_effect_chorus.cpp b/servers/audio/effects/audio_effect_chorus.cpp
index 76dd585ffa..32631beb2c 100644
--- a/servers/audio/effects/audio_effect_chorus.cpp
+++ b/servers/audio/effects/audio_effect_chorus.cpp
@@ -182,9 +182,8 @@ Ref<AudioEffectInstance> AudioEffectChorus::instance() {
void AudioEffectChorus::set_voice_count(int p_voices) {
- ERR_FAIL_COND(p_voices < 1 || p_voices >= MAX_VOICES);
+ ERR_FAIL_COND(p_voices < 1 || p_voices > MAX_VOICES);
voice_count = p_voices;
- _change_notify();
}
int AudioEffectChorus::get_voice_count() const {
diff --git a/servers/audio/effects/audio_effect_limiter.cpp b/servers/audio/effects/audio_effect_limiter.cpp
index 9787ba8109..c50dd804f2 100644
--- a/servers/audio/effects/audio_effect_limiter.cpp
+++ b/servers/audio/effects/audio_effect_limiter.cpp
@@ -110,7 +110,7 @@ void AudioEffectLimiter::set_soft_clip_ratio(float p_soft_clip) {
}
float AudioEffectLimiter::get_soft_clip_ratio() const {
- return soft_clip;
+ return soft_clip_ratio;
}
void AudioEffectLimiter::_bind_methods() {
diff --git a/servers/physics_2d/physics_2d_server_wrap_mt.cpp b/servers/physics_2d/physics_2d_server_wrap_mt.cpp
index a4e6abfd45..f8f3b620d4 100644
--- a/servers/physics_2d/physics_2d_server_wrap_mt.cpp
+++ b/servers/physics_2d/physics_2d_server_wrap_mt.cpp
@@ -109,16 +109,13 @@ void Physics2DServerWrapMT::init() {
if (create_thread) {
step_sem = Semaphore::create();
- print_line("CREATING PHYSICS 2D THREAD");
//OS::get_singleton()->release_rendering_thread();
if (create_thread) {
thread = Thread::create(_thread_callback, this);
- print_line("STARTING PHYISICS 2D THREAD");
}
while (!step_thread_up) {
OS::get_singleton()->delay_usec(1000);
}
- print_line("DONE PHYSICS 2D THREAD");
} else {
physics_2d_server->init();
diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp
index ec3337686f..595decb529 100644
--- a/servers/visual/shader_language.cpp
+++ b/servers/visual/shader_language.cpp
@@ -267,6 +267,7 @@ const ShaderLanguage::KeyWord ShaderLanguage::keyword_list[] = {
{ TK_CF_BREAK, "break" },
{ TK_CF_CONTINUE, "continue" },
{ TK_CF_RETURN, "return" },
+ { TK_CF_DISCARD, "discard" },
{ TK_UNIFORM, "uniform" },
{ TK_VARYING, "varying" },
{ TK_ARG_IN, "in" },
@@ -3804,6 +3805,10 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct
func_node->return_type = type;
func_node->return_precision = precision;
+ if (p_functions.has(name)) {
+ func_node->can_discard = p_functions[name].can_discard;
+ }
+
func_node->body = alloc_node<BlockNode>();
func_node->body->parent_function = func_node;
diff --git a/servers/visual/shader_types.cpp b/servers/visual/shader_types.cpp
index e828898f82..8c1cb9c828 100644
--- a/servers/visual/shader_types.cpp
+++ b/servers/visual/shader_types.cpp
@@ -105,6 +105,7 @@ ShaderTypes::ShaderTypes() {
shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["SSS_STRENGTH"] = ShaderLanguage::TYPE_FLOAT;
shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["TRANSMISSION"] = ShaderLanguage::TYPE_VEC3;
shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["AO"] = ShaderLanguage::TYPE_FLOAT;
+ shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["AO_LIGHT_AFFECT"] = ShaderLanguage::TYPE_FLOAT;
shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["EMISSION"] = ShaderLanguage::TYPE_VEC3;
shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["SCREEN_TEXTURE"] = ShaderLanguage::TYPE_SAMPLER2D;
shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["DEPTH_TEXTURE"] = ShaderLanguage::TYPE_SAMPLER2D;
diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h
index 7c7ce46268..b5cae978f5 100644
--- a/servers/visual/visual_server_raster.h
+++ b/servers/visual/visual_server_raster.h
@@ -589,11 +589,29 @@ class VisualServerRaster : public VisualServer {
#endif
void _draw_margins();
+ static void _changes_changed() {}
public:
+//if editor is redrawing when it shouldn't, enable this and put a breakpoint in _changes_changed()
+//#define DEBUG_CHANGES
+
+#ifdef DEBUG_CHANGES
+ _FORCE_INLINE_ static void redraw_request() {
+ changes++;
+ _changes_changed();
+ }
+
+#define DISPLAY_CHANGED \
+ changes++; \
+ _changes_changed();
+
+#else
_FORCE_INLINE_ static void redraw_request() { changes++; }
-#define DISPLAY_CHANGED changes++;
+#define DISPLAY_CHANGED \
+ changes++;
+#endif
+// print_line(String("CHANGED: ") + __FUNCTION__);
#define BIND0R(m_r, m_name) \
m_r m_name() { return BINDBASE->m_name(); }
diff --git a/thirdparty/zstd/SCsub b/thirdparty/zstd/SCsub
new file mode 100644
index 0000000000..e8be1aaf44
--- /dev/null
+++ b/thirdparty/zstd/SCsub
@@ -0,0 +1,23 @@
+#!/usr/bin/env python
+
+Import('env')
+
+thirdparty_zstd_dir = "#thirdparty/zstd/"
+thirdparty_zstd_sources = [
+ "common/entropy_common.c",
+ "common/error_private.c",
+ "common/fse_decompress.c",
+ "common/pool.c",
+ "common/threading.c",
+ "common/xxhash.c",
+ "common/zstd_common.c",
+ "compress/fse_compress.c",
+ "compress/huf_compress.c",
+ "compress/zstd_compress.c",
+ "compress/zstdmt_compress.c",
+ "decompress/huf_decompress.c",
+ "decompress/zstd_decompress.c",
+]
+thirdparty_zstd_sources = [thirdparty_zstd_dir + file for file in thirdparty_zstd_sources]
+env.add_source_files(env.core_sources, thirdparty_zstd_sources)
+env.Append(CPPPATH=["#thirdparty/zstd", "#thirdparty/zstd/common"])