diff options
author | AndreaCatania <info@andreacatania.com> | 2017-10-21 13:02:06 +0200 |
---|---|---|
committer | AndreaCatania <info@andreacatania.com> | 2017-11-04 03:25:51 +0100 |
commit | 7a9ca08f16c500aa0caccc21a8e42564f962971a (patch) | |
tree | 3274c444cab28252757a1dde47995264ac2d2c66 /platform | |
parent | f52ab8d86418a67ddee247ed7765e72935b0c57f (diff) |
Implemented physics plug
Moved init_physics
Implemented physics 2D plug
Fix clang
Fix clang
Fix static check
Fix clang
Fix static check
Moved physics server initialization
Moved physics server settings initialization
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/os_android.cpp | 5 | ||||
-rw-r--r-- | platform/android/os_android.h | 5 | ||||
-rw-r--r-- | platform/haiku/os_haiku.cpp | 13 | ||||
-rw-r--r-- | platform/haiku/os_haiku.h | 4 | ||||
-rw-r--r-- | platform/iphone/os_iphone.cpp | 13 | ||||
-rw-r--r-- | platform/iphone/os_iphone.h | 5 | ||||
-rw-r--r-- | platform/javascript/os_javascript.cpp | 5 | ||||
-rw-r--r-- | platform/javascript/os_javascript.h | 4 | ||||
-rw-r--r-- | platform/osx/crash_handler_osx.mm | 1 | ||||
-rw-r--r-- | platform/osx/os_osx.h | 6 | ||||
-rw-r--r-- | platform/osx/os_osx.mm | 14 | ||||
-rw-r--r-- | platform/server/os_server.cpp | 12 | ||||
-rw-r--r-- | platform/server/os_server.h | 5 | ||||
-rw-r--r-- | platform/uwp/os_uwp.cpp | 13 | ||||
-rw-r--r-- | platform/uwp/os_uwp.h | 4 | ||||
-rw-r--r-- | platform/windows/crash_handler_win.cpp | 1 | ||||
-rw-r--r-- | platform/windows/os_windows.cpp | 13 | ||||
-rw-r--r-- | platform/windows/os_windows.h | 7 | ||||
-rw-r--r-- | platform/x11/crash_handler_x11.cpp | 1 | ||||
-rw-r--r-- | platform/x11/os_x11.cpp | 13 | ||||
-rw-r--r-- | platform/x11/os_x11.h | 5 |
21 files changed, 4 insertions, 145 deletions
diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp index 473a093077..853392cba5 100644 --- a/platform/android/os_android.cpp +++ b/platform/android/os_android.cpp @@ -155,11 +155,6 @@ void OS_Android::initialize(const VideoMode &p_desired, int p_video_driver, int AudioDriverManager::initialize(p_audio_driver); - physics_server = memnew(PhysicsServerSW); - physics_server->init(); - physics_2d_server = Physics2DServerWrapMT::init_server<Physics2DServerSW>(); - physics_2d_server->init(); - input = memnew(InputDefault); input->set_fallback_mapping("Default Android Gamepad"); diff --git a/platform/android/os_android.h b/platform/android/os_android.h index 0c78c198a8..d9a66b4e3a 100644 --- a/platform/android/os_android.h +++ b/platform/android/os_android.h @@ -38,9 +38,6 @@ #include "os/main_loop.h" //#include "power_android.h" #include "servers/audio_server.h" -#include "servers/physics/physics_server_sw.h" -#include "servers/physics_2d/physics_2d_server_sw.h" -#include "servers/physics_2d/physics_2d_server_wrap_mt.h" #include "servers/visual/rasterizer.h" #ifdef ANDROID_NATIVE_ACTIVITY @@ -106,8 +103,6 @@ private: bool use_16bits_fbo; VisualServer *visual_server; - PhysicsServer *physics_server; - Physics2DServer *physics_2d_server; mutable String data_dir_cache; diff --git a/platform/haiku/os_haiku.cpp b/platform/haiku/os_haiku.cpp index 1d52752f21..7a681d46f7 100644 --- a/platform/haiku/os_haiku.cpp +++ b/platform/haiku/os_haiku.cpp @@ -130,13 +130,6 @@ void OS_Haiku::initialize(const VideoMode &p_desired, int p_video_driver, int p_ window->Show(); visual_server->init(); - physics_server = memnew(PhysicsServerSW); - physics_server->init(); - physics_2d_server = memnew(Physics2DServerSW); - // TODO: enable multithreaded PS - //physics_2d_server = Physics2DServerWrapMT::init_server<Physics2DServerSW>(); - physics_2d_server->init(); - AudioDriverManager::initialize(p_audio_driver); power_manager = memnew(PowerHaiku); @@ -153,12 +146,6 @@ void OS_Haiku::finalize() { memdelete(visual_server); memdelete(rasterizer); - physics_server->finish(); - memdelete(physics_server); - - physics_2d_server->finish(); - memdelete(physics_2d_server); - memdelete(input); #if defined(OPENGL_ENABLED) diff --git a/platform/haiku/os_haiku.h b/platform/haiku/os_haiku.h index d929f7e43b..501650c94f 100644 --- a/platform/haiku/os_haiku.h +++ b/platform/haiku/os_haiku.h @@ -38,8 +38,6 @@ #include "main/input_default.h" #include "power_haiku.h" #include "servers/audio_server.h" -#include "servers/physics_2d/physics_2d_server_sw.h" -#include "servers/physics_server.h" #include "servers/visual/rasterizer.h" #include "servers/visual_server.h" @@ -52,8 +50,6 @@ private: Rasterizer *rasterizer; VisualServer *visual_server; VideoMode current_video_mode; - PhysicsServer *physics_server; - Physics2DServer *physics_2d_server; PowerHaiku *power_manager; #ifdef MEDIA_KIT_ENABLED diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp index 08792b8631..09654f343a 100644 --- a/platform/iphone/os_iphone.cpp +++ b/platform/iphone/os_iphone.cpp @@ -136,13 +136,6 @@ void OSIPhone::initialize(const VideoMode &p_desired, int p_video_driver, int p_ AudioDriverManager::add_driver(&audio_driver); AudioDriverManager::initialize(p_audio_driver); - // init physics servers - physics_server = memnew(PhysicsServerSW); - physics_server->init(); - //physics_2d_server = memnew( Physics2DServerSW ); - physics_2d_server = Physics2DServerWrapMT::init_server<Physics2DServerSW>(); - physics_2d_server->init(); - input = memnew(InputDefault); /* @@ -382,12 +375,6 @@ void OSIPhone::finalize() { memdelete(visual_server); // memdelete(rasterizer); - physics_server->finish(); - memdelete(physics_server); - - physics_2d_server->finish(); - memdelete(physics_2d_server); - memdelete(input); }; diff --git a/platform/iphone/os_iphone.h b/platform/iphone/os_iphone.h index e70ac9ba98..eccd294d63 100644 --- a/platform/iphone/os_iphone.h +++ b/platform/iphone/os_iphone.h @@ -41,9 +41,6 @@ #include "in_app_store.h" #include "main/input_default.h" #include "servers/audio_server.h" -#include "servers/physics/physics_server_sw.h" -#include "servers/physics_2d/physics_2d_server_sw.h" -#include "servers/physics_2d/physics_2d_server_wrap_mt.h" #include "servers/visual/rasterizer.h" #include "servers/visual_server.h" @@ -66,8 +63,6 @@ private: uint8_t supported_orientations; VisualServer *visual_server; - PhysicsServer *physics_server; - Physics2DServer *physics_2d_server; AudioDriverCoreAudio audio_driver; diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index f6446e77da..3a57de2646 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -480,11 +480,6 @@ void OS_JavaScript::initialize(const VideoMode &p_desired, int p_video_driver, i print_line("Init Physicsserver"); - physics_server = memnew(PhysicsServerSW); - physics_server->init(); - physics_2d_server = memnew(Physics2DServerSW); - physics_2d_server->init(); - input = memnew(InputDefault); _input = input; diff --git a/platform/javascript/os_javascript.h b/platform/javascript/os_javascript.h index 1c939d3fd5..908a252905 100644 --- a/platform/javascript/os_javascript.h +++ b/platform/javascript/os_javascript.h @@ -39,8 +39,6 @@ #include "os/main_loop.h" #include "power_javascript.h" #include "servers/audio_server.h" -#include "servers/physics/physics_server_sw.h" -#include "servers/physics_2d/physics_2d_server_sw.h" #include "servers/visual/rasterizer.h" #include <emscripten/html5.h> @@ -54,8 +52,6 @@ class OS_JavaScript : public OS_Unix { int64_t last_sync_time; VisualServer *visual_server; - PhysicsServer *physics_server; - Physics2DServer *physics_2d_server; AudioDriverJavaScript audio_driver_javascript; const char *gl_extensions; diff --git a/platform/osx/crash_handler_osx.mm b/platform/osx/crash_handler_osx.mm index 2ed88db309..5635fe0187 100644 --- a/platform/osx/crash_handler_osx.mm +++ b/platform/osx/crash_handler_osx.mm @@ -29,6 +29,7 @@ /*************************************************************************/ #include "main/main.h" #include "os_osx.h" +#include "project_settings.h" #include <string.h> #include <unistd.h> diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h index 05adfeb0f5..5f761b672e 100644 --- a/platform/osx/os_osx.h +++ b/platform/osx/os_osx.h @@ -38,9 +38,6 @@ #include "os/input.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" @@ -62,9 +59,6 @@ public: List<String> args; MainLoop *main_loop; - PhysicsServer *physics_server; - Physics2DServer *physics_2d_server; - IP_Unix *ip_unix; AudioDriverCoreAudio audio_driver; diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 2c81a02014..0d03d546b9 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -35,7 +35,6 @@ #include "os/keyboard.h" #include "print_string.h" #include "sem_osx.h" -#include "servers/physics/physics_server_sw.h" #include "servers/visual/visual_server_raster.h" #include <Carbon/Carbon.h> @@ -1092,13 +1091,6 @@ void OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_au AudioDriverManager::initialize(p_audio_driver); - // - physics_server = memnew(PhysicsServerSW); - physics_server->init(); - //physics_2d_server = memnew( Physics2DServerSW ); - physics_2d_server = Physics2DServerWrapMT::init_server<Physics2DServerSW>(); - physics_2d_server->init(); - input = memnew(InputDefault); joypad_osx = memnew(JoypadOSX); @@ -1120,12 +1112,6 @@ void OS_OSX::finalize() { visual_server->finish(); memdelete(visual_server); //memdelete(rasterizer); - - physics_server->finish(); - memdelete(physics_server); - - physics_2d_server->finish(); - memdelete(physics_2d_server); } void OS_OSX::set_main_loop(MainLoop *p_main_loop) { diff --git a/platform/server/os_server.cpp b/platform/server/os_server.cpp index 300c5cffcc..80c04aa5ad 100644 --- a/platform/server/os_server.cpp +++ b/platform/server/os_server.cpp @@ -31,7 +31,6 @@ //#include "servers/visual/rasterizer_dummy.h" #include "os_server.h" #include "print_string.h" -#include "servers/physics/physics_server_sw.h" #include <stdio.h> #include <stdlib.h> @@ -75,11 +74,6 @@ void OS_Server::initialize(const VideoMode &p_desired, int p_video_driver, int p ERR_FAIL_COND(!visual_server); visual_server->init(); - // - physics_server = memnew(PhysicsServerSW); - physics_server->init(); - physics_2d_server = memnew(Physics2DServerSW); - physics_2d_server->init(); input = memnew(InputDefault); @@ -111,12 +105,6 @@ void OS_Server::finalize() { memdelete(visual_server); //memdelete(rasterizer); - physics_server->finish(); - memdelete(physics_server); - - physics_2d_server->finish(); - memdelete(physics_2d_server); - memdelete(input); args.clear(); diff --git a/platform/server/os_server.h b/platform/server/os_server.h index ba12f649be..630c82ccdd 100644 --- a/platform/server/os_server.h +++ b/platform/server/os_server.h @@ -35,8 +35,6 @@ #include "drivers/unix/os_unix.h" #include "main/input_default.h" #include "servers/audio_server.h" -#include "servers/physics_2d/physics_2d_server_sw.h" -#include "servers/physics_server.h" #include "servers/visual/rasterizer.h" #include "servers/visual_server.h" @@ -56,9 +54,6 @@ class OS_Server : public OS_Unix { bool grab; - PhysicsServer *physics_server; - Physics2DServer *physics_2d_server; - virtual void delete_main_loop(); IP_Unix *ip_unix; diff --git a/platform/uwp/os_uwp.cpp b/platform/uwp/os_uwp.cpp index ff5a935229..90bd64c0b4 100644 --- a/platform/uwp/os_uwp.cpp +++ b/platform/uwp/os_uwp.cpp @@ -262,13 +262,6 @@ void OSUWP::initialize(const VideoMode &p_desired, int p_video_driver, int p_aud } */ - // - physics_server = memnew(PhysicsServerSW); - physics_server->init(); - - physics_2d_server = memnew(Physics2DServerSW); - physics_2d_server->init(); - visual_server->init(); input = memnew(InputDefault); @@ -367,12 +360,6 @@ void OSUWP::finalize() { memdelete(input); - physics_server->finish(); - memdelete(physics_server); - - physics_2d_server->finish(); - memdelete(physics_2d_server); - joypad = nullptr; } diff --git a/platform/uwp/os_uwp.h b/platform/uwp/os_uwp.h index 22f8938049..e46e4cc020 100644 --- a/platform/uwp/os_uwp.h +++ b/platform/uwp/os_uwp.h @@ -40,8 +40,6 @@ #include "os/os.h" #include "power_uwp.h" #include "servers/audio_server.h" -#include "servers/physics/physics_server_sw.h" -#include "servers/physics_2d/physics_2d_server_sw.h" #include "servers/visual/rasterizer.h" #include "servers/visual_server.h" @@ -94,8 +92,6 @@ private: int old_x, old_y; Point2i center; VisualServer *visual_server; - PhysicsServer *physics_server; - Physics2DServer *physics_2d_server; int pressrc; ContextEGL *gl_context; diff --git a/platform/windows/crash_handler_win.cpp b/platform/windows/crash_handler_win.cpp index 2f5ee7956e..feea3911b2 100644 --- a/platform/windows/crash_handler_win.cpp +++ b/platform/windows/crash_handler_win.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "main/main.h" #include "os_windows.h" +#include "project_settings.h" #ifdef CRASH_HANDLER_EXCEPTION diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index c27e7c0d2b..179ce2cde8 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -42,7 +42,6 @@ #include "lang_table.h" #include "main/main.h" #include "packet_peer_udp_winsock.h" -#include "project_settings.h" #include "servers/audio_server.h" #include "servers/visual/visual_server_raster.h" #include "servers/visual/visual_server_wrap_mt.h" @@ -1056,12 +1055,6 @@ void OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int visual_server = memnew(VisualServerWrapMT(visual_server, get_render_thread_mode() == RENDER_SEPARATE_THREAD)); } - physics_server = memnew(PhysicsServerSW); - physics_server->init(); - - physics_2d_server = Physics2DServerWrapMT::init_server<Physics2DServerSW>(); - physics_2d_server->init(); - if (!is_no_window_mode_enabled()) { ShowWindow(hWnd, SW_SHOW); // Show The Window SetForegroundWindow(hWnd); // Slightly Higher Priority @@ -1223,12 +1216,6 @@ void OS_Windows::finalize() { memdelete(debugger_connection_console); } */ - - physics_server->finish(); - memdelete(physics_server); - - physics_2d_server->finish(); - memdelete(physics_2d_server); } void OS_Windows::finalize_core() { diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index c0b8dfc691..c9c00b5e36 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -29,8 +29,8 @@ /*************************************************************************/ #ifndef OS_WINDOWS_H #define OS_WINDOWS_H - #include "context_gl_win.h" +#include "core/project_settings.h" #include "crash_handler_win.h" #include "drivers/rtaudio/audio_driver_rtaudio.h" #include "drivers/wasapi/audio_driver_wasapi.h" @@ -38,7 +38,6 @@ #include "os/os.h" #include "power_windows.h" #include "servers/audio_server.h" -#include "servers/physics/physics_server_sw.h" #include "servers/visual/rasterizer.h" #include "servers/visual_server.h" #ifdef XAUDIO2_ENABLED @@ -47,8 +46,6 @@ #include "drivers/unix/ip_unix.h" #include "key_mapping_win.h" #include "main/input_default.h" -#include "servers/physics_2d/physics_2d_server_sw.h" -#include "servers/physics_2d/physics_2d_server_wrap_mt.h" #include <fcntl.h> #include <io.h> @@ -90,8 +87,6 @@ class OS_Windows : public OS { ContextGL_Win *gl_context; #endif VisualServer *visual_server; - PhysicsServer *physics_server; - Physics2DServer *physics_2d_server; int pressrc; HDC hDC; // Private GDI Device Context HINSTANCE hInstance; // Holds The Instance Of The Application diff --git a/platform/x11/crash_handler_x11.cpp b/platform/x11/crash_handler_x11.cpp index 3c54d5cbc2..005a7459f9 100644 --- a/platform/x11/crash_handler_x11.cpp +++ b/platform/x11/crash_handler_x11.cpp @@ -33,6 +33,7 @@ #include "main/main.h" #include "os_x11.h" +#include "project_settings.h" #ifdef CRASH_HANDLER_ENABLED #include <cxxabi.h> diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index bc18d0c1f0..f49a81ee1f 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -32,7 +32,6 @@ #include "errno.h" #include "key_mapping_x11.h" #include "print_string.h" -#include "servers/physics/physics_server_sw.h" #include "servers/visual/visual_server_raster.h" #include "servers/visual/visual_server_wrap_mt.h" #include <mntent.h> @@ -458,12 +457,6 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au requested = None; visual_server->init(); - // - physics_server = memnew(PhysicsServerSW); - physics_server->init(); - //physics_2d_server = memnew( Physics2DServerSW ); - physics_2d_server = Physics2DServerWrapMT::init_server<Physics2DServerSW>(); - physics_2d_server->init(); input = memnew(InputDefault); @@ -519,12 +512,6 @@ void OS_X11::finalize() { memdelete(visual_server); //memdelete(rasterizer); - physics_server->finish(); - memdelete(physics_server); - - physics_2d_server->finish(); - memdelete(physics_2d_server); - memdelete(power_manager); if (xrandr_handle) diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h index 36355f11bc..02b2110da1 100644 --- a/platform/x11/os_x11.h +++ b/platform/x11/os_x11.h @@ -42,9 +42,6 @@ #include "main/input_default.h" #include "power_x11.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 <X11/Xcursor/Xcursor.h> @@ -121,10 +118,8 @@ class OS_X11 : public OS_Unix { uint64_t last_click_ms; uint32_t last_button_state; - PhysicsServer *physics_server; unsigned int get_mouse_button_state(unsigned int p_x11_state); void get_key_modifier_state(unsigned int p_x11_state, Ref<InputEventWithModifiers> state); - Physics2DServer *physics_2d_server; MouseMode mouse_mode; Point2i center; |