[texture_rework] Fonts not initialized on time

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
Rachael
Posts: 13575
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

[texture_rework] Fonts not initialized on time

Post by Rachael »

Using Cronus Camp for Wayward Boys, GZDoom crashes immediately upon starting the first map.

I'm still investigating what causes the crash, but I know that the font translations are not yet available at the time of crash and it is trying to return a font translation that isn't there.
User avatar
Rachael
Posts: 13575
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: [texture_rework] Fonts not initialized on time

Post by Rachael »

I was able to do a band-aid fix with this:

Code: Select all

diff --git a/src/common/fonts/font.cpp b/src/common/fonts/font.cpp
index c8964accf..1854ed634 100644
--- a/src/common/fonts/font.cpp
+++ b/src/common/fonts/font.cpp
@@ -850,6 +850,8 @@ void FFont::BuildTranslations (const double *luminosity, const uint8_t *identity

 int FFont::GetColorTranslation (EColorRange range, PalEntry *color) const
 {
+       if (Translations.Size() == 0)
+               return -1;
        if (noTranslate)
        {
                PalEntry retcolor = PalEntry(255, 255, 255, 255);
But I am not sure if it is a proper fix. If you want though, I can commit that directly to the texture_rework branch.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49073
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [texture_rework] Fonts not initialized on time

Post by Graf Zahl »

That's not a proper fix.
The problem is the result of a change I made to the font code for Raze: It only can initialize the translations late so I had to take it out of the constructors. I thought I had handled all font creation functions but I must have overlooked one. The fix would be to call LoadTranslations explicitly for such a font.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49073
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [texture_rework] Fonts not initialized on time

Post by Graf Zahl »

Fixed. What I overlooked is that V_GetFont can be called during gameplay from ACS.
Post Reply

Return to “Closed Bugs [GZDoom]”