-
Notifications
You must be signed in to change notification settings - Fork 439
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
Stricter checks for FlxG.bitmap.maxTextureSize #3279
Conversation
Can we add a new define to FlxDefines.HelperDefines, instead? like |
I was thinking about that too, would make things a lot cleaner to manage. Also, would it be better to use |
I know -1 isn't a great solution, but I rarely think Null is much better, compared to say, enums. either way, lets stick with -1 rather than introducing a potentially breaking change I'll test this PR soon |
Is it a breaking change if right now trying to access |
Also, I was thinking of adding a check in |
go for it |
if (max != -1) | ||
{ | ||
if (width > max || height > max) | ||
FlxG.log.warn('Graphic dimensions (${width}x${height}) exceed the maximum allowed size (${max}x${max}), which may cause rendering issues.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What kind of rendering issues will happen? I'm debating whether this should be an error or not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my understanding OpenGL won't upload the texture to the GPU at all and any attempts to render the texture will be replaced with a fallback texture (usually just black or whatever), probably should be an error yeah
Idk why CI failed |
The CI failure seems unrelated, I usually just rerun them |
The remaining CI failures DO seem related. I'll have to try unit tests locally. For now I'll rerun the jobs, again, just in case it's nothing |
@@ -254,7 +254,9 @@ class FlxDefines | |||
define(FLX_TRACK_GRAPHICS); | |||
|
|||
#if (lime_opengl || lime_opengles || lime_webgl) | |||
define(FLX_OPENGL_AVAILABLE); | |||
// FlxG.stage.window.context.attributes.hardware is not always defined during unit tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to check if FlxG.stage.window.context.attributes.hardware
(or whatever part of it that fails) is defined rather than outright skipping it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so. If it's not defined in any other context I want it to fail loudly, and I don't think we can really unit test gl stuff right now
Thanks! |
Checks if any of the Lime OpenGL defines are defined & also checks if
FlxG.stage.window
is hardware accelerated