[Fixed] Attempt to save pointer to unhandled type NativeStruct<Font>

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.

Attempt to save pointer to unhandled type NativeStruct<Font>

Postby Marisa the Magician » Thu Apr 07, 2022 4:48 am

Reproduction: Load this mod, start a game, and use changemap to change to any other map. The game will fail to save with the message in the thread title.

I was told that font pointers were serializable, but apparently they aren't. I've been lied to, I want an explanation for this.
User avatar
Marisa the Magician
ZScript Crimester
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa the Magician#1666
Twitch ID: MarisaDOOM
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Attempt to save pointer to unhandled type NativeStruct<F

Postby Gutawer » Thu Apr 07, 2022 5:00 am

Appears to just be a typo in InitImports.
Code: Select allExpand view
   auto fontstruct = NewStruct("FFont", nullptr, true);
   fontstruct->Size = sizeof(FFont);
   fontstruct->Align = alignof(FFont);
   NewPointer(fontstruct, false)->InstallHandlers(
      [](FSerializer &ar, const char *key, const void *addr)
      {
         ar(key, *(FFont **)addr);
      },
         [](FSerializer &ar, const char *key, void *addr)
      {
         Serialize<FFont>(ar, key, *(FFont **)addr, nullptr);
         return true;
      }
   );

The ZScript type is called Font so the first line should contain "Font" rather than "FFont".
User avatar
Gutawer
User Accounts Assistant
 
Joined: 16 Apr 2016
Discord: Gutawer#3431

Re: Attempt to save pointer to unhandled type NativeStruct<F

Postby Marisa the Magician » Thu Apr 07, 2022 5:17 am

Good lord, what just one tiny single-character typo can do...
User avatar
Marisa the Magician
ZScript Crimester
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa the Magician#1666
Twitch ID: MarisaDOOM
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Attempt to save pointer to unhandled type NativeStruct<F

Postby Graf Zahl » Thu Apr 07, 2022 7:12 am

I'm a bit puzzled why this didn't trigger earlier...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Attempt to save pointer to unhandled type NativeStruct<F

Postby Marisa the Magician » Thu Apr 07, 2022 7:15 am

I think I can take most of the blame for that, in assuming this was intentional for so many years.
User avatar
Marisa the Magician
ZScript Crimester
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa the Magician#1666
Twitch ID: MarisaDOOM
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 0 guests