From a27ab73f3352c1c5eddd21d8a55d35d175c9402b Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Wed, 5 Apr 2017 13:43:49 +0300 Subject: [PATCH 1/5] Fixed broken dialogue customization in USDF parser https://mantis.zdoom.org/view.php?id=539 --- src/p_usdf.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/p_usdf.cpp b/src/p_usdf.cpp index 3d2c2e010..015dd9793 100644 --- a/src/p_usdf.cpp +++ b/src/p_usdf.cpp @@ -72,8 +72,13 @@ class USDFParser : public UDMFParserBase } type = cls; } - if (type && type->IsDescendantOf(RUNTIME_CLASS(AInventory))) return type; - return nullptr; + return type; + } + + PClassActor *CheckInventoryActorType(const char *key) + { + PClassActor* const type = CheckActorType(key); + return nullptr != type && type->IsDescendantOf(RUNTIME_CLASS(AInventory)) ? type : nullptr; } //=========================================================================== @@ -94,7 +99,7 @@ class USDFParser : public UDMFParserBase switch(key) { case NAME_Item: - check.Item = CheckActorType(key); + check.Item = CheckInventoryActorType(key); break; case NAME_Amount: @@ -273,7 +278,7 @@ class USDFParser : public UDMFParserBase switch(key) { case NAME_Item: - check.Item = CheckActorType(key); + check.Item = CheckInventoryActorType(key); break; case NAME_Count: From 1312e9fb72554b9e8a527447c2d9e7c2e47803bf Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Wed, 5 Apr 2017 22:36:57 +0200 Subject: [PATCH 2/5] - fix linker error on platforms with no SSE support --- src/polyrenderer/drawers/screen_triangle.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/polyrenderer/drawers/screen_triangle.cpp b/src/polyrenderer/drawers/screen_triangle.cpp index 8c5723d8b..8547335ed 100644 --- a/src/polyrenderer/drawers/screen_triangle.cpp +++ b/src/polyrenderer/drawers/screen_triangle.cpp @@ -1019,6 +1019,6 @@ void(*ScreenTriangle::RectDrawers32[])(const void *, int, int, int, const RectDr &RectScreenDrawer32::Execute // Fuzz }; -int ScreenTriangle::FuzzStart = 0; - #endif + +int ScreenTriangle::FuzzStart = 0; From ac5e51614808fb21db462be2c49c85812679e33c Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Thu, 6 Apr 2017 10:39:53 +0300 Subject: [PATCH 3/5] Removed obsolete forward declaration --- src/textures/textures.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/textures/textures.h b/src/textures/textures.h index bdfb7d2de..cc3f2b588 100644 --- a/src/textures/textures.h +++ b/src/textures/textures.h @@ -30,7 +30,6 @@ class FBitmap; struct FRemapTable; struct FCopyInfo; class FScanner; -class PClassInventory; // Texture IDs class FTextureManager; From 26e4b7426108f85a20c3124315f00852a2dfc06e Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Thu, 6 Apr 2017 10:46:49 +0300 Subject: [PATCH 4/5] Restored initial behavior of CVar.FindCVar() https://mantis.zdoom.org/view.php?id=537 --- src/c_cvars.cpp | 3 +-- wadsrc/static/zscript/base.txt | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/c_cvars.cpp b/src/c_cvars.cpp index 95da13374..5b33cc263 100644 --- a/src/c_cvars.cpp +++ b/src/c_cvars.cpp @@ -1541,8 +1541,7 @@ DEFINE_ACTION_FUNCTION(_CVar, FindCVar) { PARAM_PROLOGUE; PARAM_NAME(name); - PARAM_POINTER_DEF(plyr, player_t); - ACTION_RETURN_POINTER(GetCVar(plyr ? plyr->mo : nullptr, name)); + ACTION_RETURN_POINTER(FindCVar(name, nullptr)); } FBaseCVar *FindCVarSub (const char *var_name, int namelen) diff --git a/wadsrc/static/zscript/base.txt b/wadsrc/static/zscript/base.txt index 77d6fa26b..c62620b14 100644 --- a/wadsrc/static/zscript/base.txt +++ b/wadsrc/static/zscript/base.txt @@ -286,7 +286,7 @@ struct CVar native CVAR_Color, }; - native static CVar FindCVar(Name name, PlayerInfo player = null); + native static CVar FindCVar(Name name); native int GetInt(); native double GetFloat(); native String GetString(); From ca4888eb3d6e305eaded52c53e73a113930fca9b Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Thu, 6 Apr 2017 10:51:36 +0300 Subject: [PATCH 5/5] Added CVar.GetCVar() function to do player-dependent console variables lookup --- src/c_cvars.cpp | 8 ++++++++ wadsrc/static/zscript/base.txt | 1 + 2 files changed, 9 insertions(+) diff --git a/src/c_cvars.cpp b/src/c_cvars.cpp index 5b33cc263..f223444e4 100644 --- a/src/c_cvars.cpp +++ b/src/c_cvars.cpp @@ -1544,6 +1544,14 @@ DEFINE_ACTION_FUNCTION(_CVar, FindCVar) ACTION_RETURN_POINTER(FindCVar(name, nullptr)); } +DEFINE_ACTION_FUNCTION(_CVar, GetCVar) +{ + PARAM_PROLOGUE; + PARAM_NAME(name); + PARAM_POINTER_DEF(plyr, player_t); + ACTION_RETURN_POINTER(GetCVar(plyr ? plyr->mo : nullptr, name)); +} + FBaseCVar *FindCVarSub (const char *var_name, int namelen) { FBaseCVar *var; diff --git a/wadsrc/static/zscript/base.txt b/wadsrc/static/zscript/base.txt index c62620b14..0f1195cbf 100644 --- a/wadsrc/static/zscript/base.txt +++ b/wadsrc/static/zscript/base.txt @@ -287,6 +287,7 @@ struct CVar native }; native static CVar FindCVar(Name name); + native static CVar GetCVar(Name name, PlayerInfo player = null); native int GetInt(); native double GetFloat(); native String GetString();