diff options
Diffstat (limited to 'servers/rendering/dummy/storage/mesh_storage.cpp')
-rw-r--r-- | servers/rendering/dummy/storage/mesh_storage.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/servers/rendering/dummy/storage/mesh_storage.cpp b/servers/rendering/dummy/storage/mesh_storage.cpp index ab27711d6e..0b7ade1762 100644 --- a/servers/rendering/dummy/storage/mesh_storage.cpp +++ b/servers/rendering/dummy/storage/mesh_storage.cpp @@ -63,3 +63,33 @@ void MeshStorage::mesh_clear(RID p_mesh) { m->surfaces.clear(); } + +RID MeshStorage::multimesh_allocate() { + return multimesh_owner.allocate_rid(); +} + +void MeshStorage::multimesh_initialize(RID p_rid) { + multimesh_owner.initialize_rid(p_rid, DummyMultiMesh()); +} + +void MeshStorage::multimesh_free(RID p_rid) { + DummyMultiMesh *multimesh = multimesh_owner.get_or_null(p_rid); + ERR_FAIL_NULL(multimesh); + + multimesh_owner.free(p_rid); +} + +void MeshStorage::multimesh_set_buffer(RID p_multimesh, const Vector<float> &p_buffer) { + DummyMultiMesh *multimesh = multimesh_owner.get_or_null(p_multimesh); + ERR_FAIL_NULL(multimesh); + multimesh->buffer.resize(p_buffer.size()); + float *cache_data = multimesh->buffer.ptrw(); + memcpy(cache_data, p_buffer.ptr(), p_buffer.size() * sizeof(float)); +} + +Vector<float> MeshStorage::multimesh_get_buffer(RID p_multimesh) const { + DummyMultiMesh *multimesh = multimesh_owner.get_or_null(p_multimesh); + ERR_FAIL_NULL_V(multimesh, Vector<float>()); + + return multimesh->buffer; +} |