diff options
author | David House <Bonkahe@gmail.com> | 2024-11-02 23:22:16 -0500 |
---|---|---|
committer | David House <Bonkahe@gmail.com> | 2024-11-14 15:52:08 -0600 |
commit | 6e9d31f602c2c31e047db9173e728fe17706185c (patch) | |
tree | e2e05aed02e260db875b151e75eaf82fbaede87a /servers/rendering | |
parent | 673f396677654220d7e1d5b6fb5ed3b50126b4e6 (diff) | |
download | redot-engine-6e9d31f602c2c31e047db9173e728fe17706185c.tar.gz |
Implemented multimesh_get_buffer_rd_rid function into RenderingServer.
Fixed style error.
Updated dummy mesh_storage to move from cpp to h the return of a blank Rid on _multimesh_get_buffer_rd_rid.
Diffstat (limited to 'servers/rendering')
-rw-r--r-- | servers/rendering/dummy/storage/mesh_storage.h | 1 | ||||
-rw-r--r-- | servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp | 6 | ||||
-rw-r--r-- | servers/rendering/renderer_rd/storage_rd/mesh_storage.h | 1 | ||||
-rw-r--r-- | servers/rendering/rendering_server_default.h | 1 | ||||
-rw-r--r-- | servers/rendering/storage/mesh_storage.cpp | 4 | ||||
-rw-r--r-- | servers/rendering/storage/mesh_storage.h | 2 |
6 files changed, 15 insertions, 0 deletions
diff --git a/servers/rendering/dummy/storage/mesh_storage.h b/servers/rendering/dummy/storage/mesh_storage.h index 855336c71f..556d58f411 100644 --- a/servers/rendering/dummy/storage/mesh_storage.h +++ b/servers/rendering/dummy/storage/mesh_storage.h @@ -170,6 +170,7 @@ public: virtual Color _multimesh_instance_get_color(RID p_multimesh, int p_index) const override { return Color(); } virtual Color _multimesh_instance_get_custom_data(RID p_multimesh, int p_index) const override { return Color(); } virtual void _multimesh_set_buffer(RID p_multimesh, const Vector<float> &p_buffer) override; + virtual RID _multimesh_get_buffer_rd_rid(RID p_multimesh) const override { return RID(); } virtual Vector<float> _multimesh_get_buffer(RID p_multimesh) const override; virtual void _multimesh_set_visible_instances(RID p_multimesh, int p_visible) override {} diff --git a/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp b/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp index 0d468ad1e3..7537e70235 100644 --- a/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp +++ b/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp @@ -1997,6 +1997,12 @@ void MeshStorage::_multimesh_set_buffer(RID p_multimesh, const Vector<float> &p_ } } +RID MeshStorage::_multimesh_get_buffer_rd_rid(RID p_multimesh) const { + MultiMesh *multimesh = multimesh_owner.get_or_null(p_multimesh); + ERR_FAIL_NULL_V(multimesh, RID()); + return multimesh->buffer; +} + Vector<float> MeshStorage::_multimesh_get_buffer(RID p_multimesh) const { MultiMesh *multimesh = multimesh_owner.get_or_null(p_multimesh); ERR_FAIL_NULL_V(multimesh, Vector<float>()); diff --git a/servers/rendering/renderer_rd/storage_rd/mesh_storage.h b/servers/rendering/renderer_rd/storage_rd/mesh_storage.h index c14c2945bd..11962b05f4 100644 --- a/servers/rendering/renderer_rd/storage_rd/mesh_storage.h +++ b/servers/rendering/renderer_rd/storage_rd/mesh_storage.h @@ -651,6 +651,7 @@ public: virtual Color _multimesh_instance_get_custom_data(RID p_multimesh, int p_index) const override; virtual void _multimesh_set_buffer(RID p_multimesh, const Vector<float> &p_buffer) override; + virtual RID _multimesh_get_buffer_rd_rid(RID p_multimesh) const override; virtual Vector<float> _multimesh_get_buffer(RID p_multimesh) const override; virtual void _multimesh_set_visible_instances(RID p_multimesh, int p_visible) override; diff --git a/servers/rendering/rendering_server_default.h b/servers/rendering/rendering_server_default.h index 5c3ee513c7..29b1e163c7 100644 --- a/servers/rendering/rendering_server_default.h +++ b/servers/rendering/rendering_server_default.h @@ -403,6 +403,7 @@ public: FUNC2RC(Color, multimesh_instance_get_custom_data, RID, int) FUNC2(multimesh_set_buffer, RID, const Vector<float> &) + FUNC1RC(RID, multimesh_get_buffer_rd_rid, RID) FUNC1RC(Vector<float>, multimesh_get_buffer, RID) FUNC3(multimesh_set_buffer_interpolated, RID, const Vector<float> &, const Vector<float> &) diff --git a/servers/rendering/storage/mesh_storage.cpp b/servers/rendering/storage/mesh_storage.cpp index 6680920c98..4a6746e6c9 100644 --- a/servers/rendering/storage/mesh_storage.cpp +++ b/servers/rendering/storage/mesh_storage.cpp @@ -223,6 +223,10 @@ void RendererMeshStorage::multimesh_set_buffer(RID p_multimesh, const Vector<flo _multimesh_set_buffer(p_multimesh, p_buffer); } +RID RendererMeshStorage::multimesh_get_buffer_rd_rid(RID p_multimesh) const { + return _multimesh_get_buffer_rd_rid(p_multimesh); +} + Vector<float> RendererMeshStorage::multimesh_get_buffer(RID p_multimesh) const { return _multimesh_get_buffer(p_multimesh); } diff --git a/servers/rendering/storage/mesh_storage.h b/servers/rendering/storage/mesh_storage.h index 5e3a4738e6..6a8b385a69 100644 --- a/servers/rendering/storage/mesh_storage.h +++ b/servers/rendering/storage/mesh_storage.h @@ -141,6 +141,7 @@ public: virtual Color multimesh_instance_get_custom_data(RID p_multimesh, int p_index) const; virtual void multimesh_set_buffer(RID p_multimesh, const Vector<float> &p_buffer); + virtual RID multimesh_get_buffer_rd_rid(RID p_multimesh) const; virtual Vector<float> multimesh_get_buffer(RID p_multimesh) const; virtual void multimesh_set_buffer_interpolated(RID p_multimesh, const Vector<float> &p_buffer, const Vector<float> &p_buffer_prev); @@ -178,6 +179,7 @@ public: virtual Color _multimesh_instance_get_custom_data(RID p_multimesh, int p_index) const = 0; virtual void _multimesh_set_buffer(RID p_multimesh, const Vector<float> &p_buffer) = 0; + virtual RID _multimesh_get_buffer_rd_rid(RID p_multimesh) const = 0; virtual Vector<float> _multimesh_get_buffer(RID p_multimesh) const = 0; virtual void _multimesh_set_visible_instances(RID p_multimesh, int p_visible) = 0; |