diff options
-rw-r--r-- | drivers/png/resource_saver_png.cpp | 3 | ||||
-rw-r--r-- | scene/io/resource_format_image.cpp | 5 | ||||
-rw-r--r-- | scene/resources/texture.h | 2 |
3 files changed, 9 insertions, 1 deletions
diff --git a/drivers/png/resource_saver_png.cpp b/drivers/png/resource_saver_png.cpp index 8524aa2121..76e0c03c46 100644 --- a/drivers/png/resource_saver_png.cpp +++ b/drivers/png/resource_saver_png.cpp @@ -75,6 +75,9 @@ Error ResourceSaverPNG::save(const String &p_path,const RES& p_resource,uint32_t if (bool(texture->get_flags()&Texture::FLAG_CONVERT_TO_LINEAR)) { text+="tolinear=true\n"; } + if (bool(texture->get_flags()&Texture::FLAG_MIRRORED_REPEAT)) { + text+="mirroredrepeat=true\n"; + } if (text!="" || FileAccess::exists(p_path+".flags")) { diff --git a/scene/io/resource_format_image.cpp b/scene/io/resource_format_image.cpp index 2663ac0762..8527498fc2 100644 --- a/scene/io/resource_format_image.cpp +++ b/scene/io/resource_format_image.cpp @@ -180,6 +180,11 @@ RES ResourceFormatLoaderImage::load(const String &p_path,const String& p_origina if (flags_found["tolinear"]) flags|=Texture::FLAG_CONVERT_TO_LINEAR; } + + if (flags_found.has("mirroredrepeat")) { + if (flags_found["mirroredrepeat"]) + flags|=Texture::FLAG_MIRRORED_REPEAT; + } if (debug_load_times) begtime=OS::get_singleton()->get_ticks_usec(); diff --git a/scene/resources/texture.h b/scene/resources/texture.h index cd0e16a12a..ad0e21093d 100644 --- a/scene/resources/texture.h +++ b/scene/resources/texture.h @@ -51,12 +51,12 @@ public: enum Flags { FLAG_MIPMAPS=VisualServer::TEXTURE_FLAG_MIPMAPS, FLAG_REPEAT=VisualServer::TEXTURE_FLAG_REPEAT, - FLAG_MIRRORED_REPEAT=VisualServer::TEXTURE_FLAG_MIRRORED_REPEAT, FLAG_FILTER=VisualServer::TEXTURE_FLAG_FILTER, FLAG_ANISOTROPIC_FILTER=VisualServer::TEXTURE_FLAG_ANISOTROPIC_FILTER, FLAG_CONVERT_TO_LINEAR=VisualServer::TEXTURE_FLAG_CONVERT_TO_LINEAR, FLAG_VIDEO_SURFACE=VisualServer::TEXTURE_FLAG_VIDEO_SURFACE, FLAGS_DEFAULT=FLAG_MIPMAPS|FLAG_REPEAT|FLAG_FILTER, + FLAG_MIRRORED_REPEAT=VisualServer::TEXTURE_FLAG_MIRRORED_REPEAT }; |