From bcc435094d0734174818cf3e55887a26ef111686 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 10 Jun 2017 10:15:33 -0300 Subject: [PATCH] Restired multithread support in OSX and Windows, should stop the crashes. --- platform/osx/os_osx.h | 10 +++++----- platform/osx/os_osx.mm | 8 +++----- platform/windows/os_windows.cpp | 14 ++++++-------- scene/gui/split_container.h | 2 +- 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h index 3a37d663ad6..123816b22df 100644 --- a/platform/osx/os_osx.h +++ b/platform/osx/os_osx.h @@ -30,21 +30,21 @@ #ifndef OS_OSX_H #define OS_OSX_H +#include "drivers/alsa/audio_driver_alsa.h" +#include "drivers/rtaudio/audio_driver_rtaudio.h" #include "drivers/unix/os_unix.h" #include "joypad_osx.h" #include "main/input_default.h" #include "os/input.h" -#include "power_osx.h" -#include "servers/visual_server.h" -// #include "servers/visual/visual_server_wrap_mt.h" -#include "drivers/alsa/audio_driver_alsa.h" -#include "drivers/rtaudio/audio_driver_rtaudio.h" #include "platform/osx/audio_driver_osx.h" +#include "power_osx.h" #include "servers/audio_server.h" #include "servers/physics_2d/physics_2d_server_sw.h" #include "servers/physics_2d/physics_2d_server_wrap_mt.h" #include "servers/physics_server.h" #include "servers/visual/rasterizer.h" +#include "servers/visual/visual_server_wrap_mt.h" +#include "servers/visual_server.h" #include //bitch diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 54b1802250e..72fba39e33d 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -932,12 +932,10 @@ void OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_au //visual_server = memnew( VisualServerRaster(rasterizer) ); visual_server = memnew(VisualServerRaster); - // FIXME: Reimplement threaded rendering? Or remove? - /* - if (get_render_thread_mode()!=RENDER_THREAD_UNSAFE) { - visual_server =memnew(VisualServerWrapMT(visual_server,get_render_thread_mode()==RENDER_SEPARATE_THREAD)); + if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) { + + visual_server = memnew(VisualServerWrapMT(visual_server, get_render_thread_mode() == RENDER_SEPARATE_THREAD)); } -*/ visual_server->init(); visual_server->cursor_set_visible(false, 0); diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index a9fcf70b558..4393cad3bf6 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -37,15 +37,15 @@ #include "drivers/windows/rw_lock_windows.h" #include "drivers/windows/semaphore_windows.h" #include "drivers/windows/thread_windows.h" -#include "servers/audio_server.h" -#include "servers/visual/visual_server_raster.h" -//#include "servers/visual/visual_server_wrap_mt.h" #include "global_config.h" #include "io/marshalls.h" #include "joypad.h" #include "lang_table.h" #include "main/main.h" #include "packet_peer_udp_winsock.h" +#include "servers/audio_server.h" +#include "servers/visual/visual_server_raster.h" +#include "servers/visual/visual_server_wrap_mt.h" #include "stream_peer_winsock.h" #include "tcp_server_winsock.h" @@ -1029,12 +1029,10 @@ void OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int #endif visual_server = memnew(VisualServerRaster); - // FIXME: Reimplement threaded rendering? Or remove? - /* - if (get_render_thread_mode()!=RENDER_THREAD_UNSAFE) { - visual_server =memnew(VisualServerWrapMT(visual_server,get_render_thread_mode()==RENDER_SEPARATE_THREAD)); + if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) { + + visual_server = memnew(VisualServerWrapMT(visual_server, get_render_thread_mode() == RENDER_SEPARATE_THREAD)); } - */ physics_server = memnew(PhysicsServerSW); physics_server->init(); diff --git a/scene/gui/split_container.h b/scene/gui/split_container.h index 94b80cf2792..87a210f24ca 100644 --- a/scene/gui/split_container.h +++ b/scene/gui/split_container.h @@ -34,7 +34,7 @@ class SplitContainer : public Container { - GDCLASS(SplitContainer, Container); + GDCLASS(SplitContainer, Container) public: enum DraggerVisibility {