aboutsummaryrefslogtreecommitdiff
path: root/scene/resources/shader.cpp
diff options
context:
space:
mode:
authorKostadin Damyanov2015-09-05 12:03:17 +0300
committerKostadin Damyanov2015-09-05 12:03:17 +0300
commitc5f574b914b3cb11d97ae616df4a0bced45bb17c (patch)
treed7b70f0842c00c480ce10039b873a1dddd894a6c /scene/resources/shader.cpp
parent2a757a6ad4ef4e7767b7d3ef7e177ec6613ef6d1 (diff)
parentb0aa49accbd7e45dae38f1bd43b0fbdd11714211 (diff)
downloadgodot-c5f574b914b3cb11d97ae616df4a0bced45bb17c.tar.gz
godot-c5f574b914b3cb11d97ae616df4a0bced45bb17c.tar.zst
godot-c5f574b914b3cb11d97ae616df4a0bced45bb17c.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;
}