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

[SP] Font fixes #1227

Merged
merged 3 commits into from
Apr 7, 2024
Merged

[SP] Font fixes #1227

merged 3 commits into from
Apr 7, 2024

Conversation

Daggolin
Copy link
Contributor

@Daggolin Daggolin commented Apr 7, 2024

This pull request fixes 2 bugs in SP:

Additionally it adjusts MenuFontToReal in the ui module to be more flexible in case of menu files that don't actually load the default fonts.

… font mapping with a dynamic list of up to 64 fonts.

This might help with possible corner cases where custom assets have the menu loads differents fonts in place of the vanilla ones. The maximum of 64 fonts was chosen, because I wanted to avoid dynamic allocation. As the vanilla game only loads 5 different fonts and as I am not aware of custom mods that add a lot more I chose the value 64 to hopefully leave enough room for mods.

The same change can NOT be applied to CG_MagicFontToReal, because the cgame module does not parse the menu files and does not know the order of fonts in menu files.
…ariant fonts.

This fixes r_reloadfonts in SP.
@Daggolin Daggolin requested a review from a team as a code owner April 7, 2024 00:39
Copy link
Member

@Razish Razish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What a mess that font code is, thanks for dealing with it.

@Daggolin
Copy link
Contributor Author

Daggolin commented Apr 7, 2024

What a mess that font code is, thanks for dealing with it.

Well, I was the one who ported the JK2MV font variant code to OpenJK and thought: for consistency I should add it to MP and SP. So I am the one who stepped into that trap of horrible SP font handling. Had I realized there is even magic numbers in the cgame module of SP I might have left out the SP support to avoid corner cases like this and just put a warning comment into the pull request. Now I am trying to fix what I broke.

@Daggolin Daggolin merged commit 2815211 into JACoders:master Apr 7, 2024
16 checks passed
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

Successfully merging this pull request may close these issues.

3 participants