Removal of Image from Variant, converted to a Resource.
This commit is contained in:
@ -1996,13 +1996,14 @@ String OS_Windows::get_executable_path() const {
|
||||
return s;
|
||||
}
|
||||
|
||||
void OS_Windows::set_icon(const Image &p_icon) {
|
||||
void OS_Windows::set_icon(const Ref<Image> &p_icon) {
|
||||
|
||||
Image icon = p_icon;
|
||||
if (icon.get_format() != Image::FORMAT_RGBA8)
|
||||
icon.convert(Image::FORMAT_RGBA8);
|
||||
int w = icon.get_width();
|
||||
int h = icon.get_height();
|
||||
ERR_FAIL_COND(!p_icon.is_valid());
|
||||
Ref<Image> icon = p_icon->duplicate();
|
||||
if (icon->get_format() != Image::FORMAT_RGBA8)
|
||||
icon->convert(Image::FORMAT_RGBA8);
|
||||
int w = icon->get_width();
|
||||
int h = icon->get_height();
|
||||
|
||||
/* Create temporary bitmap buffer */
|
||||
int icon_len = 40 + h * w * 4;
|
||||
@ -2023,7 +2024,7 @@ void OS_Windows::set_icon(const Image &p_icon) {
|
||||
encode_uint32(0, &icon_bmp[36]);
|
||||
|
||||
uint8_t *wr = &icon_bmp[40];
|
||||
PoolVector<uint8_t>::Read r = icon.get_data().read();
|
||||
PoolVector<uint8_t>::Read r = icon->get_data().read();
|
||||
|
||||
for (int i = 0; i < h; i++) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user