Merge branch 'master' of https://github.com/ZDoom/gzdoom into gzdoom-update-4-12-1

This commit is contained in:
Rachael Alexanderson 2024-04-21 11:05:59 -04:00
commit 112c6cbccf
No known key found for this signature in database
GPG key ID: 26A8ACCE97115EE0
90 changed files with 1227 additions and 834 deletions

View file

@ -12564,7 +12564,14 @@ FxExpression *FxLocalVariableDeclaration::Resolve(FCompileContext &ctx)
{
if (Init->IsStruct())
{
ValueType = NewPointer(ValueType);
bool writable = true;
if(ctx.Version >= MakeVersion(4, 12, 0))
{
Init->RequestAddress(ctx, &writable);
}
ValueType = NewPointer(ValueType, !writable);
Init = new FxTypeCast(Init, ValueType, false);
SAFE_RESOLVE(Init, ctx);
}

View file

@ -282,9 +282,9 @@ DEFINE_ACTION_FUNCTION(FStringStruct, DeleteLastCharacter)
static void LocalizeString(const FString &label, bool prefixed, FString *result)
{
if (!prefixed) *result = GStrings(label);
if (!prefixed) *result = GStrings.GetString(label);
else if (label[0] != '$') *result = label;
else *result = GStrings(&label[1]);
else *result = GStrings.GetString(&label[1]);
}
DEFINE_ACTION_FUNCTION_NATIVE(FStringTable, Localize, LocalizeString)

View file

@ -670,7 +670,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(FFont, GetBottomAlignOffset, GetBottomAlignOffset)
static int StringWidth(FFont *font, const FString &str, int localize)
{
const char *txt = (localize && str[0] == '$') ? GStrings(&str[1]) : str.GetChars();
const char *txt = (localize && str[0] == '$') ? GStrings.GetString(&str[1]) : str.GetChars();
return font->StringWidth(txt);
}
@ -684,7 +684,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(FFont, StringWidth, StringWidth)
static int GetMaxAscender(FFont* font, const FString& str, int localize)
{
const char* txt = (localize && str[0] == '$') ? GStrings(&str[1]) : str.GetChars();
const char* txt = (localize && str[0] == '$') ? GStrings.GetString(&str[1]) : str.GetChars();
return font->GetMaxAscender(txt);
}
@ -698,7 +698,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(FFont, GetMaxAscender, GetMaxAscender)
static int CanPrint(FFont *font, const FString &str, int localize)
{
const char *txt = (localize && str[0] == '$') ? GStrings(&str[1]) : str.GetChars();
const char *txt = (localize && str[0] == '$') ? GStrings.GetString(&str[1]) : str.GetChars();
return font->CanPrint(txt);
}