summaryrefslogtreecommitdiff
path: root/drivers/png/resource_saver_png.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-11-02 11:31:01 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-11-02 11:31:01 -0300
commitd85b67be53bac252c0a28b799d56d1b359c4ee99 (patch)
tree5227e145e3271bfee542bdd3e4237c3378565306 /drivers/png/resource_saver_png.cpp
parent738eb2c1a88d441eacc4149ce8f1c12a90267191 (diff)
Bug Fixes
-=-=-=-=- -Fixed problem with scaling shapes (#827), related to not taking scale in consideration for calculating the moment of inertia -Added support for multiline strings (or comments) using """ -Save subscene bug, properties not being saved in root node (#806) -Fix Crash in CollisionPolygon2DEditor (#814) -Restored Ability to compile without 3D (#795) -Fix InterpolatedCamera (#803) -Fix UV Import for OBJ Meshes (#771) -Fixed issue with modifier gizmos (#794) -Fixed CapsuleShape gizmo handle (#50) -Fixed Import Button (not properly working in 3D) (#733) -Many misc fixes (though no new features)
Diffstat (limited to 'drivers/png/resource_saver_png.cpp')
-rw-r--r--drivers/png/resource_saver_png.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/png/resource_saver_png.cpp b/drivers/png/resource_saver_png.cpp
index a898f6e618..9b394e8a8c 100644
--- a/drivers/png/resource_saver_png.cpp
+++ b/drivers/png/resource_saver_png.cpp
@@ -30,6 +30,7 @@
#include "scene/resources/texture.h"
#include "drivers/png/png.h"
#include "os/file_access.h"
+#include "globals.h"
static void _write_png_data(png_structp png_ptr,png_bytep data, png_size_t p_length) {
@@ -165,6 +166,42 @@ Error ResourceSaverPNG::save(const String &p_path,const RES& p_resource,uint32_t
memdelete(f);
+ if (true) {
+
+ bool global_filter = Globals::get_singleton()->get("image_loader/filter");
+ bool global_mipmaps = Globals::get_singleton()->get("image_loader/gen_mipmaps");
+ bool global_repeat = Globals::get_singleton()->get("image_loader/repeat");
+
+ String text;
+
+ if (global_filter!=bool(texture->get_flags()&Texture::FLAG_FILTER)) {
+ text+=bool(texture->get_flags()&Texture::FLAG_FILTER)?"filter=true\n":"filter=false\n";
+ }
+ if (global_mipmaps!=bool(texture->get_flags()&Texture::FLAG_MIPMAPS)) {
+ text+=bool(texture->get_flags()&Texture::FLAG_FILTER)?"gen_mipmaps=true\n":"gen_mipmaps=false\n";
+ }
+ if (global_repeat!=bool(texture->get_flags()&Texture::FLAG_REPEAT)) {
+ text+=bool(texture->get_flags()&Texture::FLAG_FILTER)?"repeat=true\n":"repeat=false\n";
+ }
+ if (bool(texture->get_flags()&Texture::FLAG_ANISOTROPIC_FILTER)) {
+ text+="anisotropic=true\n";
+ }
+ if (bool(texture->get_flags()&Texture::FLAG_CONVERT_TO_LINEAR)) {
+ text+="tolinear=true\n";
+ }
+
+ if (text!="" || FileAccess::exists(p_path+".flags")) {
+
+ f = FileAccess::open(p_path+".flags",FileAccess::WRITE);
+ if (f) {
+
+ f->store_string(text);
+ memdelete(f);
+ }
+ }
+ }
+
+
/* cleanup heap allocation */
return OK;