diff options
Diffstat (limited to 'servers/visual')
-rw-r--r-- | servers/visual/rasterizer.h | 2 | ||||
-rw-r--r-- | servers/visual/rasterizer_dummy.cpp | 2 | ||||
-rw-r--r-- | servers/visual/rasterizer_dummy.h | 2 | ||||
-rw-r--r-- | servers/visual/visual_server_raster.cpp | 11 | ||||
-rw-r--r-- | servers/visual/visual_server_raster.h | 2 | ||||
-rw-r--r-- | servers/visual/visual_server_wrap_mt.cpp | 16 | ||||
-rw-r--r-- | servers/visual/visual_server_wrap_mt.h | 562 |
7 files changed, 34 insertions, 563 deletions
diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index 79365f7db6..50336e07f4 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -502,7 +502,7 @@ public: virtual void begin_scene(RID p_viewport_data,RID p_env,VS::ScenarioDebugMode p_debug)=0; virtual void begin_shadow_map( RID p_light_instance, int p_shadow_pass )=0; - virtual void set_camera(const Transform& p_world,const CameraMatrix& p_projection)=0; + virtual void set_camera(const Transform& p_world,const CameraMatrix& p_projection,bool p_ortho_hint)=0; virtual void add_light( RID p_light_instance )=0; ///< all "add_light" calls happen before add_geometry calls diff --git a/servers/visual/rasterizer_dummy.cpp b/servers/visual/rasterizer_dummy.cpp index 8db1cbf6e5..e32f47b3d8 100644 --- a/servers/visual/rasterizer_dummy.cpp +++ b/servers/visual/rasterizer_dummy.cpp @@ -1497,7 +1497,7 @@ void RasterizerDummy::begin_shadow_map( RID p_light_instance, int p_shadow_pass } -void RasterizerDummy::set_camera(const Transform& p_world,const CameraMatrix& p_projection) { +void RasterizerDummy::set_camera(const Transform& p_world, const CameraMatrix& p_projection, bool p_ortho_hint) { } diff --git a/servers/visual/rasterizer_dummy.h b/servers/visual/rasterizer_dummy.h index 318cf6ff99..cc3c1724a4 100644 --- a/servers/visual/rasterizer_dummy.h +++ b/servers/visual/rasterizer_dummy.h @@ -679,7 +679,7 @@ public: virtual void begin_scene(RID p_viewport_data,RID p_env,VS::ScenarioDebugMode p_debug); virtual void begin_shadow_map( RID p_light_instance, int p_shadow_pass ); - virtual void set_camera(const Transform& p_world,const CameraMatrix& p_projection); + virtual void set_camera(const Transform& p_world,const CameraMatrix& p_projection,bool p_ortho_hint); virtual void add_light( RID p_light_instance ); ///< all "add_light" calls happen before add_geometry calls diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index a547da9b61..3fc90fd46d 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/servers/visual/visual_server_raster.cpp @@ -6302,7 +6302,7 @@ void VisualServerRaster::_render_no_camera(Viewport *p_viewport,Camera *p_camera else environment=p_scenario->fallback_environment; - rasterizer->set_camera(Transform(),CameraMatrix()); + rasterizer->set_camera(Transform(),CameraMatrix(),false); rasterizer->begin_scene(p_viewport->viewport_data,environment,p_scenario->debug); rasterizer->set_viewport(viewport_rect); rasterizer->end_scene(); @@ -6318,7 +6318,8 @@ void VisualServerRaster::_render_camera(Viewport *p_viewport,Camera *p_camera, S /* STEP 1 - SETUP CAMERA */ CameraMatrix camera_matrix; - + bool ortho=false; + switch(p_camera->type) { case Camera::ORTHOGONAL: { @@ -6330,6 +6331,7 @@ void VisualServerRaster::_render_camera(Viewport *p_viewport,Camera *p_camera, S p_camera->vaspect ); + ortho=true; } break; case Camera::PERSPECTIVE: { @@ -6341,12 +6343,13 @@ void VisualServerRaster::_render_camera(Viewport *p_viewport,Camera *p_camera, S p_camera->vaspect ); + ortho=false; } break; } - rasterizer->set_camera(p_camera->transform, camera_matrix); + rasterizer->set_camera(p_camera->transform, camera_matrix,ortho); Vector<Plane> planes = camera_matrix.get_projection_planes(p_camera->transform); @@ -7358,7 +7361,7 @@ void VisualServerRaster::_draw_cursors_and_margins() { rasterizer->canvas_end_rect(); }; -void VisualServerRaster::flush() { +void VisualServerRaster::sync() { //do none } diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h index f3b94b73df..e2940c216b 100644 --- a/servers/visual/visual_server_raster.h +++ b/servers/visual/visual_server_raster.h @@ -1237,7 +1237,7 @@ public: /* EVENT QUEUING */ virtual void draw(); - virtual void flush(); + virtual void sync(); virtual void init(); virtual void finish(); diff --git a/servers/visual/visual_server_wrap_mt.cpp b/servers/visual/visual_server_wrap_mt.cpp index a044981bbb..19dff3d36c 100644 --- a/servers/visual/visual_server_wrap_mt.cpp +++ b/servers/visual/visual_server_wrap_mt.cpp @@ -96,16 +96,19 @@ void VisualServerWrapMT::thread_loop() { /* EVENT QUEUING */ -void VisualServerWrapMT::flush() { +void VisualServerWrapMT::sync() { if (create_thread) { + /* TODO: sync with the thread */ + + /* ERR_FAIL_COND(!draw_mutex); draw_mutex->lock(); draw_pending++; //cambiar por un saferefcount draw_mutex->unlock(); - - command_queue.push( this, &VisualServerWrapMT::thread_flush); + */ + //command_queue.push( this, &VisualServerWrapMT::thread_flush); } else { command_queue.flush_all(); //flush all pending from other threads @@ -118,15 +121,16 @@ void VisualServerWrapMT::draw() { if (create_thread) { + /* TODO: Make it draw ERR_FAIL_COND(!draw_mutex); draw_mutex->lock(); draw_pending++; //cambiar por un saferefcount draw_mutex->unlock(); command_queue.push( this, &VisualServerWrapMT::thread_draw); + */ } else { - command_queue.flush_all(); //flush all pending from other threads visual_server->draw(); } } @@ -187,8 +191,8 @@ VisualServerWrapMT::VisualServerWrapMT(VisualServer* p_contained,bool p_create_t draw_pending=0; draw_thread_up=false; alloc_mutex=Mutex::create(); - texture_pool_max_size=GLOBAL_DEF("render/thread_textures_prealloc",20); - mesh_pool_max_size=GLOBAL_DEF("render/thread_meshes_prealloc",20); + texture_pool_max_size=GLOBAL_DEF("render/thread_textures_prealloc",5); + mesh_pool_max_size=GLOBAL_DEF("core/rid_pool_prealloc",20); if (!p_create_thread) { server_thread=Thread::get_caller_ID(); } else { diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/visual/visual_server_wrap_mt.h index 3d97243827..6719342a6a 100644 --- a/servers/visual/visual_server_wrap_mt.h +++ b/servers/visual/visual_server_wrap_mt.h @@ -79,554 +79,10 @@ class VisualServerWrapMT : public VisualServer { public: -#define FUNC0R(m_r,m_type)\ - virtual m_r m_type() { \ - if (Thread::get_caller_ID()!=server_thread) {\ - m_r ret;\ - command_queue.push_and_ret( visual_server, &VisualServer::m_type,&ret);\ - SYNC_DEBUG\ - return ret;\ - } else {\ - return visual_server->m_type();\ - }\ - } - -#define FUNCRID(m_type)\ - int m_type##allocn() {\ - for(int i=0;i<m_type##_pool_max_size;i++) {\ - m_type##_id_pool.push_back( visual_server->m_type##_create() );\ - }\ - return 0;\ - }\ - void m_type##_free_cached_ids() {\ - while (m_type##_id_pool.size()) {\ - free(m_type##_id_pool.front()->get());\ - m_type##_id_pool.pop_front();\ - }\ - }\ - virtual RID m_type##_create() { \ - if (Thread::get_caller_ID()!=server_thread) {\ - RID rid;\ - alloc_mutex->lock();\ - if (m_type##_id_pool.size()==0) {\ - int ret;\ - command_queue.push_and_ret( this, &VisualServerWrapMT::m_type##allocn,&ret);\ - }\ - rid=m_type##_id_pool.front()->get();\ - m_type##_id_pool.pop_front();\ - alloc_mutex->unlock();\ - return rid;\ - } else {\ - return visual_server->m_type##_create();\ - }\ - } - -#define FUNC0RC(m_r,m_type)\ - virtual m_r m_type() const { \ - if (Thread::get_caller_ID()!=server_thread) {\ - m_r ret;\ - command_queue.push_and_ret( visual_server, &VisualServer::m_type,&ret);\ - SYNC_DEBUG\ - return ret;\ - } else {\ - return visual_server->m_type();\ - }\ - } - - -#define FUNC0(m_type)\ - virtual void m_type() { \ - if (Thread::get_caller_ID()!=server_thread) {\ - command_queue.push( visual_server, &VisualServer::m_type);\ - } else {\ - visual_server->m_type();\ - }\ - } - -#define FUNC0C(m_type)\ - virtual void m_type() const { \ - if (Thread::get_caller_ID()!=server_thread) {\ - command_queue.push( visual_server, &VisualServer::m_type);\ - } else {\ - visual_server->m_type();\ - }\ - } - - -#define FUNC0S(m_type)\ - virtual void m_type() { \ - if (Thread::get_caller_ID()!=server_thread) {\ - command_queue.push_and_sync( visual_server, &VisualServer::m_type);\ - } else {\ - visual_server->m_type();\ - }\ - } - -#define FUNC0SC(m_type)\ - virtual void m_type() const { \ - if (Thread::get_caller_ID()!=server_thread) {\ - command_queue.push_and_sync( visual_server, &VisualServer::m_type);\ - } else {\ - visual_server->m_type();\ - }\ - } - - -/////////////////////////////////////////////// - - -#define FUNC1R(m_r,m_type,m_arg1)\ - virtual m_r m_type(m_arg1 p1) { \ - if (Thread::get_caller_ID()!=server_thread) {\ - m_r ret;\ - command_queue.push_and_ret( visual_server, &VisualServer::m_type,p1,&ret);\ - SYNC_DEBUG\ - return ret;\ - } else {\ - return visual_server->m_type(p1);\ - }\ - } - -#define FUNC1RC(m_r,m_type,m_arg1)\ - virtual m_r m_type(m_arg1 p1) const { \ - if (Thread::get_caller_ID()!=server_thread) {\ - m_r ret;\ - command_queue.push_and_ret( visual_server, &VisualServer::m_type,p1,&ret);\ - SYNC_DEBUG\ - return ret;\ - } else {\ - return visual_server->m_type(p1);\ - }\ - } - - -#define FUNC1S(m_type,m_arg1)\ - virtual void m_type(m_arg1 p1) { \ - if (Thread::get_caller_ID()!=server_thread) {\ - command_queue.push_and_sync( visual_server, &VisualServer::m_type,p1);\ - } else {\ - visual_server->m_type(p1);\ - }\ - } - -#define FUNC1SC(m_type,m_arg1)\ - virtual void m_type(m_arg1 p1) const { \ - if (Thread::get_caller_ID()!=server_thread) {\ - command_queue.push_and_sync( visual_server, &VisualServer::m_type,p1);\ - } else {\ - visual_server->m_type(p1);\ - }\ - } - - -#define FUNC1(m_type,m_arg1)\ - virtual void m_type(m_arg1 p1) { \ - if (Thread::get_caller_ID()!=server_thread) {\ - command_queue.push( visual_server, &VisualServer::m_type,p1);\ - } else {\ - visual_server->m_type(p1);\ - }\ - } - -#define FUNC1C(m_type,m_arg1)\ - virtual void m_type(m_arg1 p1) const { \ - if (Thread::get_caller_ID()!=server_thread) {\ - command_queue.push( visual_server, &VisualServer::m_type,p1);\ - } else {\ - visual_server->m_type(p1);\ - }\ - } - - - - -#define FUNC2R(m_r,m_type,m_arg1, m_arg2)\ - virtual m_r m_type(m_arg1 p1, m_arg2 p2) { \ - if (Thread::get_caller_ID()!=server_thread) {\ - m_r ret;\ - command_queue.push_and_ret( visual_server, &VisualServer::m_type,p1, p2,&ret);\ - SYNC_DEBUG\ - return ret;\ - } else {\ - return visual_server->m_type(p1, p2);\ - }\ - } - -#define FUNC2RC(m_r,m_type,m_arg1, m_arg2)\ - virtual m_r m_type(m_arg1 p1, m_arg2 p2) const { \ - if (Thread::get_caller_ID()!=server_thread) {\ - m_r ret;\ - command_queue.push_and_ret( visual_server, &VisualServer::m_type,p1, p2,&ret);\ - SYNC_DEBUG\ - return ret;\ - } else {\ - return visual_server->m_type(p1, p2);\ - }\ - } - - -#define FUNC2S(m_type,m_arg1, m_arg2)\ - virtual void m_type(m_arg1 p1, m_arg2 p2) { \ - if (Thread::get_caller_ID()!=server_thread) {\ - command_queue.push_and_sync( visual_server, &VisualServer::m_type,p1, p2);\ - } else {\ - visual_server->m_type(p1, p2);\ - }\ - } - -#define FUNC2SC(m_type,m_arg1, m_arg2)\ - virtual void m_type(m_arg1 p1, m_arg2 p2) const { \ - if (Thread::get_caller_ID()!=server_thread) {\ - command_queue.push_and_sync( visual_server, &VisualServer::m_type,p1, p2);\ - } else {\ - visual_server->m_type(p1, p2);\ - }\ - } - - -#define FUNC2(m_type,m_arg1, m_arg2)\ - virtual void m_type(m_arg1 p1, m_arg2 p2) { \ - if (Thread::get_caller_ID()!=server_thread) {\ - command_queue.push( visual_server, &VisualServer::m_type,p1, p2);\ - } else {\ - visual_server->m_type(p1, p2);\ - }\ - } - -#define FUNC2C(m_type,m_arg1, m_arg2)\ - virtual void m_type(m_arg1 p1, m_arg2 p2) const { \ - if (Thread::get_caller_ID()!=server_thread) {\ - command_queue.push( visual_server, &VisualServer::m_type,p1, p2);\ - } else {\ - visual_server->m_type(p1, p2);\ - }\ - } - - - - -#define FUNC3R(m_r,m_type,m_arg1, m_arg2, m_arg3)\ - virtual m_r m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3) { \ - if (Thread::get_caller_ID()!=server_thread) {\ - m_r ret;\ - command_queue.push_and_ret( visual_server, &VisualServer::m_type,p1, p2, p3,&ret);\ - SYNC_DEBUG\ - return ret;\ - } else {\ - return visual_server->m_type(p1, p2, p3);\ - }\ - } - -#define FUNC3RC(m_r,m_type,m_arg1, m_arg2, m_arg3)\ - virtual m_r m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3) const { \ - if (Thread::get_caller_ID()!=server_thread) {\ - m_r ret;\ - command_queue.push_and_ret( visual_server, &VisualServer::m_type,p1, p2, p3,&ret);\ - return ret;\ - } else {\ - return visual_server->m_type(p1, p2, p3);\ - }\ - } - - -#define FUNC3S(m_type,m_arg1, m_arg2, m_arg3)\ - virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3) { \ - if (Thread::get_caller_ID()!=server_thread) {\ - command_queue.push_and_sync( visual_server, &VisualServer::m_type,p1, p2, p3);\ - } else {\ - visual_server->m_type(p1, p2, p3);\ - }\ - } - -#define FUNC3SC(m_type,m_arg1, m_arg2, m_arg3)\ - virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3) const { \ - if (Thread::get_caller_ID()!=server_thread) {\ - command_queue.push_and_sync( visual_server, &VisualServer::m_type,p1, p2, p3);\ - } else {\ - visual_server->m_type(p1, p2, p3);\ - }\ - } - - -#define FUNC3(m_type,m_arg1, m_arg2, m_arg3)\ - virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3) { \ - if (Thread::get_caller_ID()!=server_thread) {\ - command_queue.push( visual_server, &VisualServer::m_type,p1, p2, p3);\ - } else {\ - visual_server->m_type(p1, p2, p3);\ - }\ - } - -#define FUNC3C(m_type,m_arg1, m_arg2, m_arg3)\ - virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3) const { \ - if (Thread::get_caller_ID()!=server_thread) {\ - command_queue.push( visual_server, &VisualServer::m_type,p1, p2, p3);\ - } else {\ - visual_server->m_type(p1, p2, p3);\ - }\ - } - - - - -#define FUNC4R(m_r,m_type,m_arg1, m_arg2, m_arg3, m_arg4)\ - virtual m_r m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4) { \ - if (Thread::get_caller_ID()!=server_thread) {\ - m_r ret;\ - command_queue.push_and_ret( visual_server, &VisualServer::m_type,p1, p2, p3, p4,&ret);\ - SYNC_DEBUG\ - return ret;\ - } else {\ - return visual_server->m_type(p1, p2, p3, p4);\ - }\ - } - -#define FUNC4RC(m_r,m_type,m_arg1, m_arg2, m_arg3, m_arg4)\ - virtual m_r m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4) const { \ - if (Thread::get_caller_ID()!=server_thread) {\ - m_r ret;\ - command_queue.push_and_ret( visual_server, &VisualServer::m_type,p1, p2, p3, p4,&ret);\ - SYNC_DEBUG\ - return ret;\ - } else {\ - return visual_server->m_type(p1, p2, p3, p4);\ - }\ - } - - -#define FUNC4S(m_type,m_arg1, m_arg2, m_arg3, m_arg4)\ - virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4) { \ - if (Thread::get_caller_ID()!=server_thread) {\ - command_queue.push_and_sync( visual_server, &VisualServer::m_type,p1, p2, p3, p4);\ - } else {\ - visual_server->m_type(p1, p2, p3, p4);\ - }\ - } - -#define FUNC4SC(m_type,m_arg1, m_arg2, m_arg3, m_arg4)\ - virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4) const { \ - if (Thread::get_caller_ID()!=server_thread) {\ - command_queue.push_and_sync( visual_server, &VisualServer::m_type,p1, p2, p3, p4);\ - } else {\ - visual_server->m_type(p1, p2, p3, p4);\ - }\ - } - - -#define FUNC4(m_type,m_arg1, m_arg2, m_arg3, m_arg4)\ - virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4) { \ - if (Thread::get_caller_ID()!=server_thread) {\ - command_queue.push( visual_server, &VisualServer::m_type,p1, p2, p3, p4);\ - } else {\ - visual_server->m_type(p1, p2, p3, p4);\ - }\ - } - -#define FUNC4C(m_type,m_arg1, m_arg2, m_arg3, m_arg4)\ - virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4) const { \ - if (Thread::get_caller_ID()!=server_thread) {\ - command_queue.push( visual_server, &VisualServer::m_type,p1, p2, p3, p4);\ - } else {\ - visual_server->m_type(p1, p2, p3, p4);\ - }\ - } - - - - -#define FUNC5R(m_r,m_type,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5)\ - virtual m_r m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5) { \ - if (Thread::get_caller_ID()!=server_thread) {\ - m_r ret;\ - command_queue.push_and_ret( visual_server, &VisualServer::m_type,p1, p2, p3, p4, p5,&ret);\ - SYNC_DEBUG\ - return ret;\ - } else {\ - return visual_server->m_type(p1, p2, p3, p4, p5);\ - }\ - } - -#define FUNC5RC(m_r,m_type,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5)\ - virtual m_r m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5) const { \ - if (Thread::get_caller_ID()!=server_thread) {\ - m_r ret;\ - command_queue.push_and_ret( visual_server, &VisualServer::m_type,p1, p2, p3, p4, p5,&ret);\ - SYNC_DEBUG\ - return ret;\ - } else {\ - return visual_server->m_type(p1, p2, p3, p4, p5);\ - }\ - } - - -#define FUNC5S(m_type,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5)\ - virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5) { \ - if (Thread::get_caller_ID()!=server_thread) {\ - command_queue.push_and_sync( visual_server, &VisualServer::m_type,p1, p2, p3, p4, p5);\ - } else {\ - visual_server->m_type(p1, p2, p3, p4, p5);\ - }\ - } - -#define FUNC5SC(m_type,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5)\ - virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5) const { \ - if (Thread::get_caller_ID()!=server_thread) {\ - command_queue.push_and_sync( visual_server, &VisualServer::m_type,p1, p2, p3, p4, p5);\ - } else {\ - visual_server->m_type(p1, p2, p3, p4, p5);\ - }\ - } - - -#define FUNC5(m_type,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5)\ - virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5) { \ - if (Thread::get_caller_ID()!=server_thread) {\ - command_queue.push( visual_server, &VisualServer::m_type,p1, p2, p3, p4, p5);\ - } else {\ - visual_server->m_type(p1, p2, p3, p4, p5);\ - }\ - } - -#define FUNC5C(m_type,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5)\ - virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5) const { \ - if (Thread::get_caller_ID()!=server_thread) {\ - command_queue.push( visual_server, &VisualServer::m_type,p1, p2, p3, p4, p5);\ - } else {\ - visual_server->m_type(p1, p2, p3, p4, p5);\ - }\ - } - - - - -#define FUNC6R(m_r,m_type,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6)\ - virtual m_r m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6) { \ - if (Thread::get_caller_ID()!=server_thread) {\ - m_r ret;\ - command_queue.push_and_ret( visual_server, &VisualServer::m_type,p1, p2, p3, p4, p5, p6,&ret);\ - SYNC_DEBUG\ - return ret;\ - } else {\ - return visual_server->m_type(p1, p2, p3, p4, p5, p6);\ - }\ - } - -#define FUNC6RC(m_r,m_type,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6)\ - virtual m_r m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6) const { \ - if (Thread::get_caller_ID()!=server_thread) {\ - m_r ret;\ - command_queue.push_and_ret( visual_server, &VisualServer::m_type,p1, p2, p3, p4, p5, p6,&ret);\ - return ret;\ - } else {\ - return visual_server->m_type(p1, p2, p3, p4, p5, p6);\ - }\ - } - - -#define FUNC6S(m_type,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6)\ - virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6) { \ - if (Thread::get_caller_ID()!=server_thread) {\ - command_queue.push_and_sync( visual_server, &VisualServer::m_type,p1, p2, p3, p4, p5, p6);\ - } else {\ - visual_server->m_type(p1, p2, p3, p4, p5, p6);\ - }\ - } - -#define FUNC6SC(m_type,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6)\ - virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6) const { \ - if (Thread::get_caller_ID()!=server_thread) {\ - command_queue.push_and_sync( visual_server, &VisualServer::m_type,p1, p2, p3, p4, p5, p6);\ - } else {\ - visual_server->m_type(p1, p2, p3, p4, p5, p6);\ - }\ - } - - -#define FUNC6(m_type,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6)\ - virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6) { \ - if (Thread::get_caller_ID()!=server_thread) {\ - command_queue.push( visual_server, &VisualServer::m_type,p1, p2, p3, p4, p5, p6);\ - } else {\ - visual_server->m_type(p1, p2, p3, p4, p5, p6);\ - }\ - } - -#define FUNC6C(m_type,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6)\ - virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6) const { \ - if (Thread::get_caller_ID()!=server_thread) {\ - command_queue.push( visual_server, &VisualServer::m_type,p1, p2, p3, p4, p5, p6);\ - } else {\ - visual_server->m_type(p1, p2, p3, p4, p5, p6);\ - }\ - } - - - - -#define FUNC7R(m_r,m_type,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7)\ - virtual m_r m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6, m_arg7 p7) { \ - if (Thread::get_caller_ID()!=server_thread) {\ - m_r ret;\ - command_queue.push_and_ret( visual_server, &VisualServer::m_type,p1, p2, p3, p4, p5, p6, p7,&ret);\ - SYNC_DEBUG\ - return ret;\ - } else {\ - return visual_server->m_type(p1, p2, p3, p4, p5, p6, p7);\ - }\ - } - -#define FUNC7RC(m_r,m_type,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7)\ - virtual m_r m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6, m_arg7 p7) const { \ - if (Thread::get_caller_ID()!=server_thread) {\ - m_r ret;\ - command_queue.push_and_ret( visual_server, &VisualServer::m_type,p1, p2, p3, p4, p5, p6, p7,&ret);\ - SYNC_DEBUG\ - return ret;\ - } else {\ - return visual_server->m_type(p1, p2, p3, p4, p5, p6, p7);\ - }\ - } - - -#define FUNC7S(m_type,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7)\ - virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6, m_arg7 p7) { \ - if (Thread::get_caller_ID()!=server_thread) {\ - command_queue.push_and_sync( visual_server, &VisualServer::m_type,p1, p2, p3, p4, p5, p6, p7);\ - } else {\ - visual_server->m_type(p1, p2, p3, p4, p5, p6, p7);\ - }\ - } - -#define FUNC7SC(m_type,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7)\ - virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6, m_arg7 p7) const { \ - if (Thread::get_caller_ID()!=server_thread) {\ - command_queue.push_and_sync( visual_server, &VisualServer::m_type,p1, p2, p3, p4, p5, p6, p7);\ - } else {\ - visual_server->m_type(p1, p2, p3, p4, p5, p6, p7);\ - }\ - } - - -#define FUNC7(m_type,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7)\ - virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6, m_arg7 p7) { \ - if (Thread::get_caller_ID()!=server_thread) {\ - command_queue.push( visual_server, &VisualServer::m_type,p1, p2, p3, p4, p5, p6, p7);\ - } else {\ - visual_server->m_type(p1, p2, p3, p4, p5, p6, p7);\ - }\ - } - -#define FUNC7C(m_type,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7)\ - virtual void m_type(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6, m_arg7 p7) const { \ - if (Thread::get_caller_ID()!=server_thread) {\ - command_queue.push( visual_server, &VisualServer::m_type,p1, p2, p3, p4, p5, p6, p7);\ - } else {\ - visual_server->m_type(p1, p2, p3, p4, p5, p6, p7);\ - }\ - } - - - +#define ServerName VisualServer +#define ServerNameWrapMT VisualServerWrapMT +#define server_name visual_server +#include "servers/server_wrap_mt_common.h" //FUNC0R(RID,texture_create); FUNCRID(texture); @@ -1225,7 +681,7 @@ public: virtual void init(); virtual void finish(); virtual void draw(); - virtual void flush(); + virtual void sync(); FUNC0RC(bool,has_changed); /* RENDER INFO */ @@ -1242,7 +698,15 @@ public: VisualServerWrapMT(VisualServer* p_contained,bool p_create_thread); ~VisualServerWrapMT(); +#undef ServerName +#undef ServerNameWrapMT +#undef server_name + }; +#ifdef DEBUG_SYNC +#undef DEBUG_SYNC +#endif +#undef SYNC_DEBUG #endif |