mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-28 23:12:18 +00:00
GC stuff plus one leftover commented out fragment.
This commit is contained in:
parent
6e0d61d137
commit
1f5ff06b91
4 changed files with 22 additions and 9 deletions
|
@ -59,8 +59,9 @@ IMPLEMENT_CLASS(DBloodActor, false, true)
|
|||
IMPLEMENT_POINTERS_START(DBloodActor)
|
||||
#ifdef NOONE_EXTENSIONS
|
||||
IMPLEMENT_POINTER(prevmarker)
|
||||
IMPLEMENT_POINTER(ownerActor)
|
||||
IMPLEMENT_POINTER(customDude)
|
||||
#endif
|
||||
IMPLEMENT_POINTER(ownerActor)
|
||||
IMPLEMENT_POINTER(xspr.burnSource)
|
||||
IMPLEMENT_POINTER(xspr.target)
|
||||
IMPLEMENT_POINTERS_END
|
||||
|
@ -105,8 +106,7 @@ size_t DBloodActor::PropagateMark()
|
|||
if (hit.ceilhit.type == kHitSprite) GC::Mark(hit.ceilhit.hitActor);
|
||||
if (hit.florhit.type == kHitSprite) GC::Mark(hit.florhit.hitActor);
|
||||
#ifdef NOONE_EXTENSIONS
|
||||
condition[0].Mark();
|
||||
condition[1].Mark();
|
||||
for(auto& cond : condition) cond.Mark();
|
||||
#endif
|
||||
return Super::PropagateMark();
|
||||
}
|
||||
|
|
|
@ -460,6 +460,7 @@ void DBloodActor::Serialize(FSerializer& arc)
|
|||
{
|
||||
arc//("spritemass", spriteMass) // should always be cached and not written out.
|
||||
("prevmarker", prevmarker)
|
||||
("customdude", customDude)
|
||||
.Array("conditions", condition, 4);
|
||||
|
||||
}
|
||||
|
|
|
@ -4452,6 +4452,20 @@ size_t DCustomDude::PropagateMark()
|
|||
return pSlaves.Size() + Super::PropagateMark();
|
||||
}
|
||||
|
||||
void DCustomDude::OnDestroy()
|
||||
{
|
||||
// free all allocations now and sever the link to the dude actor.
|
||||
pSpr = nullptr;
|
||||
pSlaves.Reset();
|
||||
for (auto& ef : effects)
|
||||
{
|
||||
ef.pAnims.Reset();
|
||||
ef.pFrames.Reset();
|
||||
ef.pStates.Reset();
|
||||
}
|
||||
Super::Destroy();
|
||||
}
|
||||
|
||||
|
||||
END_BLD_NS
|
||||
#endif
|
|
@ -983,12 +983,9 @@ class CUSTOMDUDE_EFFECT
|
|||
}
|
||||
else if (nID >= kCudeFXEffectCallbackBase)
|
||||
{
|
||||
#pragma message("Fix " __FUNCTION__ " for custom callbacks")
|
||||
#if 0
|
||||
nID = gCdudeCustomCallback[nID - kCudeFXEffectCallbackBase];
|
||||
evKill(pSpr->index, OBJ_SPRITE, (CALLBACK_ID)nID);
|
||||
evPost(pSpr->index, OBJ_SPRITE, 0, (CALLBACK_ID)nID);
|
||||
#endif
|
||||
auto func = *gCdudeCustomCallback[nID - kCudeFXEffectCallbackBase];
|
||||
evKillActor(pSpr, func);
|
||||
evPostActor(pSpr, 0, func);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1195,6 +1192,7 @@ class DCustomDude : public DObject
|
|||
HAS_OBJECT_POINTERS
|
||||
|
||||
size_t PropagateMark() override;
|
||||
void OnDestroy();
|
||||
|
||||
// Note: we will likely have to write out the entire shit here to make this savegame robust...
|
||||
public:
|
||||
|
|
Loading…
Reference in a new issue