From 17972b5d06213f48a1b5bd57c11ebf8831631738 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sun, 3 Apr 2016 19:15:00 -0500 Subject: [PATCH 1/4] Revert "Add "support" for user string variables in DECORATE" - This reverts commit c90a1c0c9627d2cb4d5ad105ae7020582c8b2cab. - DECORATE looks to be very dependant on functions that take strings as parameters receiving those strings as constants and not as expressions, so being able to declare string variables with DECORATE is pretty much useless. --- src/thingdef/thingdef_parse.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/thingdef/thingdef_parse.cpp b/src/thingdef/thingdef_parse.cpp index bf929128b3..f5359a7d85 100644 --- a/src/thingdef/thingdef_parse.cpp +++ b/src/thingdef/thingdef_parse.cpp @@ -533,17 +533,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 From 77f9643c8ff167fe738ba4111e985aa664738582 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sun, 3 Apr 2016 20:25:07 -0500 Subject: [PATCH 2/4] How did this end up wrong? --- src/thingdef/thingdef_parse.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/thingdef/thingdef_parse.cpp b/src/thingdef/thingdef_parse.cpp index f5359a7d85..70f2c050dd 100644 --- a/src/thingdef/thingdef_parse.cpp +++ b/src/thingdef/thingdef_parse.cpp @@ -585,7 +585,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"); From 7de8c2b5eb0fc9c62a008f475efa325f67d4cbdb Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sun, 3 Apr 2016 21:35:44 -0500 Subject: [PATCH 3/4] Fixed: || should be && --- src/p_acs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 1436836020..2668fd4a1a 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -4559,7 +4559,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)))) From cbcde3a950abf62d2989063034506ab020b9e00b Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 4 Apr 2016 12:10:26 +0300 Subject: [PATCH 4/4] Fixed check for alpha channel in texture to select hqNx upscaling mode Now it's the initial check with the adjustment in mode indices only, as old hqNx MMX indices (4..6) are now occupied by generic hqNx implementation See http://forum.drdteam.org/viewtopic.php?t=6872 --- src/gl/textures/gl_hqresize.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gl/textures/gl_hqresize.cpp b/src/gl/textures/gl_hqresize.cpp index 1563895b54..2118352b76 100644 --- a/src/gl/textures/gl_hqresize.cpp +++ b/src/gl/textures/gl_hqresize.cpp @@ -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; }