summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SConstruct2
-rw-r--r--core/math/rect2.h13
-rw-r--r--methods.py61
-rw-r--r--modules/SCsub23
-rw-r--r--modules/theora/video_stream_theora.cpp6
-rw-r--r--modules/webm/video_stream_webm.cpp15
-rw-r--r--platform/windows/detect.py7
-rw-r--r--scene/gui/split_container.cpp6
-rw-r--r--servers/audio_server.cpp8
-rw-r--r--servers/audio_server.h3
-rw-r--r--servers/visual/visual_server_canvas.cpp2
11 files changed, 50 insertions, 96 deletions
diff --git a/SConstruct b/SConstruct
index 7578a7c385..6af363090b 100644
--- a/SConstruct
+++ b/SConstruct
@@ -78,7 +78,6 @@ env_base.__class__.add_module_version_string = methods.add_module_version_string
env_base.__class__.add_source_files = methods.add_source_files
env_base.__class__.use_windows_spawn_fix = methods.use_windows_spawn_fix
-env_base.__class__.split_lib = methods.split_lib
env_base.__class__.add_shared_library = methods.add_shared_library
env_base.__class__.add_library = methods.add_library
@@ -130,7 +129,6 @@ opts.Add(BoolVariable('dev', "If yes, alias for verbose=yes warnings=extra werro
opts.Add('extra_suffix', "Custom extra suffix added to the base filename of all generated binary files", '')
opts.Add(BoolVariable('vsproj', "Generate a Visual Studio solution", False))
opts.Add(EnumVariable('macports_clang', "Build using Clang from MacPorts", 'no', ('no', '5.0', 'devel')))
-opts.Add(BoolVariable('split_libmodules', "Split intermediate libmodules.a in smaller chunks to prevent exceeding linker command line size (forced to True when using MinGW)", False))
opts.Add(BoolVariable('disable_3d', "Disable 3D nodes for a smaller executable", False))
opts.Add(BoolVariable('disable_advanced_gui', "Disable advanced GUI nodes and behaviors", False))
opts.Add(BoolVariable('no_editor_splash', "Don't use the custom splash screen for the editor", False))
diff --git a/core/math/rect2.h b/core/math/rect2.h
index 9017377770..0d2e7eb6e5 100644
--- a/core/math/rect2.h
+++ b/core/math/rect2.h
@@ -60,6 +60,19 @@ struct Rect2 {
return true;
}
+ inline bool intersects_touch(const Rect2 &p_rect) const {
+ if (position.x > (p_rect.position.x + p_rect.size.width))
+ return false;
+ if ((position.x + size.width) < p_rect.position.x)
+ return false;
+ if (position.y > (p_rect.position.y + p_rect.size.height))
+ return false;
+ if ((position.y + size.height) < p_rect.position.y)
+ return false;
+
+ return true;
+ }
+
inline real_t distance_to(const Vector2 &p_point) const {
real_t dist = 0.0;
diff --git a/methods.py b/methods.py
index 39981406c7..a1d101af18 100644
--- a/methods.py
+++ b/methods.py
@@ -257,67 +257,6 @@ def use_windows_spawn_fix(self, platform=None):
self['SPAWN'] = mySpawn
-def split_lib(self, libname, src_list = None, env_lib = None):
- env = self
-
- num = 0
- cur_base = ""
- max_src = 64
- list = []
- lib_list = []
-
- if src_list is None:
- src_list = getattr(env, libname + "_sources")
-
- if type(env_lib) == type(None):
- env_lib = env
-
- for f in src_list:
- fname = ""
- if type(f) == type(""):
- fname = env.File(f).path
- else:
- fname = env.File(f)[0].path
- fname = fname.replace("\\", "/")
- base = "/".join(fname.split("/")[:2])
- if base != cur_base and len(list) > max_src:
- if num > 0:
- lib = env_lib.add_library(libname + str(num), list)
- lib_list.append(lib)
- list = []
- num = num + 1
- cur_base = base
- list.append(f)
-
- lib = env_lib.add_library(libname + str(num), list)
- lib_list.append(lib)
-
- lib_base = []
- env_lib.add_source_files(lib_base, "*.cpp")
- lib = env_lib.add_library(libname, lib_base)
- lib_list.insert(0, lib)
-
- env.Prepend(LIBS=lib_list)
-
- # When we split modules into arbitrary chunks, we end up with linking issues
- # due to symbol dependencies split over several libs, which may not be linked
- # in the required order. We use --start-group and --end-group to tell the
- # linker that those archives should be searched repeatedly to resolve all
- # undefined references.
- # As SCons doesn't give us much control over how inserting libs in LIBS
- # impacts the linker call, we need to hack our way into the linking commands
- # LINKCOM and SHLINKCOM to set those flags.
-
- if '-Wl,--start-group' in env['LINKCOM'] and '-Wl,--start-group' in env['SHLINKCOM']:
- # Already added by a previous call, skip.
- return
-
- env['LINKCOM'] = str(env['LINKCOM']).replace('$_LIBFLAGS',
- '-Wl,--start-group $_LIBFLAGS -Wl,--end-group')
- env['SHLINKCOM'] = str(env['LINKCOM']).replace('$_LIBFLAGS',
- '-Wl,--start-group $_LIBFLAGS -Wl,--end-group')
-
-
def save_active_platforms(apnames, ap):
for x in ap:
diff --git a/modules/SCsub b/modules/SCsub
index 75483fd637..5b39b18334 100644
--- a/modules/SCsub
+++ b/modules/SCsub
@@ -8,17 +8,26 @@ env_modules = env.Clone()
Export('env_modules')
+# Header with MODULE_*_ENABLED defines.
env.CommandNoCache("modules_enabled.gen.h", Value(env.module_list), modules_builders.generate_modules_enabled)
-env.modules_sources = []
-env_modules.add_source_files(env.modules_sources, "register_module_types.gen.cpp")
-
+# libmodule_<name>.a for each active module.
for module in env.module_list:
+ env.modules_sources = []
SConscript(module + "/SCsub")
-if env['split_libmodules']:
- env.split_lib("modules", env_lib = env_modules)
-else:
- lib = env_modules.add_library("modules", env.modules_sources)
+ # Some modules are not linked automatically but can be enabled optionally
+ # on iOS, so we handle those specially.
+ if env["platform"] == "iphone" and module in ["arkit", "camera"]:
+ continue
+ lib = env_modules.add_library("module_%s" % module, env.modules_sources)
env.Prepend(LIBS=[lib])
+
+# libmodules.a with only register_module_types.
+# Must be last so that all libmodule_<name>.a libraries are on the right side
+# in the linker command.
+env.modules_sources = []
+env_modules.add_source_files(env.modules_sources, "register_module_types.gen.cpp")
+lib = env_modules.add_library("modules", env.modules_sources)
+env.Prepend(LIBS=[lib])
diff --git a/modules/theora/video_stream_theora.cpp b/modules/theora/video_stream_theora.cpp
index cf1fc3f175..00c7e87568 100644
--- a/modules/theora/video_stream_theora.cpp
+++ b/modules/theora/video_stream_theora.cpp
@@ -363,8 +363,10 @@ void VideoStreamPlaybackTheora::set_file(const String &p_file) {
};
float VideoStreamPlaybackTheora::get_time() const {
-
- return time - AudioServer::get_singleton()->get_output_latency() - delay_compensation; //-((get_total())/(float)vi.rate);
+ // FIXME: AudioServer output latency was fixed in af9bb0e, previously it used to
+ // systematically return 0. Now that it gives a proper latency, it broke this
+ // code where the delay compensation likely never really worked.
+ return time - /* AudioServer::get_singleton()->get_output_latency() - */ delay_compensation;
};
Ref<Texture> VideoStreamPlaybackTheora::get_texture() const {
diff --git a/modules/webm/video_stream_webm.cpp b/modules/webm/video_stream_webm.cpp
index 41f9e67672..2763d30bb5 100644
--- a/modules/webm/video_stream_webm.cpp
+++ b/modules/webm/video_stream_webm.cpp
@@ -393,17 +393,22 @@ int VideoStreamPlaybackWebm::get_mix_rate() const {
inline bool VideoStreamPlaybackWebm::has_enough_video_frames() const {
if (video_frames_pos > 0) {
-
- const double audio_delay = AudioServer::get_singleton()->get_output_latency();
+ // FIXME: AudioServer output latency was fixed in af9bb0e, previously it used to
+ // systematically return 0. Now that it gives a proper latency, it broke this
+ // code where the delay compensation likely never really worked.
+ //const double audio_delay = AudioServer::get_singleton()->get_output_latency();
const double video_time = video_frames[video_frames_pos - 1]->time;
- return video_time >= time + audio_delay + delay_compensation;
+ return video_time >= time + /* audio_delay + */ delay_compensation;
}
return false;
}
bool VideoStreamPlaybackWebm::should_process(WebMFrame &video_frame) {
- const double audio_delay = AudioServer::get_singleton()->get_output_latency();
- return video_frame.time >= time + audio_delay + delay_compensation;
+ // FIXME: AudioServer output latency was fixed in af9bb0e, previously it used to
+ // systematically return 0. Now that it gives a proper latency, it broke this
+ // code where the delay compensation likely never really worked.
+ //const double audio_delay = AudioServer::get_singleton()->get_output_latency();
+ return video_frame.time >= time + /* audio_delay + */ delay_compensation;
}
void VideoStreamPlaybackWebm::delete_pointers() {
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
index 500736bd3f..72c3f60d99 100644
--- a/platform/windows/detect.py
+++ b/platform/windows/detect.py
@@ -293,12 +293,7 @@ def configure_mingw(env):
## Compiler configuration
- if (os.name == "nt"):
- # Force splitting libmodules.a in multiple chunks to work around
- # issues reaching the linker command line size limit, which also
- # seem to induce huge slowdown for 'ar' (GH-30892).
- env['split_libmodules'] = True
- else:
+ if os.name != "nt":
env["PROGSUFFIX"] = env["PROGSUFFIX"] + ".exe" # for linux cross-compilation
if (env["bits"] == "default"):
diff --git a/scene/gui/split_container.cpp b/scene/gui/split_container.cpp
index bb5260b15e..079907db07 100644
--- a/scene/gui/split_container.cpp
+++ b/scene/gui/split_container.cpp
@@ -266,7 +266,7 @@ void SplitContainer::_gui_input(const Ref<InputEvent> &p_event) {
Control::CursorShape SplitContainer::get_cursor_shape(const Point2 &p_pos) const {
if (dragging)
- return (vertical ? CURSOR_VSIZE : CURSOR_HSIZE);
+ return (vertical ? CURSOR_VSPLIT : CURSOR_HSPLIT);
if (!collapsed && _getch(0) && _getch(1) && dragger_visibility == DRAGGER_VISIBLE) {
@@ -275,11 +275,11 @@ Control::CursorShape SplitContainer::get_cursor_shape(const Point2 &p_pos) const
if (vertical) {
if (p_pos.y > middle_sep && p_pos.y < middle_sep + sep)
- return CURSOR_VSIZE;
+ return CURSOR_VSPLIT;
} else {
if (p_pos.x > middle_sep && p_pos.x < middle_sep + sep)
- return CURSOR_HSIZE;
+ return CURSOR_HSPLIT;
}
}
diff --git a/servers/audio_server.cpp b/servers/audio_server.cpp
index 1c84e97196..2a5a5040b6 100644
--- a/servers/audio_server.cpp
+++ b/servers/audio_server.cpp
@@ -29,6 +29,7 @@
/*************************************************************************/
#include "audio_server.h"
+
#include "core/io/resource_loader.h"
#include "core/os/file_access.h"
#include "core/os/os.h"
@@ -36,14 +37,11 @@
#include "scene/resources/audio_stream_sample.h"
#include "servers/audio/audio_driver_dummy.h"
#include "servers/audio/effects/audio_effect_compressor.h"
-#ifdef TOOLS_ENABLED
+#ifdef TOOLS_ENABLED
#define MARK_EDITED set_edited(true);
-
#else
-
#define MARK_EDITED
-
#endif
AudioDriver *AudioDriver::singleton = NULL;
@@ -1405,8 +1403,6 @@ AudioServer::AudioServer() {
mix_frames = 0;
channel_count = 0;
to_mix = 0;
- output_latency = 0;
- output_latency_ticks = 0;
#ifdef DEBUG_ENABLED
prof_time = 0;
#endif
diff --git a/servers/audio_server.h b/servers/audio_server.h
index 815200c811..eff66d4008 100644
--- a/servers/audio_server.h
+++ b/servers/audio_server.h
@@ -240,9 +240,6 @@ private:
Mutex *audio_data_lock;
- float output_latency;
- uint64_t output_latency_ticks;
-
void init_channels_and_buffers();
void _mix_step();
diff --git a/servers/visual/visual_server_canvas.cpp b/servers/visual/visual_server_canvas.cpp
index e07e188ec6..c90e061eb7 100644
--- a/servers/visual/visual_server_canvas.cpp
+++ b/servers/visual/visual_server_canvas.cpp
@@ -168,7 +168,7 @@ void VisualServerCanvas::_render_canvas_item(Item *p_canvas_item, const Transfor
VisualServerRaster::redraw_request();
}
- if ((!ci->commands.empty() && p_clip_rect.intersects(global_rect)) || ci->vp_render || ci->copy_back_buffer) {
+ if ((!ci->commands.empty() && p_clip_rect.intersects_touch(global_rect)) || ci->vp_render || ci->copy_back_buffer) {
//something to draw?
ci->final_transform = xform;
ci->final_modulate = Color(modulate.r * ci->self_modulate.r, modulate.g * ci->self_modulate.g, modulate.b * ci->self_modulate.b, modulate.a * ci->self_modulate.a);