-
Notifications
You must be signed in to change notification settings - Fork 68
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
Fixes gcc wnarrowing spam (issue #38) #39
base: master
Are you sure you want to change the base?
Conversation
Sorry I didn't think about this earlier, but this library compiles slightly differently for SDL and SDL_gpu. SDL uses a rect structure that stores integers, while SDL_gpu uses one that stores floats. SDL_FontCache uses a #define to make FC_Rect match the rect used by the appropriate rendering system. The solution here should depend on which system is being used so the floating point precision is preserved for SDL_gpu instead of always truncating to int. |
This could be fixed by having:
And replacing all (int) casts with (FC_COORD) casts. Sound good for me to do this? |
Yep, I'm good with that. |
Updated. Also changed #include "SDL.h" to #include <SDL.h>. If you like I can change it back (and the turn around for said change should be faster. Sorry to keep you waiting mate!) |
Hey, no problem. I've got plenty to occupy me. :) I'd prefer it as "SDL.h" because it should be checking project-defined search directories before checking standard install locations. |
I've reverted the <> to "", and took a crack at #29 . I've added a "fallback" member to FC_Font, added "void FC_AddFallback(base_font, fallback_font)" which adds the fallback font to the end of the fallback font linked list, and added the font switching to SDL_FontCache.c:1617. The font switching does "work" - it does successfully load glyphs from other fonts, however the is-glyph-missing detection does not work, so its commented out, so that when a suitable fix is found it can be easily applied |
Adds a number of int casts to take out gcc -wnarrowing spam