diff options
author | AndreaCatania <info@andreacatania.com> | 2017-11-21 01:26:37 +0100 |
---|---|---|
committer | Andrea Catania <info@andreacatania.com> | 2018-07-23 12:59:27 +0200 |
commit | fbf3ad284182b002edc63b453f2aa943a93bdd86 (patch) | |
tree | ff63a502854eb2e300d0e37721ae3c70525ac7d7 /servers | |
parent | b204389762cdaa4b5327e4a655041ef3be05232f (diff) |
Added some API to visual server so from control VRAM buffer is more easy
Diffstat (limited to 'servers')
-rw-r--r-- | servers/visual/rasterizer.h | 3 | ||||
-rw-r--r-- | servers/visual/visual_server_raster.h | 3 | ||||
-rw-r--r-- | servers/visual/visual_server_wrap_mt.h | 4 | ||||
-rw-r--r-- | servers/visual_server.cpp | 3 | ||||
-rw-r--r-- | servers/visual_server.h | 2 |
5 files changed, 14 insertions, 1 deletions
diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index 0b37d266e7..38849721f8 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -252,6 +252,8 @@ public: virtual void mesh_set_blend_shape_mode(RID p_mesh, VS::BlendShapeMode p_mode) = 0; virtual VS::BlendShapeMode mesh_get_blend_shape_mode(RID p_mesh) const = 0; + virtual uint32_t mesh_surface_get_stride_in_array(RID p_mesh, int p_surface, int p_array_index) const = 0; + virtual uint32_t mesh_surface_get_offset_in_array(RID p_mesh, int p_surface, int p_array_index) const = 0; virtual void mesh_surface_update_region(RID p_mesh, int p_surface, int p_offset, const PoolVector<uint8_t> &p_data) = 0; virtual void mesh_surface_set_material(RID p_mesh, int p_surface, RID p_material) = 0; @@ -277,6 +279,7 @@ public: virtual AABB mesh_get_custom_aabb(RID p_mesh) const = 0; virtual AABB mesh_get_aabb(RID p_mesh, RID p_skeleton) const = 0; + virtual void mesh_clear(RID p_mesh) = 0; /* MULTIMESH API */ diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h index ec0d02ed2a..c2bf1110f0 100644 --- a/servers/visual/visual_server_raster.h +++ b/servers/visual/visual_server_raster.h @@ -97,6 +97,7 @@ public: #define DISPLAY_CHANGED \ changes++; #endif + // print_line(String("CHANGED: ") + __FUNCTION__); #define BIND0R(m_r, m_name) \ m_r m_name() { return BINDBASE->m_name(); } @@ -218,6 +219,8 @@ public: BIND2(mesh_set_blend_shape_mode, RID, BlendShapeMode) BIND1RC(BlendShapeMode, mesh_get_blend_shape_mode, RID) + BIND3RC(uint32_t, mesh_surface_get_stride_in_array, RID, int, int) + BIND3RC(uint32_t, mesh_surface_get_offset_in_array, RID, int, int) BIND4(mesh_surface_update_region, RID, int, int, const PoolVector<uint8_t> &) BIND3(mesh_surface_set_material, RID, int, RID) diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/visual/visual_server_wrap_mt.h index 48f0ec46f3..3ba761e4f3 100644 --- a/servers/visual/visual_server_wrap_mt.h +++ b/servers/visual/visual_server_wrap_mt.h @@ -64,7 +64,7 @@ class VisualServerWrapMT : public VisualServer { int pool_max_size; - //#define DEBUG_SYNC +//#define DEBUG_SYNC static VisualServerWrapMT *singleton_mt; @@ -152,6 +152,8 @@ public: FUNC2(mesh_set_blend_shape_mode, RID, BlendShapeMode) FUNC1RC(BlendShapeMode, mesh_get_blend_shape_mode, RID) + FUNC3RC(uint32_t, mesh_surface_get_stride_in_array, RID, int, int) + FUNC3RC(uint32_t, mesh_surface_get_offset_in_array, RID, int, int) FUNC4(mesh_surface_update_region, RID, int, int, const PoolVector<uint8_t> &) FUNC3(mesh_surface_set_material, RID, int, RID) diff --git a/servers/visual_server.cpp b/servers/visual_server.cpp index a48f1cccae..200475742b 100644 --- a/servers/visual_server.cpp +++ b/servers/visual_server.cpp @@ -1569,6 +1569,9 @@ void VisualServer::_bind_methods() { ClassDB::bind_method(D_METHOD("mesh_get_blend_shape_count", "mesh"), &VisualServer::mesh_get_blend_shape_count); ClassDB::bind_method(D_METHOD("mesh_set_blend_shape_mode", "mesh", "mode"), &VisualServer::mesh_set_blend_shape_mode); ClassDB::bind_method(D_METHOD("mesh_get_blend_shape_mode", "mesh"), &VisualServer::mesh_get_blend_shape_mode); + ClassDB::bind_method(D_METHOD("mesh_surface_get_stride_in_array", "mesh", "surface", "array_index"), &VisualServer::mesh_surface_get_stride_in_array); + ClassDB::bind_method(D_METHOD("mesh_surface_get_offset_in_array", "mesh", "surface", "array_index"), &VisualServer::mesh_surface_get_offset_in_array); + ClassDB::bind_method(D_METHOD("mesh_surface_update_region", "mesh", "surface", "offset", "data"), &VisualServer::mesh_surface_update_region); ClassDB::bind_method(D_METHOD("mesh_surface_set_material", "mesh", "surface", "material"), &VisualServer::mesh_surface_set_material); ClassDB::bind_method(D_METHOD("mesh_surface_get_material", "mesh", "surface"), &VisualServer::mesh_surface_get_material); ClassDB::bind_method(D_METHOD("mesh_surface_get_array_len", "mesh", "surface"), &VisualServer::mesh_surface_get_array_len); diff --git a/servers/visual_server.h b/servers/visual_server.h index 968cb852ed..424de4ab63 100644 --- a/servers/visual_server.h +++ b/servers/visual_server.h @@ -265,6 +265,8 @@ public: virtual void mesh_set_blend_shape_mode(RID p_mesh, BlendShapeMode p_mode) = 0; virtual BlendShapeMode mesh_get_blend_shape_mode(RID p_mesh) const = 0; + virtual uint32_t mesh_surface_get_stride_in_array(RID p_mesh, int p_surface, int p_array_index) const = 0; + virtual uint32_t mesh_surface_get_offset_in_array(RID p_mesh, int p_surface, int p_array_index) const = 0; virtual void mesh_surface_update_region(RID p_mesh, int p_surface, int p_offset, const PoolVector<uint8_t> &p_data) = 0; virtual void mesh_surface_set_material(RID p_mesh, int p_surface, RID p_material) = 0; |