Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converter 3 -> 4: ImageTexture's create_from_image is not converted, resulting in a silent bug #67319

Open
Tracked by #73960
Lippanon opened this issue Oct 12, 2022 · 1 comment

Comments

@Lippanon
Copy link

Godot version

v4.0.beta.custom_build [18d2035]

System information

Windows 10

Issue description

ImageTexture's create_from_image was changed to a static function that returns a result,. During a migration process from 3.x to 4.x there is no warning, comment or error for this, which means code such as:

# 3.x
var my_img :Image = Image.new()
var my_texture :ImageTexture = ImageTexture.new()
	
my_img.create_from_data(32, 32, false, Image.FORMAT_RGBA8, some_data)
my_texture.create_from_image(my_img) # This line should have changed in some way
$some_TextureRect.texture = my_texture

will not be changed in the conversion process and silently not work (in part because of #66100 )

A potential fix would be to alter the line indicated above to:

my_texture = my_texture.create_from_image(my_img) # Now it works

I'd like to take this opportunity to please request a list (or a way to check) of functions that are now static and/or have a return value that didn't in 3.x

Steps to reproduce

Code shown above.

Minimal reproduction project

No response

@Calinou
Copy link
Member

Calinou commented Oct 12, 2022

FileAccess' open() has a similar issue. Calling static functions on a non-static instance is valid, and I think making it print a warning by default could get in the way.

I think the best way to fix this is to make the converter add a comment on such lines, saying they can't be converted manually and explaining what should be done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To Assess
Development

No branches or pull requests

4 participants