diff options
Diffstat (limited to 'servers/rendering/dummy/storage/utilities.h')
-rw-r--r-- | servers/rendering/dummy/storage/utilities.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/servers/rendering/dummy/storage/utilities.h b/servers/rendering/dummy/storage/utilities.h index b94f678c75..cb7b2a2b63 100644 --- a/servers/rendering/dummy/storage/utilities.h +++ b/servers/rendering/dummy/storage/utilities.h @@ -31,20 +31,38 @@ #ifndef UTILITIES_DUMMY_H #define UTILITIES_DUMMY_H +#include "mesh_storage.h" #include "servers/rendering/storage/utilities.h" #include "texture_storage.h" namespace RendererDummy { class Utilities : public RendererUtilities { +private: + static Utilities *singleton; + public: + static Utilities *get_singleton() { return singleton; } + + Utilities(); + ~Utilities(); + /* INSTANCES */ - virtual RS::InstanceType get_base_type(RID p_rid) const override { return RS::INSTANCE_NONE; } + virtual RS::InstanceType get_base_type(RID p_rid) const override { + if (RendererDummy::MeshStorage::get_singleton()->owns_mesh(p_rid)) { + return RS::INSTANCE_MESH; + } + return RS::INSTANCE_NONE; + } + virtual bool free(RID p_rid) override { if (RendererDummy::TextureStorage::get_singleton()->owns_texture(p_rid)) { RendererDummy::TextureStorage::get_singleton()->texture_free(p_rid); return true; + } else if (RendererDummy::MeshStorage::get_singleton()->owns_mesh(p_rid)) { + RendererDummy::MeshStorage::get_singleton()->mesh_free(p_rid); + return true; } return false; } |