backend update from GZDoom.

This commit is contained in:
Christoph Oelckers 2023-12-10 13:30:50 +01:00
parent 80fe0788c9
commit c0d166c307
74 changed files with 1496 additions and 392 deletions

View file

@ -56,6 +56,7 @@
#include "texturemanager.h"
#include "base64.h"
#include "vm.h"
#include "i_interface.h"
using namespace FileSys;
@ -1207,7 +1208,14 @@ FSerializer& Serialize(FSerializer& arc, const char* key, FTranslationID& value,
int v = value.index();
int* defv = (int*)defval;
Serialize(arc, key, v, defv);
value = FTranslationID::fromInt(v);
if (arc.isReading())
{
// allow games to alter the loaded value to handle dynamic lists.
if (sysCallbacks.RemapTranslation) value = sysCallbacks.RemapTranslation(FTranslationID::fromInt(v));
else value = FTranslationID::fromInt(v);
}
return arc;
}
@ -1749,6 +1757,19 @@ void SerializeFunctionPointer(FSerializer &arc, const char *key, FunctionPointer
}
}
bool FSerializer::ReadOptionalInt(const char * key, int &into)
{
if(!isReading()) return false;
auto val = r->FindKey(key);
if(val && val->IsInt())
{
into = val->GetInt();
return true;
}
return false;
}
#include "renderstyle.h"
FSerializer& Serialize(FSerializer& arc, const char* key, FRenderStyle& style, FRenderStyle* def)
{