mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-16 09:31:14 +00:00
- started replacing direct references to class AInventory.
The easiest part was the type checks which could be changed to the name variant with a global search and replace. # Conflicts: # src/hwrenderer/scene/hw_sprites.cpp # Conflicts: # src/hwrenderer/scene/hw_sprites.cpp
This commit is contained in:
parent
4e8d88f7df
commit
5043106e97
14 changed files with 18 additions and 18 deletions
|
@ -931,12 +931,12 @@ static bool IsActorAMonster(AActor *mo)
|
|||
|
||||
static bool IsActorAnItem(AActor *mo)
|
||||
{
|
||||
return mo->IsKindOf(RUNTIME_CLASS(AInventory)) && mo->flags&MF_SPECIAL;
|
||||
return mo->IsKindOf(NAME_Inventory) && mo->flags&MF_SPECIAL;
|
||||
}
|
||||
|
||||
static bool IsActorACountItem(AActor *mo)
|
||||
{
|
||||
return mo->IsKindOf(RUNTIME_CLASS(AInventory)) && mo->flags&MF_SPECIAL && mo->flags&MF_COUNTITEM;
|
||||
return mo->IsKindOf(NAME_Inventory) && mo->flags&MF_SPECIAL && mo->flags&MF_COUNTITEM;
|
||||
}
|
||||
|
||||
// [SP] for all actors
|
||||
|
|
|
@ -3065,7 +3065,7 @@ void FinishDehPatch ()
|
|||
FStateDefinitions statedef;
|
||||
statedef.MakeStateDefines(type);
|
||||
|
||||
if (!type->IsDescendantOf(RUNTIME_CLASS(AInventory)))
|
||||
if (!type->IsDescendantOf(NAME_Inventory))
|
||||
{
|
||||
// If this is a hacked non-inventory item we must also copy AInventory's special states
|
||||
statedef.AddStateDefines(RUNTIME_CLASS(AInventory)->GetStateLabels());
|
||||
|
|
|
@ -3669,7 +3669,7 @@ void FParser::SF_ThingCount(void)
|
|||
again:
|
||||
TThinkerIterator<AActor> it;
|
||||
|
||||
if (t_argc<2 || intvalue(t_argv[1])==0 || pClass->IsDescendantOf(RUNTIME_CLASS(AInventory)))
|
||||
if (t_argc<2 || intvalue(t_argv[1])==0 || pClass->IsDescendantOf(NAME_Inventory))
|
||||
{
|
||||
while ((mo=it.Next()))
|
||||
{
|
||||
|
|
|
@ -182,7 +182,7 @@ static void AddOneKey(Keygroup *keygroup, PClassActor *mi, FScanner &sc)
|
|||
if (mi)
|
||||
{
|
||||
// Any inventory item can be used to unlock a door
|
||||
if (mi->IsDescendantOf(RUNTIME_CLASS(AInventory)))
|
||||
if (mi->IsDescendantOf(NAME_Inventory))
|
||||
{
|
||||
OneKey k = {mi,1};
|
||||
keygroup->anykeylist.Push (k);
|
||||
|
|
|
@ -455,7 +455,7 @@ DEFINE_ACTION_FUNCTION(ASpecialSpot, A_SpawnSingleItem)
|
|||
{
|
||||
spawned->flags &= ~MF_DROPPED;
|
||||
}
|
||||
if (spawned->IsKindOf(RUNTIME_CLASS(AInventory)))
|
||||
if (spawned->IsKindOf(NAME_Inventory))
|
||||
{
|
||||
static_cast<AInventory*>(spawned)->SpawnPointClass = self->GetClass();
|
||||
}
|
||||
|
|
|
@ -584,7 +584,7 @@ void GLSprite::SplitSprite(sector_t * frontsector, bool translucent)
|
|||
void GLSprite::PerformSpriteClipAdjustment(AActor *thing, const DVector2 &thingpos, float spriteheight)
|
||||
{
|
||||
const float NO_VAL = 100000000.0f;
|
||||
bool clipthing = (thing->player || thing->flags3&MF3_ISMONSTER || thing->IsKindOf(RUNTIME_CLASS(AInventory))) && (thing->flags&MF_ICECORPSE || !(thing->flags&MF_CORPSE));
|
||||
bool clipthing = (thing->player || thing->flags3&MF3_ISMONSTER || thing->IsKindOf(NAME_Inventory)) && (thing->flags&MF_ICECORPSE || !(thing->flags&MF_CORPSE));
|
||||
bool smarterclip = !clipthing && gl_spriteclip == 3;
|
||||
if (clipthing || gl_spriteclip > 1)
|
||||
{
|
||||
|
|
|
@ -346,7 +346,7 @@ static void LoadAltHudStuff()
|
|||
{
|
||||
Printf("Unknown item class '%s' in ALTHUDCF\n", sc.String);
|
||||
}
|
||||
else if (!ti->IsDescendantOf(RUNTIME_CLASS(AInventory)))
|
||||
else if (!ti->IsDescendantOf(NAME_Inventory))
|
||||
{
|
||||
Printf("Invalid item class '%s' in ALTHUDCF\n", sc.String);
|
||||
ti = NULL;
|
||||
|
|
|
@ -1846,7 +1846,7 @@ static int CheckInventory (AActor *activator, const char *type, bool max)
|
|||
DPrintf (DMSG_ERROR, "ACS: '%s': Unknown actor class.\n", type);
|
||||
return 0;
|
||||
}
|
||||
else if (!info->IsDescendantOf(RUNTIME_CLASS(AInventory)))
|
||||
else if (!info->IsDescendantOf(NAME_Inventory))
|
||||
{
|
||||
DPrintf(DMSG_ERROR, "ACS: '%s' is not an inventory item.\n", type);
|
||||
return 0;
|
||||
|
@ -1860,7 +1860,7 @@ static int CheckInventory (AActor *activator, const char *type, bool max)
|
|||
{
|
||||
return item->MaxAmount;
|
||||
}
|
||||
else if (info != nullptr && info->IsDescendantOf(RUNTIME_CLASS(AInventory)))
|
||||
else if (info != nullptr && info->IsDescendantOf(NAME_Inventory))
|
||||
{
|
||||
return ((AInventory *)GetDefaultByType(info))->MaxAmount;
|
||||
}
|
||||
|
|
|
@ -4062,7 +4062,7 @@ static bool DoRadiusGive(AActor *self, AActor *thing, PClassActor *item, int amo
|
|||
return false;
|
||||
doPass = true;
|
||||
}
|
||||
else if (((flags & RGF_ITEMS) && thing->IsKindOf(RUNTIME_CLASS(AInventory))) ||
|
||||
else if (((flags & RGF_ITEMS) && thing->IsKindOf(NAME_Inventory)) ||
|
||||
((flags & RGF_CORPSES) && thing->flags & MF_CORPSE) ||
|
||||
((flags & RGF_KILLED) && thing->flags6 & MF6_KILLED))
|
||||
{
|
||||
|
|
|
@ -380,7 +380,7 @@ static FStrifeDialogueNode *ReadRetailNode (FileReader &lump, uint32_t &prevSpea
|
|||
for (j = 0; j < 3; ++j)
|
||||
{
|
||||
auto inv = GetStrifeType(speech.ItemCheck[j]);
|
||||
if (!inv->IsDescendantOf(RUNTIME_CLASS(AInventory))) inv = nullptr;
|
||||
if (!inv->IsDescendantOf(NAME_Inventory)) inv = nullptr;
|
||||
node->ItemCheck[j].Item = inv;
|
||||
node->ItemCheck[j].Amount = -1;
|
||||
}
|
||||
|
@ -526,7 +526,7 @@ static void ParseReplies (FStrifeDialogueReply **replyptr, Response *responses)
|
|||
for (k = 0; k < 3; ++k)
|
||||
{
|
||||
auto inv = GetStrifeType(rsp->Item[k]);
|
||||
if (!inv->IsDescendantOf(RUNTIME_CLASS(AInventory))) inv = nullptr;
|
||||
if (!inv->IsDescendantOf(NAME_Inventory)) inv = nullptr;
|
||||
reply->ItemCheck[k].Item = inv;
|
||||
reply->ItemCheck[k].Amount = rsp->Count[k];
|
||||
}
|
||||
|
@ -958,7 +958,7 @@ static void HandleReply(player_t *player, bool isconsole, int nodenum, int reply
|
|||
takestuff = true;
|
||||
if (reply->GiveType != NULL)
|
||||
{
|
||||
if (reply->GiveType->IsDescendantOf(RUNTIME_CLASS(AInventory)))
|
||||
if (reply->GiveType->IsDescendantOf(NAME_Inventory))
|
||||
{
|
||||
if (reply->GiveType->IsDescendantOf(NAME_Weapon))
|
||||
{
|
||||
|
|
|
@ -552,7 +552,7 @@ bool P_TeleportMove(AActor* thing, const DVector3 &pos, bool telefrag, bool modi
|
|||
continue;
|
||||
|
||||
// Don't let players and monsters block item teleports (all other actor types will still block.)
|
||||
if (thing->IsKindOf(RUNTIME_CLASS(AInventory)) && !(thing->flags & MF_SOLID) && ((th->flags3 & MF3_ISMONSTER) || th->player != nullptr))
|
||||
if (thing->IsKindOf(NAME_Inventory) && !(thing->flags & MF_SOLID) && ((th->flags3 & MF3_ISMONSTER) || th->player != nullptr))
|
||||
continue;
|
||||
|
||||
// monsters don't stomp things except on boss level
|
||||
|
|
|
@ -636,7 +636,7 @@ DEFINE_ACTION_FUNCTION(AActor, InStateSequence)
|
|||
bool AActor::IsMapActor()
|
||||
{
|
||||
// [SP] Don't remove owned inventory objects.
|
||||
return (!IsKindOf(RUNTIME_CLASS(AInventory)) || static_cast<AInventory *>(this)->Owner == nullptr);
|
||||
return (!IsKindOf(NAME_Inventory) || static_cast<AInventory *>(this)->Owner == nullptr);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -78,7 +78,7 @@ class USDFParser : public UDMFParserBase
|
|||
PClassActor *CheckInventoryActorType(const char *key)
|
||||
{
|
||||
PClassActor* const type = CheckActorType(key);
|
||||
return nullptr != type && type->IsDescendantOf(RUNTIME_CLASS(AInventory)) ? type : nullptr;
|
||||
return nullptr != type && type->IsDescendantOf(NAME_Inventory) ? type : nullptr;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
|
|
@ -225,7 +225,7 @@ double RenderPolySprite::PerformSpriteClipAdjustment(AActor *thing, const DVecto
|
|||
if (!(spriteheight > 0 && spriteclip > 0 && spritetype == RF_FACESPRITE))
|
||||
return z2;
|
||||
|
||||
bool clipthing = (thing->player || thing->flags3&MF3_ISMONSTER || thing->IsKindOf(RUNTIME_CLASS(AInventory))) && (thing->flags&MF_ICECORPSE || !(thing->flags&MF_CORPSE));
|
||||
bool clipthing = (thing->player || thing->flags3&MF3_ISMONSTER || thing->IsKindOf(NAME_Inventory)) && (thing->flags&MF_ICECORPSE || !(thing->flags&MF_CORPSE));
|
||||
bool smarterclip = !clipthing && spriteclip == 3;
|
||||
if (clipthing || spriteclip > 1)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue