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

FlxColor.fromString problem - in cpp builds FlxColor.fromString/Std.parseInt can't deal with AARRGGBB values #3138

Open
increpare opened this issue May 15, 2024 · 2 comments

Comments

@increpare
Copy link

(warning: somewhat low-quality bug report - I figure it's better to point it out than to not say anything at all)

I'm on windows with haxe 4.3.4

result = new FlxColor(Std.parseInt(hexColor));

0xff112233 has the value 4279312947, but evaluating
trace(Std.parseInt("0xff112233"));

we get I think the error code 2147483647 (0x7FFFFFFF)

(in a html5 build it works for me and gives 4279312947)

cf HaxeFoundation/haxe#6759

I was able to work around it pretty easily in my use-case by dropping A values. I'm using a very out-of-date version of flixel right now (4.8.1), but for instance FlxColor.fromString("0xff112233").toHexString() evaluates to 0x7FFFFFFF in the cpp build. It doesn't seem the function has changed much since then.

@Geokureli
Copy link
Member

Geokureli commented May 15, 2024

I'll see if I can reproduce this on my mac, if not I have a windows pc I can try. there may be a workaround flixel can use but I wonder if haxe std should have a parseUInt or something

The issue you link seems different, though. 1. it compares android and linux, 2. it works fine on hex strings, just not on decimal.

Edit: I can't reproduce this issue on Mac with haxe 4.3.3. I'll report back after more testing

@Geokureli
Copy link
Member

Geokureli commented Jun 10, 2024

this seems related: HaxeFoundation/hxcpp#1053
are you using hxcpp v 4.3.2? I believe this may be fixed in the next version. I don't see this on mac with haxe 4.3.4 and hxcpp 4.3.2, but other people are seeing it on windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants