diff --git a/src/dobjtype.cpp b/src/dobjtype.cpp index 9693da137..c3d0702f3 100644 --- a/src/dobjtype.cpp +++ b/src/dobjtype.cpp @@ -670,6 +670,20 @@ void PNamedType::GetTypeIDs(intptr_t &id1, intptr_t &id2) const id2 = TypeName; } +//========================================================================== +// +// PNamedType :: QualifiedName +// +//========================================================================== + +FString PNamedType::QualifiedName() const +{ + FString out; + if (Outer != nullptr) out = Outer->QualifiedName(); + out << "::" << TypeName; + return out; +} + /* PInt *******************************************************************/ IMPLEMENT_CLASS(PInt) @@ -1752,7 +1766,7 @@ PEnum::PEnum() // //========================================================================== -PEnum::PEnum(FName name, DObject *outer) +PEnum::PEnum(FName name, PTypeBase *outer) : PNamedType(name, outer), ValueType(NULL) { } @@ -1766,7 +1780,7 @@ PEnum::PEnum(FName name, DObject *outer) // //========================================================================== -PEnum *NewEnum(FName name, DObject *outer) +PEnum *NewEnum(FName name, PTypeBase *outer) { size_t bucket; PType *etype = TypeTable.FindType(RUNTIME_CLASS(PEnum), (intptr_t)outer, (intptr_t)name, &bucket); @@ -2149,7 +2163,7 @@ PStruct::PStruct() // //========================================================================== -PStruct::PStruct(FName name, DObject *outer) +PStruct::PStruct(FName name, PTypeBase *outer) : PNamedType(name, outer) { } @@ -2310,7 +2324,7 @@ size_t PStruct::PropagateMark() // //========================================================================== -PStruct *NewStruct(FName name, DObject *outer) +PStruct *NewStruct(FName name, PTypeBase *outer) { size_t bucket; PType *stype = TypeTable.FindType(RUNTIME_CLASS(PStruct), (intptr_t)outer, (intptr_t)name, &bucket); @@ -3360,6 +3374,7 @@ CCMD(typetable) // Symbol tables ------------------------------------------------------------ +IMPLEMENT_ABSTRACT_CLASS(PTypeBase); IMPLEMENT_ABSTRACT_CLASS(PSymbol); IMPLEMENT_CLASS(PSymbolConst); IMPLEMENT_CLASS(PSymbolConstNumeric); diff --git a/src/dobjtype.h b/src/dobjtype.h index 62cfa6753..338c51f98 100644 --- a/src/dobjtype.h +++ b/src/dobjtype.h @@ -22,12 +22,28 @@ typedef std::pair FTypeAndOffset; // Symbol information ------------------------------------------------------- -class PSymbol : public DObject +class PTypeBase : public DObject { - DECLARE_ABSTRACT_CLASS(PSymbol, DObject); + DECLARE_ABSTRACT_CLASS(PTypeBase, DObject) + +public: + virtual FString QualifiedName() const + { + return ""; + } +}; + +class PSymbol : public PTypeBase +{ + DECLARE_ABSTRACT_CLASS(PSymbol, PTypeBase); public: virtual ~PSymbol(); + virtual FString QualifiedName() const + { + return SymbolName.GetChars(); + } + FName SymbolName; protected: @@ -153,13 +169,13 @@ extern PSymbolTable GlobalSymbols; struct ZCC_ExprConstant; class PClassType; -class PType : public DObject +class PType : public PTypeBase { //DECLARE_ABSTRACT_CLASS_WITH_META(PType, DObject, PClassType); // We need to unravel the _WITH_META macro, since PClassType isn't defined yet, // and we can't define it until we've defined PClass. But we can't define that // without defining PType. - DECLARE_ABSTRACT_CLASS(PType, DObject) + DECLARE_ABSTRACT_CLASS(PType, PTypeBase) HAS_OBJECT_POINTERS; protected: enum { MetaClassNum = CLASSREG_PClassType }; @@ -332,14 +348,15 @@ class PNamedType : public PCompoundType DECLARE_ABSTRACT_CLASS(PNamedType, PCompoundType); HAS_OBJECT_POINTERS; public: - DObject *Outer; // object this type is contained within + PTypeBase *Outer; // object this type is contained within FName TypeName; // this type's name PNamedType() : Outer(NULL) {} - PNamedType(FName name, DObject *outer) : Outer(outer), TypeName(name) {} + PNamedType(FName name, PTypeBase *outer) : Outer(outer), TypeName(name) {} virtual bool IsMatch(intptr_t id1, intptr_t id2) const; virtual void GetTypeIDs(intptr_t &id1, intptr_t &id2) const; + virtual FString QualifiedName() const; }; // Basic types -------------------------------------------------------------- @@ -533,7 +550,7 @@ class PEnum : public PNamedType DECLARE_CLASS(PEnum, PNamedType); HAS_OBJECT_POINTERS; public: - PEnum(FName name, DObject *outer); + PEnum(FName name, PTypeBase *outer); PType *ValueType; TMap Values; @@ -610,7 +627,7 @@ class PStruct : public PNamedType { DECLARE_CLASS(PStruct, PNamedType); public: - PStruct(FName name, DObject *outer); + PStruct(FName name, PTypeBase *outer); TArray Fields; @@ -822,8 +839,8 @@ PDynArray *NewDynArray(PType *type); PPointer *NewPointer(PType *type); PClassPointer *NewClassPointer(PClass *restrict); PClassWaitingForParent *NewUnknownClass(FName myname, FName parentname); -PEnum *NewEnum(FName name, DObject *outer); -PStruct *NewStruct(FName name, DObject *outer); +PEnum *NewEnum(FName name, PTypeBase *outer); +PStruct *NewStruct(FName name, PTypeBase *outer); PPrototype *NewPrototype(const TArray &rettypes, const TArray &argtypes); // Built-in types ----------------------------------------------------------- diff --git a/src/g_shared/a_pickups.cpp b/src/g_shared/a_pickups.cpp index d24f114bd..e80e54818 100644 --- a/src/g_shared/a_pickups.cpp +++ b/src/g_shared/a_pickups.cpp @@ -23,8 +23,6 @@ #include "serializer.h" static FRandom pr_restore ("RestorePos"); -CVAR(Bool, r_pickupflash, true, CVAR_ARCHIVE); - IMPLEMENT_CLASS(PClassInventory) @@ -1091,7 +1089,7 @@ void AInventory::Touch (AActor *toucher) if (player != NULL) { PlayPickupSound (player->mo); - if (!(ItemFlags & IF_NOSCREENFLASH) && r_pickupflash) + if (!(ItemFlags & IF_NOSCREENFLASH)) { player->bonuscount = BONUSADD; } diff --git a/wadsrc/static/language.enu b/wadsrc/static/language.enu index b7d887727..079fd0b89 100644 --- a/wadsrc/static/language.enu +++ b/wadsrc/static/language.enu @@ -1806,7 +1806,6 @@ DSPLYMNU_DIMCOLOR = "Dim color"; DSPLYMNU_MOVEBOB = "View bob amount while moving"; DSPLYMNU_STILLBOB = "View bob amount while not moving"; DSPLYMNU_BOBSPEED = "Weapon bob speed"; -DSPLYMNU_PIFLASH = "Show pickup screen flash"; // HUD Options HUDMNU_TITLE = "HUD Options"; diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index ac4e02be9..cbe3fcb97 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -704,7 +704,6 @@ OptionMenu "VideoOptions" Option "$DSPLYMNU_LINEARSKY", "r_linearsky", "OnOff" Option "$DSPLYMNU_DRAWFUZZ", "r_drawfuzz", "Fuzziness" Slider "$DSPLYMNU_TRANSSOUL", "transsouls", 0.25, 1.0, 0.05, 2 - Option "$DSPLYMNU_PIFLASH", "r_pickupflash", "OnOff" Option "$DSPLYMNU_FAKECONTRAST", "r_fakecontrast", "Contrast" Option "$DSPLYMNU_ROCKETTRAILS", "cl_rockettrails", "RocketTrailTypes" Option "$DSPLYMNU_BLOODTYPE", "cl_bloodtype", "BloodTypes"