aboutsummaryrefslogtreecommitdiff
path: root/scene/resources/shader.cpp
diff options
context:
space:
mode:
authorJuan Linietsky2015-08-23 20:15:56 -0300
committerJuan Linietsky2015-08-23 20:15:56 -0300
commit07e97414250827c3b930befa123a4bbd48d24861 (patch)
tree8ec9872421ad333d3a1150ee64db1d0d27bd4269 /scene/resources/shader.cpp
parent9d185ccc30ad5fe7eb716390ca2e7f5c06574ce0 (diff)
downloadgodot-07e97414250827c3b930befa123a4bbd48d24861.tar.gz
godot-07e97414250827c3b930befa123a4bbd48d24861.tar.zst
godot-07e97414250827c3b930befa123a4bbd48d24861.zip
Diffstat (limited to 'scene/resources/shader.cpp')
-rw-r--r--scene/resources/shader.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/scene/resources/shader.cpp b/scene/resources/shader.cpp
index 90598ee78..a9376faf6 100644
--- a/scene/resources/shader.cpp
+++ b/scene/resources/shader.cpp
@@ -219,7 +219,10 @@ Shader::~Shader() {
-RES ResourceFormatLoaderShader::load(const String &p_path,const String& p_original_path) {
+RES ResourceFormatLoaderShader::load(const String &p_path, const String& p_original_path, Error *r_error) {
+
+ if (r_error)
+ *r_error=ERR_FILE_CANT_OPEN;
String fragment_code;
String vertex_code;
@@ -235,6 +238,8 @@ RES ResourceFormatLoaderShader::load(const String &p_path,const String& p_origin
ERR_FAIL_COND_V(err,RES());
String base_path = p_path.get_base_dir();
+ if (r_error)
+ *r_error=ERR_FILE_CORRUPT;
Ref<Shader> shader;//( memnew( Shader ) );
@@ -435,6 +440,8 @@ RES ResourceFormatLoaderShader::load(const String &p_path,const String& p_origin
f->close();
memdelete(f);
+ if (r_error)
+ *r_error=OK;
return shader;
}