[Fixed] [texture_rework] Fonts not initialized on time

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

[texture_rework] Fonts not initialized on time

Postby Rachael » Tue May 12, 2020 12:48 am

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
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: [texture_rework] Fonts not initialized on time

Postby Rachael » Tue May 12, 2020 1:54 am

I was able to do a band-aid fix with this:
Code: Select allExpand view
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
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: [texture_rework] Fonts not initialized on time

Postby Graf Zahl » Tue May 12, 2020 4:23 am

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
 
Joined: 19 Jul 2003
Location: Germany

Re: [texture_rework] Fonts not initialized on time

Postby Graf Zahl » Mon May 25, 2020 11:44 am

Fixed. What I overlooked is that V_GetFont can be called during gameplay from ACS.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 0 guests