aboutsummaryrefslogtreecommitdiff
path: root/drivers/pvr
diff options
context:
space:
mode:
authorKostadin Damyanov2015-09-05 12:03:17 +0300
committerKostadin Damyanov2015-09-05 12:03:17 +0300
commitc5f574b914b3cb11d97ae616df4a0bced45bb17c (patch)
treed7b70f0842c00c480ce10039b873a1dddd894a6c /drivers/pvr
parent2a757a6ad4ef4e7767b7d3ef7e177ec6613ef6d1 (diff)
parentb0aa49accbd7e45dae38f1bd43b0fbdd11714211 (diff)
downloadgodot-c5f574b914b3cb11d97ae616df4a0bced45bb17c.tar.gz
godot-c5f574b914b3cb11d97ae616df4a0bced45bb17c.tar.zst
godot-c5f574b914b3cb11d97ae616df4a0bced45bb17c.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'drivers/pvr')
-rw-r--r--drivers/pvr/texture_loader_pvr.cpp9
-rw-r--r--drivers/pvr/texture_loader_pvr.h2
2 files changed, 9 insertions, 2 deletions
diff --git a/drivers/pvr/texture_loader_pvr.cpp b/drivers/pvr/texture_loader_pvr.cpp
index 5268b953f..eb67dad8c 100644
--- a/drivers/pvr/texture_loader_pvr.cpp
+++ b/drivers/pvr/texture_loader_pvr.cpp
@@ -22,8 +22,10 @@ enum PVRFLags {
-RES ResourceFormatPVR::load(const String &p_path,const String& p_original_path) {
+RES ResourceFormatPVR::load(const String &p_path,const String& p_original_path,Error *r_error) {
+ if (r_error)
+ *r_error=ERR_CANT_OPEN;
Error err;
FileAccess *f = FileAccess::open(p_path,FileAccess::READ,&err);
@@ -34,6 +36,8 @@ RES ResourceFormatPVR::load(const String &p_path,const String& p_original_path)
ERR_FAIL_COND_V(err,RES());
+ if (r_error)
+ *r_error=ERR_FILE_CORRUPT;
uint32_t hsize = f->get_32();
@@ -135,6 +139,9 @@ RES ResourceFormatPVR::load(const String &p_path,const String& p_original_path)
Ref<ImageTexture> texture = memnew( ImageTexture );
texture->create_from_image(image,tex_flags);
+ if (r_error)
+ *r_error=OK;
+
return texture;
}
diff --git a/drivers/pvr/texture_loader_pvr.h b/drivers/pvr/texture_loader_pvr.h
index ad86660aa..735cb2b48 100644
--- a/drivers/pvr/texture_loader_pvr.h
+++ b/drivers/pvr/texture_loader_pvr.h
@@ -9,7 +9,7 @@
class ResourceFormatPVR : public ResourceFormatLoader{
public:
- virtual RES load(const String &p_path,const String& p_original_path);
+ 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;
virtual bool handles_type(const String& p_type) const;
virtual String get_resource_type(const String &p_path) const;