diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-05-17 07:36:47 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-05-17 07:37:45 -0300 |
commit | 98a329670227c726a5d7a196e5cba8dbdd54301b (patch) | |
tree | 7346f7a3e38eb35b784ac1a68a227d07cc8881b4 /platform/x11 | |
parent | d801ff2b3db2de105c1b36a74ce116e360143d4e (diff) |
Removal of Image from Variant, converted to a Resource.
Diffstat (limited to 'platform/x11')
-rw-r--r-- | platform/x11/export/export.cpp | 2 | ||||
-rw-r--r-- | platform/x11/os_x11.cpp | 14 | ||||
-rw-r--r-- | platform/x11/os_x11.h | 2 |
3 files changed, 9 insertions, 9 deletions
diff --git a/platform/x11/export/export.cpp b/platform/x11/export/export.cpp index b9ded188bf..d6bad95e5b 100644 --- a/platform/x11/export/export.cpp +++ b/platform/x11/export/export.cpp @@ -37,7 +37,7 @@ void register_x11_exporter() { Ref<EditorExportPlatformPC> platform; platform.instance(); - Image img(_x11_logo); + Ref<Image> img = memnew(Image(_x11_logo)); Ref<ImageTexture> logo; logo.instance(); logo->create_from_image(img); diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 2e2fe3ba8a..59ac1fed96 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -1857,15 +1857,15 @@ void OS_X11::alert(const String &p_alert, const String &p_title) { execute("/usr/bin/xmessage", args, true); } -void OS_X11::set_icon(const Image &p_icon) { +void OS_X11::set_icon(const Ref<Image> &p_icon) { Atom net_wm_icon = XInternAtom(x11_display, "_NET_WM_ICON", False); - if (!p_icon.empty()) { - Image img = p_icon; - img.convert(Image::FORMAT_RGBA8); + if (p_icon.is_valid()) { + Ref<Image> img = p_icon->duplicate(); + img->convert(Image::FORMAT_RGBA8); - int w = img.get_width(); - int h = img.get_height(); + int w = img->get_width(); + int h = img->get_height(); // We're using long to have wordsize (32Bit build -> 32 Bits, 64 Bit build -> 64 Bits Vector<long> pd; @@ -1875,7 +1875,7 @@ void OS_X11::set_icon(const Image &p_icon) { pd[0] = w; pd[1] = h; - PoolVector<uint8_t>::Read r = img.get_data().read(); + PoolVector<uint8_t>::Read r = img->get_data().read(); long *wr = &pd[2]; uint8_t const *pr = r.ptr(); diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h index 44994e40ec..7f01f9c617 100644 --- a/platform/x11/os_x11.h +++ b/platform/x11/os_x11.h @@ -206,7 +206,7 @@ public: virtual int get_mouse_button_state() const; virtual void set_window_title(const String &p_title); - virtual void set_icon(const Image &p_icon); + virtual void set_icon(const Ref<Image> &p_icon); virtual MainLoop *get_main_loop() const; |