-
-
Notifications
You must be signed in to change notification settings - Fork 493
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
Fix WASM font signature #1971
Fix WASM font signature #1971
Conversation
The issue with D seems to have just been an issue with function signatures, specifically a missing Zig, on the other hand, has a lot of weirdness going on. I worked out that it definitely doesn't build with Zig 0.9.1, only the master branch for now. Even after managing to get a build of that working on my system, the demo seems to be written for the raw API, and the user-friendly API seems to have some syntax errors. For now, I think the updated |
@@ -63,12 +63,12 @@ void exit(); | |||
void elli(int x, int y, int a, int b, int color); | |||
void ellib(int x, int y, int a, int b, int color); | |||
bool fget(int id, ubyte flag); | |||
int font(char* text, int x, int y, ubyte transcolors, int colorcount, int width, int height, bool fixed, int scale); | |||
int font(const char* text, int x, int y, uint* transcolors, int colorcount, int width, int height, bool fixed, int scale, bool alt); |
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.
Are you SURE this is const char*? Is there a reason non-const values can't be used?
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.
Not really to be honest, I've never really done much with D. I added const
because 1. that's what print
and trace
use and 2. it made my test compile.
I think const
here just means the function won't be able to change the value, not that a constant value has to be passed.
I found another instance where the WASM function signature was incorrect. The line in
linkTicAPI
had only 8 arguments forfont
, the Zig and D bindings had 9, and thewasmtic_font
implementation itself had 10. I've updated everything so that all 10 arguments are exposed everywhere. This shouldn't break existing binary compatibility, as the templates would already have been producing incompatible binaries when thefont
function was used.I haven't been able to test either version fully, because I can't work out how to get the Zig template to compile at all, and the D template seems to still have a slightly incorrect function signature for
font
. Because of that, I'll leave this as a draft for now while I look into the issues further.