From 065e2670af53ae2f71b78d57f8a217b4539cbbe2 Mon Sep 17 00:00:00 2001 From: Marc Gilleron Date: Mon, 11 Jun 2018 02:59:53 +0200 Subject: Added basic support for custom resource savers and loaders --- platform/server/os_server.cpp | 5 +++-- platform/server/os_server.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'platform') diff --git a/platform/server/os_server.cpp b/platform/server/os_server.cpp index 60f20d6009..5d67e2113f 100644 --- a/platform/server/os_server.cpp +++ b/platform/server/os_server.cpp @@ -99,7 +99,7 @@ Error OS_Server::initialize(const VideoMode &p_desired, int p_video_driver, int _ensure_user_data_dir(); - resource_loader_dummy = memnew(ResourceFormatDummyTexture); + resource_loader_dummy.instance(); ResourceLoader::add_resource_format_loader(resource_loader_dummy); return OK; @@ -118,7 +118,8 @@ void OS_Server::finalize() { memdelete(power_manager); - memdelete(resource_loader_dummy); + ResourceLoader::remove_resource_format_loader(resource_loader_dummy); + resource_loader_dummy.unref(); args.clear(); } diff --git a/platform/server/os_server.h b/platform/server/os_server.h index 0367ec3db9..b5dc7900e6 100644 --- a/platform/server/os_server.h +++ b/platform/server/os_server.h @@ -77,7 +77,7 @@ class OS_Server : public OS_Unix { int video_driver_index; - ResourceFormatDummyTexture *resource_loader_dummy; + Ref resource_loader_dummy; protected: virtual int get_video_driver_count() const; -- cgit v1.2.3