summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/image.cpp27
-rw-r--r--editor/editor_node.cpp13
-rw-r--r--editor/editor_themes.cpp9
-rw-r--r--main/main.cpp42
-rw-r--r--misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj72
-rw-r--r--misc/dist/ios_xcode/godot_ios/godot_ios.entitlements3
-rw-r--r--modules/arkit/SCsub3
-rw-r--r--modules/camera/SCsub3
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Build/BuildTool.cs2
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/ExternalEditorId.cs2
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Internals/ScriptClassParser.cs6
-rw-r--r--platform/iphone/SCsub3
-rw-r--r--platform/iphone/export/export.cpp4
-rw-r--r--platform/iphone/in_app_store.mm2
-rw-r--r--scene/gui/tab_container.cpp23
-rw-r--r--scene/gui/tab_container.h2
-rw-r--r--scene/resources/default_theme/default_theme.cpp16
-rw-r--r--servers/rendering/shader_language.cpp6
18 files changed, 92 insertions, 146 deletions
diff --git a/core/image.cpp b/core/image.cpp
index 0f15574053..45f10625a9 100644
--- a/core/image.cpp
+++ b/core/image.cpp
@@ -678,34 +678,35 @@ static void _scale_bilinear(const uint8_t *__restrict p_src, uint8_t *__restrict
enum {
FRAC_BITS = 8,
FRAC_LEN = (1 << FRAC_BITS),
+ FRAC_HALF = (FRAC_LEN >> 1),
FRAC_MASK = FRAC_LEN - 1
-
};
for (uint32_t i = 0; i < p_dst_height; i++) {
- uint32_t src_yofs_up_fp = (i * p_src_height * FRAC_LEN / p_dst_height);
- uint32_t src_yofs_frac = src_yofs_up_fp & FRAC_MASK;
- uint32_t src_yofs_up = src_yofs_up_fp >> FRAC_BITS;
-
- uint32_t src_yofs_down = (i + 1) * p_src_height / p_dst_height;
+ // Add 0.5 in order to interpolate based on pixel center
+ uint32_t src_yofs_up_fp = (i + 0.5) * p_src_height * FRAC_LEN / p_dst_height;
+ // Calculate nearest src pixel center above current, and truncate to get y index
+ uint32_t src_yofs_up = src_yofs_up_fp >= FRAC_HALF ? (src_yofs_up_fp - FRAC_HALF) >> FRAC_BITS : 0;
+ uint32_t src_yofs_down = (src_yofs_up_fp + FRAC_HALF) >> FRAC_BITS;
if (src_yofs_down >= p_src_height) {
src_yofs_down = p_src_height - 1;
}
-
- //src_yofs_up*=CC;
- //src_yofs_down*=CC;
+ // Calculate distance to pixel center of src_yofs_up
+ uint32_t src_yofs_frac = src_yofs_up_fp & FRAC_MASK;
+ src_yofs_frac = src_yofs_frac >= FRAC_HALF ? src_yofs_frac - FRAC_HALF : src_yofs_frac + FRAC_HALF;
uint32_t y_ofs_up = src_yofs_up * p_src_width * CC;
uint32_t y_ofs_down = src_yofs_down * p_src_width * CC;
for (uint32_t j = 0; j < p_dst_width; j++) {
- uint32_t src_xofs_left_fp = (j * p_src_width * FRAC_LEN / p_dst_width);
- uint32_t src_xofs_frac = src_xofs_left_fp & FRAC_MASK;
- uint32_t src_xofs_left = src_xofs_left_fp >> FRAC_BITS;
- uint32_t src_xofs_right = (j + 1) * p_src_width / p_dst_width;
+ uint32_t src_xofs_left_fp = (j + 0.5) * p_src_width * FRAC_LEN / p_dst_width;
+ uint32_t src_xofs_left = src_xofs_left_fp >= FRAC_HALF ? (src_xofs_left_fp - FRAC_HALF) >> FRAC_BITS : 0;
+ uint32_t src_xofs_right = (src_xofs_left_fp + FRAC_HALF) >> FRAC_BITS;
if (src_xofs_right >= p_src_width) {
src_xofs_right = p_src_width - 1;
}
+ uint32_t src_xofs_frac = src_xofs_left_fp & FRAC_MASK;
+ src_xofs_frac = src_xofs_frac >= FRAC_HALF ? src_xofs_frac - FRAC_HALF : src_xofs_frac + FRAC_HALF;
src_xofs_left *= CC;
src_xofs_right *= CC;
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index bb34a45938..d8bc555d6d 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -3642,17 +3642,12 @@ Ref<Texture2D> EditorNode::get_class_icon(const String &p_class, const String &p
}
if (ScriptServer::is_global_class(p_class)) {
- String icon_path = EditorNode::get_editor_data().script_class_get_icon_path(p_class);
- Ref<ImageTexture> icon = _load_custom_class_icon(icon_path);
- if (icon.is_valid()) {
- return icon;
- }
-
- Ref<Script> script = ResourceLoader::load(ScriptServer::get_global_class_path(p_class), "Script");
+ Ref<ImageTexture> icon;
+ Ref<Script> script = EditorNode::get_editor_data().script_class_load_script(p_class);
while (script.is_valid()) {
- String current_icon_path;
- script->get_language()->get_global_class_name(script->get_path(), nullptr, &current_icon_path);
+ StringName name = EditorNode::get_editor_data().script_class_get_name(script->get_path());
+ String current_icon_path = EditorNode::get_editor_data().script_class_get_icon_path(name);
icon = _load_custom_class_icon(current_icon_path);
if (icon.is_valid()) {
return icon;
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp
index 5f59e6e70a..a93763810b 100644
--- a/editor/editor_themes.cpp
+++ b/editor/editor_themes.cpp
@@ -570,17 +570,8 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_stylebox("focus", "PopupMenu", style_menu);
theme->set_stylebox("disabled", "PopupMenu", style_menu);
- theme->set_stylebox("normal", "Button", style_menu);
- theme->set_stylebox("hover", "Button", style_menu);
- theme->set_stylebox("pressed", "Button", style_menu);
- theme->set_stylebox("focus", "Button", style_menu);
- theme->set_stylebox("disabled", "Button", style_menu);
-
theme->set_color("font_color", "MenuButton", font_color);
theme->set_color("font_color_hover", "MenuButton", font_color_hl);
- theme->set_color("font_color", "Button", font_color);
- theme->set_color("font_color_hover", "Button", font_color_hl);
- theme->set_color("font_color_pressed", "Button", accent_color);
theme->set_stylebox("MenuHover", "EditorStyles", style_menu_hover_border);
diff --git a/main/main.cpp b/main/main.cpp
index 747b12677d..00760b39b0 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -2266,25 +2266,37 @@ bool Main::iteration() {
return exit;
}
- if (OS::get_singleton()->is_in_low_processor_usage_mode() || !DisplayServer::get_singleton()->can_any_window_draw()) {
- OS::get_singleton()->delay_usec(OS::get_singleton()->get_low_processor_usage_mode_sleep_usec()); //apply some delay to force idle time
- } else {
- uint32_t frame_delay = Engine::get_singleton()->get_frame_delay();
- if (frame_delay) {
- OS::get_singleton()->delay_usec(Engine::get_singleton()->get_frame_delay() * 1000);
- }
+ const uint32_t frame_delay = Engine::get_singleton()->get_frame_delay();
+ if (frame_delay) {
+ // Add fixed frame delay to decrease CPU/GPU usage. This doesn't take
+ // the actual frame time into account.
+ // Due to the high fluctuation of the actual sleep duration, it's not recommended
+ // to use this as a FPS limiter.
+ OS::get_singleton()->delay_usec(frame_delay * 1000);
+ }
+
+ // Add a dynamic frame delay to decrease CPU/GPU usage. This takes the
+ // previous frame time into account for a smoother result.
+ uint64_t dynamic_delay = 0;
+ if (OS::get_singleton()->is_in_low_processor_usage_mode() || !DisplayServer::get_singleton()->window_can_draw()) {
+ dynamic_delay = OS::get_singleton()->get_low_processor_usage_mode_sleep_usec();
+ }
+ const int target_fps = Engine::get_singleton()->get_target_fps();
+ if (target_fps > 0 && !Engine::get_singleton()->is_editor_hint()) {
+ // Override the low processor usage mode sleep delay if the target FPS is lower.
+ dynamic_delay = MAX(dynamic_delay, (uint64_t)(1000000 / target_fps));
}
- int target_fps = Engine::get_singleton()->get_target_fps();
- if (target_fps > 0 && !Engine::get_singleton()->is_editor_hint()) {
- uint64_t time_step = 1000000L / target_fps;
- target_ticks += time_step;
+ if (dynamic_delay > 0) {
+ target_ticks += dynamic_delay;
uint64_t current_ticks = OS::get_singleton()->get_ticks_usec();
+
if (current_ticks < target_ticks) {
OS::get_singleton()->delay_usec(target_ticks - current_ticks);
}
+
current_ticks = OS::get_singleton()->get_ticks_usec();
- target_ticks = MIN(MAX(target_ticks, current_ticks - time_step), current_ticks + time_step);
+ target_ticks = MIN(MAX(target_ticks, current_ticks - dynamic_delay), current_ticks + dynamic_delay);
}
#ifdef TOOLS_ENABLED
@@ -2321,8 +2333,8 @@ void Main::cleanup() {
ResourceLoader::remove_custom_loaders();
ResourceSaver::remove_custom_savers();
+ // Flush before uninitializing the scene, but delete the MessageQueue as late as possible.
message_queue->flush();
- memdelete(message_queue);
OS::get_singleton()->delete_main_loop();
@@ -2408,6 +2420,10 @@ void Main::cleanup() {
OS::get_singleton()->set_restart_on_exit(false, List<String>()); //clear list (uses memory)
}
+ // Now should be safe to delete MessageQueue (famous last words).
+ message_queue->flush();
+ memdelete(message_queue);
+
unregister_core_driver_types();
unregister_core_types();
diff --git a/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj b/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj
index d21e78ccea..2ae3564faf 100644
--- a/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj
+++ b/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj
@@ -8,58 +8,22 @@
/* Begin PBXBuildFile section */
1F1575721F582BE20003B888 /* dylibs in Resources */ = {isa = PBXBuildFile; fileRef = 1F1575711F582BE20003B888 /* dylibs */; };
- 1FE926991FBBF85400F53A6F /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FE926961FBBF7D400F53A6F /* SystemConfiguration.framework */; };
- 1FE9269A1FBBF85F00F53A6F /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FE926951FBBF7C400F53A6F /* Security.framework */; };
- 1FE9269B1FBBF86200F53A6F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FE926941FBBF7BD00F53A6F /* QuartzCore.framework */; };
- 1FE9269C1FBBF86500F53A6F /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FE926931FBBF7AD00F53A6F /* MediaPlayer.framework */; };
- 1FE9269D1FBBF86600F53A6F /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FE926921FBBF7A000F53A6F /* GameController.framework */; };
- 1FE9269E1FBBF86900F53A6F /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FE926911FBBF79500F53A6F /* CoreMotion.framework */; };
- 1FE9269F1FBBF86B00F53A6F /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FE926901FBBF78E00F53A6F /* CoreMedia.framework */; };
- 1FE926A01FBBF86D00F53A6F /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FE9268E1FBBF77300F53A6F /* AudioToolbox.framework */; };
- 1FE926A11FBBF86D00F53A6F /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FE9268F1FBBF77F00F53A6F /* CoreAudio.framework */; };
- E360193721F32F38009258C1 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E360193621F32F37009258C1 /* CoreVideo.framework */; };
DEADBEEF2F582BE20003B888 /* $binary.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DEADBEEF1F582BE20003B888 /* $binary.a */; };
$modules_buildfile
1FF8DBB11FBA9DE1009DE660 /* dummy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1FF8DBB01FBA9DE1009DE660 /* dummy.cpp */; };
- 1FF4C1851F584E3F00A41E41 /* GameKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FF4C1841F584E3F00A41E41 /* GameKit.framework */; };
- 1FF4C1871F584E5600A41E41 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FF4C1861F584E5600A41E41 /* StoreKit.framework */; };
- 1FF4C1871F584E7600A41E41 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FF4C1881F584E7600A41E41 /* StoreKit.framework */; };
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 */; };
- D0BCFE3C18AEBDA2004A7AAE /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0BCFE3B18AEBDA2004A7AAE /* UIKit.framework */; };
- 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 /* $binary.pck in Resources */ = {isa = PBXBuildFile; fileRef = D0BCFE7718AEBFEB004A7AAE /* $binary.pck */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
1F1575711F582BE20003B888 /* dylibs */ = {isa = PBXFileReference; lastKnownFileType = folder; name = dylibs; path = "$binary/dylibs"; sourceTree = "<group>"; };
- 1FE9268E1FBBF77300F53A6F /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
- 1FE9268F1FBBF77F00F53A6F /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; };
- 1FE926901FBBF78E00F53A6F /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; };
- 1FE926911FBBF79500F53A6F /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; };
- 1FE926921FBBF7A000F53A6F /* GameController.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameController.framework; path = System/Library/Frameworks/GameController.framework; sourceTree = SDKROOT; };
- 1FE926931FBBF7AD00F53A6F /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; };
- 1FE926941FBBF7BD00F53A6F /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
- 1FE926951FBBF7C400F53A6F /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
- 1FE926961FBBF7D400F53A6F /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
DEADBEEF1F582BE20003B888 /* $binary.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = godot; path = "$binary.a"; sourceTree = "<group>"; };
$modules_fileref
- 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; };
- 1FF4C1881F584E7600A41E41 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
1FF4C1881F584E6300A41E41 /* $binary.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "$binary.entitlements"; sourceTree = "<group>"; };
1FF8DBB01FBA9DE1009DE660 /* dummy.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = dummy.cpp; sourceTree = "<group>"; };
D07CD44D1C5D589C00B7FB28 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
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; };
- E360193621F32F37009258C1 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.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 /* $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>"; };
D0BCFE7718AEBFEB004A7AAE /* $binary.pck */ = {isa = PBXFileReference; lastKnownFileType = file; path = "$binary.pck"; sourceTree = "<group>"; };
@@ -72,24 +36,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- D0BCFE3A18AEBDA2004A7AAE /* CoreGraphics.framework in Frameworks */,
- E360193721F32F38009258C1 /* CoreVideo.framework in Frameworks */,
- 1FE926991FBBF85400F53A6F /* SystemConfiguration.framework in Frameworks */,
- 1FE9269A1FBBF85F00F53A6F /* Security.framework in Frameworks */,
- 1FE9269B1FBBF86200F53A6F /* QuartzCore.framework in Frameworks */,
- 1FE9269C1FBBF86500F53A6F /* MediaPlayer.framework in Frameworks */,
- 1FE9269D1FBBF86600F53A6F /* GameController.framework in Frameworks */,
- 1FE9269E1FBBF86900F53A6F /* CoreMotion.framework in Frameworks */,
- 1FE9269F1FBBF86B00F53A6F /* CoreMedia.framework in Frameworks */,
- 1FE926A11FBBF86D00F53A6F /* CoreAudio.framework in Frameworks */,
- 1FE926A01FBBF86D00F53A6F /* AudioToolbox.framework in Frameworks */,
- D0BCFE4018AEBDA2004A7AAE /* OpenGLES.framework in Frameworks */,
- 1FF4C1871F584E5600A41E41 /* StoreKit.framework in Frameworks */,
- 1FF4C1871F584E7600A41E41 /* AVFoundation.framework in Frameworks */,
- D0BCFE3C18AEBDA2004A7AAE /* UIKit.framework in Frameworks */,
- 1FF4C1851F584E3F00A41E41 /* GameKit.framework in Frameworks */,
- D0BCFE3E18AEBDA2004A7AAE /* GLKit.framework in Frameworks */,
- D0BCFE3818AEBDA2004A7AAE /* Foundation.framework in Frameworks */,
DEADBEEF2F582BE20003B888 /* $binary.a */,
$modules_buildphase
$additional_pbx_frameworks_build
@@ -122,24 +68,6 @@
D0BCFE3618AEBDA2004A7AAE /* Frameworks */ = {
isa = PBXGroup;
children = (
- 1FE926961FBBF7D400F53A6F /* SystemConfiguration.framework */,
- 1FE926951FBBF7C400F53A6F /* Security.framework */,
- 1FE926941FBBF7BD00F53A6F /* QuartzCore.framework */,
- 1FE926931FBBF7AD00F53A6F /* MediaPlayer.framework */,
- 1FE926921FBBF7A000F53A6F /* GameController.framework */,
- 1FE926911FBBF79500F53A6F /* CoreMotion.framework */,
- 1FE926901FBBF78E00F53A6F /* CoreMedia.framework */,
- 1FE9268F1FBBF77F00F53A6F /* CoreAudio.framework */,
- E360193621F32F37009258C1 /* CoreVideo.framework */,
- 1FE9268E1FBBF77300F53A6F /* AudioToolbox.framework */,
- 1FF4C1861F584E5600A41E41 /* StoreKit.framework */,
- 1FF4C1841F584E3F00A41E41 /* GameKit.framework */,
- 1FF4C1881F584E7600A41E41 /* AVFoundation.framework */,
- D0BCFE3718AEBDA2004A7AAE /* Foundation.framework */,
- D0BCFE3918AEBDA2004A7AAE /* CoreGraphics.framework */,
- D0BCFE3B18AEBDA2004A7AAE /* UIKit.framework */,
- D0BCFE3D18AEBDA2004A7AAE /* GLKit.framework */,
- D0BCFE3F18AEBDA2004A7AAE /* OpenGLES.framework */,
DEADBEEF1F582BE20003B888 /* $binary.a */,
$modules_buildgrp
$additional_pbx_frameworks_refs
diff --git a/misc/dist/ios_xcode/godot_ios/godot_ios.entitlements b/misc/dist/ios_xcode/godot_ios/godot_ios.entitlements
index 903def2af5..c9b58a85cf 100644
--- a/misc/dist/ios_xcode/godot_ios/godot_ios.entitlements
+++ b/misc/dist/ios_xcode/godot_ios/godot_ios.entitlements
@@ -2,7 +2,6 @@
<!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>
+$entitlements_push_notifications
</dict>
</plist>
diff --git a/modules/arkit/SCsub b/modules/arkit/SCsub
index 61c0a8248c..7e103d6565 100644
--- a/modules/arkit/SCsub
+++ b/modules/arkit/SCsub
@@ -5,6 +5,9 @@ Import("env_modules")
env_arkit = env_modules.Clone()
+# (iOS) Enable module support
+env_arkit.Append(CCFLAGS=["-fmodules", "-fcxx-modules"])
+
# (iOS) Build as separate static library
modules_sources = []
env_arkit.add_source_files(modules_sources, "*.cpp")
diff --git a/modules/camera/SCsub b/modules/camera/SCsub
index 63c4e9fbab..631a65bde2 100644
--- a/modules/camera/SCsub
+++ b/modules/camera/SCsub
@@ -6,6 +6,9 @@ Import("env_modules")
env_camera = env_modules.Clone()
if env["platform"] == "iphone":
+ # (iOS) Enable module support
+ env_camera.Append(CCFLAGS=["-fmodules", "-fcxx-modules"])
+
# (iOS) Build as separate static library
modules_sources = []
env_camera.add_source_files(modules_sources, "register_types.cpp")
diff --git a/modules/mono/editor/GodotTools/GodotTools/Build/BuildTool.cs b/modules/mono/editor/GodotTools/GodotTools/Build/BuildTool.cs
index a1a69334e3..837c8adddb 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Build/BuildTool.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Build/BuildTool.cs
@@ -1,6 +1,6 @@
namespace GodotTools.Build
{
- public enum BuildTool
+ public enum BuildTool : long
{
MsBuildMono,
MsBuildVs,
diff --git a/modules/mono/editor/GodotTools/GodotTools/ExternalEditorId.cs b/modules/mono/editor/GodotTools/GodotTools/ExternalEditorId.cs
index bb218c2f19..90d6eb960e 100644
--- a/modules/mono/editor/GodotTools/GodotTools/ExternalEditorId.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/ExternalEditorId.cs
@@ -1,6 +1,6 @@
namespace GodotTools
{
- public enum ExternalEditorId
+ public enum ExternalEditorId : long
{
None,
VisualStudio, // TODO (Windows-only)
diff --git a/modules/mono/editor/GodotTools/GodotTools/Internals/ScriptClassParser.cs b/modules/mono/editor/GodotTools/GodotTools/Internals/ScriptClassParser.cs
index 7fb087467f..569f27649f 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Internals/ScriptClassParser.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Internals/ScriptClassParser.cs
@@ -13,9 +13,9 @@ namespace GodotTools.Internals
public string Name { get; }
public string Namespace { get; }
public bool Nested { get; }
- public int BaseCount { get; }
+ public long BaseCount { get; }
- public ClassDecl(string name, string @namespace, bool nested, int baseCount)
+ public ClassDecl(string name, string @namespace, bool nested, long baseCount)
{
Name = name;
Namespace = @namespace;
@@ -45,7 +45,7 @@ namespace GodotTools.Internals
(string)classDeclDict["name"],
(string)classDeclDict["namespace"],
(bool)classDeclDict["nested"],
- (int)classDeclDict["base_count"]
+ (long)classDeclDict["base_count"]
));
}
diff --git a/platform/iphone/SCsub b/platform/iphone/SCsub
index a48629f720..b72d29149c 100644
--- a/platform/iphone/SCsub
+++ b/platform/iphone/SCsub
@@ -20,6 +20,9 @@ iphone_lib = [
env_ios = env.Clone()
ios_lib = env_ios.add_library("iphone", iphone_lib)
+# (iOS) Enable module support
+env_ios.Append(CCFLAGS=["-fmodules", "-fcxx-modules"])
+
def combine_libs(target=None, source=None, env=None):
lib_path = target[0].srcnode().abspath
diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp
index aadc60175b..194e71c9de 100644
--- a/platform/iphone/export/export.cpp
+++ b/platform/iphone/export/export.cpp
@@ -343,6 +343,9 @@ void EditorExportPlatformIOS::_fix_config_file(const Ref<EditorExportPreset> &p_
} else if (lines[i].find("$push_notifications") != -1) {
bool is_on = p_preset->get("capabilities/push_notifications");
strnew += lines[i].replace("$push_notifications", is_on ? "1" : "0") + "\n";
+ } else if (lines[i].find("$entitlements_push_notifications") != -1) {
+ bool is_on = p_preset->get("capabilities/push_notifications");
+ strnew += lines[i].replace("$entitlements_push_notifications", is_on ? "<key>aps-environment</key><string>development</string>" : "") + "\n";
} else if (lines[i].find("$required_device_capabilities") != -1) {
String capabilities;
@@ -1066,6 +1069,7 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p
files_to_parse.insert("godot_ios/dummy.cpp");
files_to_parse.insert("godot_ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata");
files_to_parse.insert("godot_ios.xcodeproj/xcshareddata/xcschemes/godot_ios.xcscheme");
+ files_to_parse.insert("godot_ios/godot_ios.entitlements");
IOSConfigData config_data = {
pkg_name,
diff --git a/platform/iphone/in_app_store.mm b/platform/iphone/in_app_store.mm
index a2efd6691b..548dcc549d 100644
--- a/platform/iphone/in_app_store.mm
+++ b/platform/iphone/in_app_store.mm
@@ -207,7 +207,7 @@ Error InAppStore::restore_purchases() {
NSString *receipt_to_send = nil;
if (receipt != nil) {
- receipt_to_send = [receipt description];
+ receipt_to_send = [receipt base64EncodedStringWithOptions:0];
}
Dictionary receipt_ret;
receipt_ret["receipt"] = String::utf8(receipt_to_send != nil ? [receipt_to_send UTF8String] : "");
diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp
index 0d48fde642..41b8fad49d 100644
--- a/scene/gui/tab_container.cpp
+++ b/scene/gui/tab_container.cpp
@@ -71,6 +71,8 @@ int TabContainer::_get_top_margin() const {
void TabContainer::_gui_input(const Ref<InputEvent> &p_event) {
Ref<InputEventMouseButton> mb = p_event;
+ Popup *popup = get_popup();
+
if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) {
Point2 pos(mb->get_position().x, mb->get_position().y);
Size2 size = get_size();
@@ -82,6 +84,7 @@ void TabContainer::_gui_input(const Ref<InputEvent> &p_event) {
// Handle menu button.
Ref<Texture2D> menu = get_theme_icon("menu");
+
if (popup && pos.x > size.width - menu->get_width()) {
emit_signal("pre_popup_pressed");
@@ -223,6 +226,7 @@ void TabContainer::_notification(int p_what) {
int header_width = get_size().width - side_margin * 2;
// Find the width of the header area.
+ Popup *popup = get_popup();
if (popup) {
header_width -= menu->get_width();
}
@@ -284,6 +288,7 @@ void TabContainer::_notification(int p_what) {
int header_x = side_margin;
int header_width = size.width - side_margin * 2;
int header_height = _get_top_margin();
+ Popup *popup = get_popup();
if (popup) {
header_width -= menu->get_width();
}
@@ -749,6 +754,7 @@ int TabContainer::get_tab_idx_at_point(const Point2 &p_point) const {
Size2 size = get_size();
int right_ofs = 0;
+ Popup *popup = get_popup();
if (popup) {
Ref<Texture2D> menu = get_theme_icon("menu");
right_ofs += menu->get_width();
@@ -948,12 +954,24 @@ Size2 TabContainer::get_minimum_size() const {
void TabContainer::set_popup(Node *p_popup) {
ERR_FAIL_NULL(p_popup);
- popup = Object::cast_to<Popup>(p_popup);
+ Popup *popup = Object::cast_to<Popup>(p_popup);
+ popup_obj_id = popup ? popup->get_instance_id() : ObjectID();
update();
}
Popup *TabContainer::get_popup() const {
- return popup;
+ if (popup_obj_id.is_valid()) {
+ Popup *popup = Object::cast_to<Popup>(ObjectDB::get_instance(popup_obj_id));
+ if (popup) {
+ return popup;
+ } else {
+#ifdef DEBUG_ENABLED
+ ERR_PRINT("Popup assigned to TabContainer is gone!");
+#endif
+ popup_obj_id = ObjectID();
+ }
+ }
+ return nullptr;
}
void TabContainer::set_drag_to_rearrange_enabled(bool p_enabled) {
@@ -1037,7 +1055,6 @@ TabContainer::TabContainer() {
previous = 0;
align = ALIGN_CENTER;
tabs_visible = true;
- popup = nullptr;
drag_to_rearrange_enabled = false;
tabs_rearrange_group = -1;
use_hidden_tabs_for_min_size = false;
diff --git a/scene/gui/tab_container.h b/scene/gui/tab_container.h
index 55a5d35b30..6ee72a379a 100644
--- a/scene/gui/tab_container.h
+++ b/scene/gui/tab_container.h
@@ -57,7 +57,7 @@ private:
TabAlign align;
Control *_get_tab(int p_idx) const;
int _get_top_margin() const;
- Popup *popup;
+ mutable ObjectID popup_obj_id;
bool drag_to_rearrange_enabled;
bool use_hidden_tabs_for_min_size;
int tabs_rearrange_group;
diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp
index aebb0d7ba4..83d4db7bae 100644
--- a/scene/resources/default_theme/default_theme.cpp
+++ b/scene/resources/default_theme/default_theme.cpp
@@ -219,22 +219,6 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_constant("hseparation", "ColorPickerButton", 2 * scale);
- // Button
-
- theme->set_stylebox("normal", "Button", make_empty_stylebox(6, 4, 6, 4));
- theme->set_stylebox("pressed", "Button", make_stylebox(button_pressed_png, 4, 4, 4, 4, 6, 4, 6, 4));
- theme->set_stylebox("hover", "Button", make_stylebox(button_normal_png, 4, 4, 4, 4, 6, 4, 6, 4));
- theme->set_stylebox("disabled", "Button", make_empty_stylebox(6, 4, 6, 4));
- theme->set_stylebox("focus", "Button", focus);
- theme->set_font("font", "Button", default_font);
-
- theme->set_color("font_color", "Button", control_font_color);
- theme->set_color("font_color_pressed", "Button", control_font_color_pressed);
- theme->set_color("font_color_hover", "Button", control_font_color_hover);
- theme->set_color("font_color_disabled", "Button", Color(0.9, 0.95, 1, 0.3));
-
- theme->set_constant("hseparation", "Button", 3);
-
// OptionButton
Ref<StyleBox> sb_optbutton_normal = sb_expand(make_stylebox(option_button_normal_png, 4, 4, 21, 4, 6, 3, 9, 3), 2, 2, 2, 2);
diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp
index a3fef10cc0..14a28554f9 100644
--- a/servers/rendering/shader_language.cpp
+++ b/servers/rendering/shader_language.cpp
@@ -3560,7 +3560,7 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons
error = true;
} else if (n->type == Node::TYPE_ARRAY) {
ArrayNode *an = static_cast<ArrayNode *>(n);
- if (an->call_expression != nullptr) {
+ if (an->call_expression != nullptr || an->is_const) {
error = true;
}
} else if (n->type == Node::TYPE_VARIABLE) {
@@ -3569,7 +3569,9 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons
error = true;
} else {
StringName varname = vn->name;
- if (shader->uniforms.has(varname)) {
+ if (shader->constants.has(varname)) {
+ error = true;
+ } else if (shader->uniforms.has(varname)) {
error = true;
} else {
if (p_builtin_types.has(varname)) {