diff options
| author | Juan Linietsky | 2015-08-23 20:15:56 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2015-08-23 20:15:56 -0300 |
| commit | 07e97414250827c3b930befa123a4bbd48d24861 (patch) | |
| tree | 8ec9872421ad333d3a1150ee64db1d0d27bd4269 /drivers/dds/texture_loader_dds.cpp | |
| parent | 9d185ccc30ad5fe7eb716390ca2e7f5c06574ce0 (diff) | |
| download | godot-07e97414250827c3b930befa123a4bbd48d24861.tar.gz godot-07e97414250827c3b930befa123a4bbd48d24861.tar.zst godot-07e97414250827c3b930befa123a4bbd48d24861.zip | |
**WARNING BEFORE PULLING**
This push changes the binary and XML formats and bumps the major version to 2.0. As such, files saved in this version WILL NO LONGER WORK IN PREVIOUS VERSIONS. This compatibility breakage with older versions was required in order to properly provide project refactoring tools.
If I were you, unless you are brave, I would wait a week or two before pulling, in case of bugs :)
Summary of Changes
-New Filesystem dock, with filesystem & tree view modes.
-New refactoring tools, to change or fix dependencies.
-Quick search dialog, to quickly search any file
Diffstat (limited to 'drivers/dds/texture_loader_dds.cpp')
| -rw-r--r-- | drivers/dds/texture_loader_dds.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/dds/texture_loader_dds.cpp b/drivers/dds/texture_loader_dds.cpp index 8e6c3b62e..9b2e401fd 100644 --- a/drivers/dds/texture_loader_dds.cpp +++ b/drivers/dds/texture_loader_dds.cpp @@ -64,8 +64,10 @@ static const DDSFormatInfo dds_format_info[DDS_MAX]={ }; -RES ResourceFormatDDS::load(const String &p_path,const String& p_original_path) { +RES ResourceFormatDDS::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); @@ -73,6 +75,8 @@ RES ResourceFormatDDS::load(const String &p_path,const String& p_original_path) return RES(); FileAccessRef fref(f); + if (r_error) + *r_error=ERR_FILE_CORRUPT; ERR_EXPLAIN("Unable to open DDS texture file: "+p_path); ERR_FAIL_COND_V(err!=OK,RES()); @@ -427,6 +431,10 @@ RES ResourceFormatDDS::load(const String &p_path,const String& p_original_path) Ref<ImageTexture> texture = memnew( ImageTexture ); texture->create_from_image(img); + if (r_error) + *r_error=OK; + + return texture; } |
