Merge branch 'master' into floatcvt

This commit is contained in:
Christoph Oelckers 2016-04-04 12:25:36 +02:00
commit 123d503492
3 changed files with 7 additions and 12 deletions

View File

@ -289,8 +289,8 @@ unsigned char *gl_CreateUpsampledTextureBuffer ( const FTexture *inputTexture, u
outWidth = inWidth;
outHeight = inHeight;
#ifdef HAVE_MMX
// ASM-hqNx does not preserve the alpha channel so fall back to C-version for such textures
if (!hasAlpha && type > 6 && type <= 9)
// hqNx MMX does not preserve the alpha channel so fall back to C-version for such textures
if (hasAlpha && type > 6 && type <= 9)
{
type -= 3;
}

View File

@ -4558,7 +4558,7 @@ bool GetVarAddrType(AActor *self, FName varname, int index, void *&addr, PType *
addr = baddr;
// We don't want Int subclasses like Name or Color to be accessible,
// but we do want to support Float subclasses like Fixed.
if (!type->IsA(RUNTIME_CLASS(PInt)) || !type->IsKindOf(RUNTIME_CLASS(PFloat)))
if (!type->IsA(RUNTIME_CLASS(PInt)) && !type->IsKindOf(RUNTIME_CLASS(PFloat)))
{
// For reading, we also support Name and String types.
if (readonly && (type->IsA(RUNTIME_CLASS(PName)) || type->IsA(RUNTIME_CLASS(PString))))

View File

@ -525,17 +525,12 @@ static void ParseUserVariable (FScanner &sc, PSymbolTable *symt, PClassActor *cl
// Read the type and make sure it's acceptable.
sc.MustGetAnyToken();
switch (sc.TokenType)
if (sc.TokenType != TK_Int && sc.TokenType != TK_Float)
{
case TK_Int: type = TypeSInt32; break;
case TK_Float: type = TypeFloat64; break;
case TK_String: type = TypeString; break;
default:
type = TypeError;
sc.ScriptMessage("User variables must be of type 'int' or 'float' or 'string'");
sc.ScriptMessage("User variables must be of type 'int' or 'float'");
FScriptPosition::ErrorCounter++;
break;
}
type = sc.TokenType == TK_Int ? (PType *)TypeSInt32 : (PType *)TypeFloat64;
sc.MustGetToken(TK_Identifier);
// For now, restrict user variables to those that begin with "user_" to guarantee
@ -582,7 +577,7 @@ static void ParseUserVariable (FScanner &sc, PSymbolTable *symt, PClassActor *cl
sc.MustGetToken(';');
PField *sym = cls->AddField(symname, type, 0);
if (cls == NULL)
if (sym == NULL)
{
sc.ScriptMessage ("'%s' is already defined in '%s'.",
symname.GetChars(), cls ? cls->TypeName.GetChars() : "Global");