From bedbae833a6624f476cc48ca808a3849880abf54 Mon Sep 17 00:00:00 2001 From: Relintai Date: Tue, 15 Feb 2022 18:55:08 +0100 Subject: [PATCH] Add load and save image overload. --- modules/image_png/png_loader.cpp | 7 +++++++ modules/image_png/png_loader.h | 3 +++ 2 files changed, 10 insertions(+) diff --git a/modules/image_png/png_loader.cpp b/modules/image_png/png_loader.cpp index 40618c1..76cac65 100644 --- a/modules/image_png/png_loader.cpp +++ b/modules/image_png/png_loader.cpp @@ -5,6 +5,13 @@ #include "core/os/directory.h" +Error PNGLoader::load_image(Ref p_image, const char *f, bool p_force_linear) { + return load_image(p_image, String(f), p_force_linear); +} +Error PNGLoader::save_image(const char *f, const Ref &p_img) { + return save_image(String(f), p_img); +} + // Taken from the Godot Engine (MIT License) // Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. // Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). diff --git a/modules/image_png/png_loader.h b/modules/image_png/png_loader.h index a85a937..eba7ca0 100644 --- a/modules/image_png/png_loader.h +++ b/modules/image_png/png_loader.h @@ -7,6 +7,9 @@ class PNGLoader { public: + static Error load_image(Ref p_image, const char* f, bool p_force_linear); + static Error save_image(const char* f, const Ref &p_img); + // Taken from the Godot Engine (MIT License) // Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. // Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md).