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.
Attempt to save pointer to unhandled type NativeStruct<Font>
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.
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.
-
- Posts: 3886
- Joined: Fri Feb 08, 2008 9:15 am
- Preferred Pronouns: She/Her
- Operating System Version (Optional): (btw I use) Arch
- Graphics Processor: nVidia with Vulkan support
- Location: Vigo, Galicia
-
- Posts: 469
- Joined: Sat Apr 16, 2016 6:01 am
- Preferred Pronouns: She/Her
Re: Attempt to save pointer to unhandled type NativeStruct<F
Appears to just be a typo in InitImports.
The ZScript type is called Font so the first line should contain "Font" rather than "FFont".
Code: Select all
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;
}
);
-
- Posts: 3886
- Joined: Fri Feb 08, 2008 9:15 am
- Preferred Pronouns: She/Her
- Operating System Version (Optional): (btw I use) Arch
- Graphics Processor: nVidia with Vulkan support
- Location: Vigo, Galicia
Re: Attempt to save pointer to unhandled type NativeStruct<F
Good lord, what just one tiny single-character typo can do...
-
- Lead GZDoom+Raze Developer
- Posts: 49182
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Attempt to save pointer to unhandled type NativeStruct<F
I'm a bit puzzled why this didn't trigger earlier...
-
- Posts: 3886
- Joined: Fri Feb 08, 2008 9:15 am
- Preferred Pronouns: She/Her
- Operating System Version (Optional): (btw I use) Arch
- Graphics Processor: nVidia with Vulkan support
- Location: Vigo, Galicia
Re: Attempt to save pointer to unhandled type NativeStruct<F
I think I can take most of the blame for that, in assuming this was intentional for so many years.