diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2018-09-30 17:21:07 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2018-09-30 21:31:16 +0200 |
commit | fc8b73a9351063b5bc1af66b257bac0cac2deff4 (patch) | |
tree | b48da37257481b1bd9c6f527ab6e996637faeab1 /main/main.cpp | |
parent | d3f01a22817a76fbb73d4021090cddee695b7b09 (diff) |
Main: Use ImageLoader directly instead of Image::load
Image::load is now issuing warnings (since ef50957) to prevent users
from using it to load images at runtime which would be included in
their exported game.
So we now use ImageLoader explicitly instead for the custom-handled
cases in Main.
Fixes #21072, supersedes #22321.
Diffstat (limited to 'main/main.cpp')
-rw-r--r-- | main/main.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/main/main.cpp b/main/main.cpp index 5320d73c7f..3eb0b7f354 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -34,6 +34,7 @@ #include "core/io/file_access_network.h" #include "core/io/file_access_pack.h" #include "core/io/file_access_zip.h" +#include "core/io/image_loader.h" #include "core/io/ip.h" #include "core/io/resource_loader.h" #include "core/io/stream_peer_ssl.h" @@ -1124,9 +1125,8 @@ Error Main::setup2(Thread::ID p_main_tid_override) { boot_logo_path = boot_logo_path.strip_edges(); if (boot_logo_path != String()) { - print_line("Boot splash path: " + boot_logo_path); boot_logo.instance(); - Error err = boot_logo->load(boot_logo_path); + Error err = ImageLoader::load_image(boot_logo_path, boot_logo); if (err) ERR_PRINTS("Non-existing or invalid boot splash at: " + boot_logo_path + ". Loading default splash."); } @@ -1707,7 +1707,7 @@ bool Main::start() { if (iconpath != "") { Ref<Image> icon; icon.instance(); - if (icon->load(iconpath) == OK) { + if (ImageLoader::load_image(iconpath, icon) == OK) { OS::get_singleton()->set_icon(icon); hasicon = true; } |