summaryrefslogtreecommitdiff
path: root/drivers/chibi
diff options
context:
space:
mode:
authorAnton Yabchinskiy <arn@bestmx.ru>2015-11-02 20:25:01 +0300
committerAnton Yabchinskiy <arn@bestmx.ru>2015-11-02 20:25:01 +0300
commit3b9868d2e44740c03861c64020a8b5d4d6da031d (patch)
tree8ff5f9671122f946487848ce286d336c9b650c2c /drivers/chibi
parentdc8df8a91a995796f0f330bf6bb6b209f6dfce08 (diff)
parentb2f9acb8c96aed0505cbac21661e21e4acef710f (diff)
Merge branch 'master' of github.com:okamstudio/godot
Diffstat (limited to 'drivers/chibi')
-rw-r--r--drivers/chibi/event_stream_chibi.cpp13
-rw-r--r--drivers/chibi/event_stream_chibi.h2
2 files changed, 13 insertions, 2 deletions
diff --git a/drivers/chibi/event_stream_chibi.cpp b/drivers/chibi/event_stream_chibi.cpp
index e87e0a9aaa..ecb5c3f22b 100644
--- a/drivers/chibi/event_stream_chibi.cpp
+++ b/drivers/chibi/event_stream_chibi.cpp
@@ -779,8 +779,10 @@ EventStreamChibi::EventStreamChibi() {
-RES ResourceFormatLoaderChibi::load(const String &p_path,const String& p_original_path) {
+RES ResourceFormatLoaderChibi::load(const String &p_path, const String& p_original_path, Error *r_error) {
+ if (r_error)
+ *r_error=ERR_FILE_CANT_OPEN;
String el = p_path.extension().to_lower();
CPFileAccessWrapperImpl f;
@@ -791,6 +793,8 @@ RES ResourceFormatLoaderChibi::load(const String &p_path,const String& p_origina
CPLoader_IT loader(&f);
CPLoader::Error err = loader.load_song(p_path.utf8().get_data(),&esc->song,false);
ERR_FAIL_COND_V(err!=CPLoader::FILE_OK,RES());
+ if (r_error)
+ *r_error=OK;
return esc;
@@ -800,6 +804,8 @@ RES ResourceFormatLoaderChibi::load(const String &p_path,const String& p_origina
CPLoader_XM loader(&f);
CPLoader::Error err=loader.load_song(p_path.utf8().get_data(),&esc->song,false);
ERR_FAIL_COND_V(err!=CPLoader::FILE_OK,RES());
+ if (r_error)
+ *r_error=OK;
return esc;
} else if (el=="s3m") {
@@ -808,6 +814,9 @@ RES ResourceFormatLoaderChibi::load(const String &p_path,const String& p_origina
CPLoader_S3M loader(&f);
CPLoader::Error err=loader.load_song(p_path.utf8().get_data(),&esc->song,false);
ERR_FAIL_COND_V(err!=CPLoader::FILE_OK,RES());
+ if (r_error)
+ *r_error=OK;
+
return esc;
} else if (el=="mod") {
@@ -816,6 +825,8 @@ RES ResourceFormatLoaderChibi::load(const String &p_path,const String& p_origina
CPLoader_MOD loader(&f);
CPLoader::Error err=loader.load_song(p_path.utf8().get_data(),&esc->song,false);
ERR_FAIL_COND_V(err!=CPLoader::FILE_OK,RES());
+ if (r_error)
+ *r_error=OK;
return esc;
}
diff --git a/drivers/chibi/event_stream_chibi.h b/drivers/chibi/event_stream_chibi.h
index 7b2ee4b471..b564c16018 100644
--- a/drivers/chibi/event_stream_chibi.h
+++ b/drivers/chibi/event_stream_chibi.h
@@ -301,7 +301,7 @@ public:
class ResourceFormatLoaderChibi : 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;