-
Notifications
You must be signed in to change notification settings - Fork 584
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 nk_font_bake_convert() for big-endian machines #758
base: master
Are you sure you want to change the base?
Conversation
*dst++ = 0xff; // r | ||
*dst++ = 0xff; // g | ||
*dst++ = 0xff; // b | ||
*dst++ = *src++; // a |
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.
Need to have /* comments for C89.
Also, does this still work on non-big endian devices? The RGB bit order should be fine, but I am unclear.
@@ -17230,7 +17230,7 @@ nk_font_bake_convert(void *out_memory, int img_width, int img_height, | |||
const void *in_memory) | |||
{ | |||
int n = 0; | |||
nk_rune *dst; | |||
nk_byte *dst; |
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.
Thanks a lot for the update. Would you mind making this change in the src destroy? We use paq.sh to combine the files, so wouldn't want to lose your changes.
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.
Thanks, I will do the needed changes today or tomorrow and I'll ping you back.
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 tested the changes on a little endian machine, the conversion still works.
I added the changes to the src directory as well; should I remove them from nuklear.h
, or is it OK like it is now?
Fix the byte order for converting alpha images into RGBA by writing the destination byte-by-byte. The compiler should anyway be able to optimize this.
Fix the byte order for converting alpha images into RGBA by writing the destination byte-by-byte. The compiler should anyway be able to optimize this.