[Export] Use image loader directly to avoid "resource as image file" errors.
(cherry picked from commit 908bef8eee
)
This commit is contained in:
parent
d08e057194
commit
84904da07a
2 changed files with 6 additions and 5 deletions
|
@ -947,7 +947,7 @@ Error EditorExportPlatformIOS::_export_loading_screen_file(const Ref<EditorExpor
|
|||
Ref<Image> image;
|
||||
String image_path = p_dest_dir.plus_file("splash@2x.png");
|
||||
image.instance();
|
||||
Error err = image->load(custom_launch_image_2x);
|
||||
Error err = ImageLoader::load_image(custom_launch_image_2x, image);
|
||||
|
||||
if (err) {
|
||||
image.unref();
|
||||
|
@ -961,7 +961,7 @@ Error EditorExportPlatformIOS::_export_loading_screen_file(const Ref<EditorExpor
|
|||
image.unref();
|
||||
image_path = p_dest_dir.plus_file("splash@3x.png");
|
||||
image.instance();
|
||||
err = image->load(custom_launch_image_3x);
|
||||
err = ImageLoader::load_image(custom_launch_image_3x, image);
|
||||
|
||||
if (err) {
|
||||
image.unref();
|
||||
|
@ -978,7 +978,7 @@ Error EditorExportPlatformIOS::_export_loading_screen_file(const Ref<EditorExpor
|
|||
|
||||
if (!splash_path.empty()) {
|
||||
splash.instance();
|
||||
const Error err = splash->load(splash_path);
|
||||
const Error err = ImageLoader::load_image(splash_path, splash);
|
||||
if (err) {
|
||||
splash.unref();
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "export.h"
|
||||
#include "codesign.h"
|
||||
|
||||
#include "core/io/image_loader.h"
|
||||
#include "core/io/marshalls.h"
|
||||
#include "core/io/resource_saver.h"
|
||||
#include "core/io/zip_io.h"
|
||||
|
@ -1180,8 +1181,8 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
|
|||
} else {
|
||||
Ref<Image> icon;
|
||||
icon.instance();
|
||||
icon->load(iconpath);
|
||||
if (!icon->empty()) {
|
||||
err = ImageLoader::load_image(iconpath, icon);
|
||||
if (err == OK && !icon->empty()) {
|
||||
_make_icon(p_preset, icon, data);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue