summaryrefslogtreecommitdiff
path: root/modules/pvr
diff options
context:
space:
mode:
Diffstat (limited to 'modules/pvr')
-rw-r--r--modules/pvr/register_types.cpp7
-rw-r--r--modules/pvr/texture_loader_pvr.h1
2 files changed, 5 insertions, 3 deletions
diff --git a/modules/pvr/register_types.cpp b/modules/pvr/register_types.cpp
index 0991828ef2..cf5bdabf3f 100644
--- a/modules/pvr/register_types.cpp
+++ b/modules/pvr/register_types.cpp
@@ -32,15 +32,16 @@
#include "texture_loader_pvr.h"
-static ResourceFormatPVR *resource_loader_pvr = NULL;
+static Ref<ResourceFormatPVR> resource_loader_pvr;
void register_pvr_types() {
- resource_loader_pvr = memnew(ResourceFormatPVR);
+ resource_loader_pvr.instance();
ResourceLoader::add_resource_format_loader(resource_loader_pvr);
}
void unregister_pvr_types() {
- memdelete(resource_loader_pvr);
+ ResourceLoader::remove_resource_format_loader(resource_loader_pvr);
+ resource_loader_pvr.unref();
}
diff --git a/modules/pvr/texture_loader_pvr.h b/modules/pvr/texture_loader_pvr.h
index c859a4cdda..530b6948f0 100644
--- a/modules/pvr/texture_loader_pvr.h
+++ b/modules/pvr/texture_loader_pvr.h
@@ -35,6 +35,7 @@
#include "scene/resources/texture.h"
class ResourceFormatPVR : public ResourceFormatLoader {
+ GDCLASS(ResourceFormatPVR, ResourceFormatLoader)
public:
virtual RES load(const String &p_path, const String &p_original_path, Error *r_error = NULL);
virtual void get_recognized_extensions(List<String> *p_extensions) const;