forked from Mirrors/openclonk
Do not enumerate pointers before saving
Instead, retrieve the number on demand during serialization. This saves lots of unnecessary code and makes serialization actually not modify the objects. At least with the exception of nInfo, but that should be save.
parent
8a17593c99
commit
2031fb0644
|
@ -1713,29 +1713,11 @@ bool C4Game::CompileRuntimeData(C4Group &hGroup, bool fLoadSection, C4ValueNumbe
|
|||
|
||||
bool C4Game::SaveData(C4Group &hGroup, bool fSaveSection, bool fInitial, bool fSaveExact, C4ValueNumbers * numbers)
|
||||
{
|
||||
|
||||
// Enumerate pointers & strings
|
||||
if (PointersDenumerated)
|
||||
{
|
||||
::Objects.Enumerate();
|
||||
Players.EnumeratePointers();
|
||||
if (pGlobalEffects) pGlobalEffects->EnumeratePointers();
|
||||
}
|
||||
|
||||
// Decompile
|
||||
StdStrBuf Buf;
|
||||
if (!Decompile(Buf,fSaveSection,fSaveExact, numbers))
|
||||
return false;
|
||||
|
||||
// Denumerate pointers, if game is in denumerated state
|
||||
if (PointersDenumerated)
|
||||
{
|
||||
::Objects.Denumerate(numbers);
|
||||
ScriptEngine.Denumerate(numbers);
|
||||
Players.DenumeratePointers();
|
||||
if (pGlobalEffects) pGlobalEffects->Denumerate(numbers);
|
||||
}
|
||||
|
||||
// Initial?
|
||||
if (fInitial && GameText.GetData())
|
||||
{
|
||||
|
@ -3090,7 +3072,7 @@ bool C4Game::CheckObjectEnumeration()
|
|||
clnk=clnk->Next;
|
||||
}
|
||||
// Adjust enumeration index
|
||||
if (iMax>C4PropListNumbered::EnumerationIndex) C4PropListNumbered::EnumerationIndex=iMax;
|
||||
C4PropListNumbered::SetEnumerationIndex(iMax);
|
||||
// Done
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1889,12 +1889,6 @@ void C4Command::Denumerate(C4ValueNumbers * numbers)
|
|||
Tx.Denumerate(numbers);
|
||||
}
|
||||
|
||||
void C4Command::EnumeratePointers()
|
||||
{
|
||||
Target.EnumeratePointers();
|
||||
Target2.EnumeratePointers();
|
||||
}
|
||||
|
||||
int32_t C4Command::CallFailed()
|
||||
{
|
||||
// No function name or no target object: cannot call fail-function
|
||||
|
|
|
@ -100,7 +100,6 @@ public:
|
|||
void Execute();
|
||||
void ClearPointers(C4Object *pObj);
|
||||
void Default();
|
||||
void EnumeratePointers();
|
||||
void Denumerate(C4ValueNumbers *);
|
||||
void CompileFunc(StdCompiler *pComp, C4ValueNumbers *);
|
||||
protected:
|
||||
|
|
|
@ -930,11 +930,6 @@ void C4GraphicsOverlay::CompileFunc(StdCompiler *pComp)
|
|||
if (pComp->isCompiler()) UpdateFacet();
|
||||
}
|
||||
|
||||
void C4GraphicsOverlay::EnumeratePointers()
|
||||
{
|
||||
OverlayObj.EnumeratePointers();
|
||||
}
|
||||
|
||||
void C4GraphicsOverlay::DenumeratePointers()
|
||||
{
|
||||
OverlayObj.DenumeratePointers();
|
||||
|
|
|
@ -225,7 +225,6 @@ public:
|
|||
void CompileFunc(StdCompiler *pComp);
|
||||
|
||||
// object pointer management
|
||||
void EnumeratePointers();
|
||||
void DenumeratePointers();
|
||||
|
||||
void SetAsBase(C4DefGraphics *pBaseGfx, DWORD dwBMode) // set in MODE_Base
|
||||
|
|
|
@ -361,13 +361,6 @@ int C4GameObjects::PostLoad(bool fKeepInactive, C4ValueNumbers * numbers)
|
|||
return ObjectCount();
|
||||
}
|
||||
|
||||
|
||||
void C4GameObjects::Enumerate()
|
||||
{
|
||||
C4ObjectList::Enumerate();
|
||||
InactiveObjects.Enumerate();
|
||||
}
|
||||
|
||||
void C4GameObjects::Denumerate(C4ValueNumbers * numbers)
|
||||
{
|
||||
C4ObjectList::Denumerate(numbers);
|
||||
|
|
|
@ -59,7 +59,6 @@ public:
|
|||
C4Object* SafeObjectPointer(int32_t iNumber);
|
||||
|
||||
int PostLoad(bool fKeepInactive, C4ValueNumbers *);
|
||||
void Enumerate();
|
||||
void Denumerate(C4ValueNumbers *);
|
||||
|
||||
void UpdateScriptPointers(); // update pointers to C4AulScript *
|
||||
|
|
|
@ -90,7 +90,6 @@ public:
|
|||
|
||||
virtual void CompileFunc(StdCompiler* pComp);
|
||||
virtual void DenumeratePointers() { Object.DenumeratePointers(); }
|
||||
virtual void EnumeratePointers() { Object.EnumeratePointers(); }
|
||||
private:
|
||||
C4ObjectPtr Object;
|
||||
C4Real Begin;
|
||||
|
@ -107,7 +106,6 @@ public:
|
|||
|
||||
virtual void CompileFunc(StdCompiler* pComp);
|
||||
virtual void DenumeratePointers() { Object.DenumeratePointers(); }
|
||||
virtual void EnumeratePointers() { Object.EnumeratePointers(); }
|
||||
private:
|
||||
C4ObjectPtr Object;
|
||||
C4Real Begin;
|
||||
|
@ -124,7 +122,6 @@ public:
|
|||
|
||||
virtual void CompileFunc(StdCompiler* pComp);
|
||||
virtual void DenumeratePointers() { Object.DenumeratePointers(); }
|
||||
virtual void EnumeratePointers() { Object.EnumeratePointers(); }
|
||||
private:
|
||||
C4ObjectPtr Object;
|
||||
C4Real Begin;
|
||||
|
@ -141,7 +138,6 @@ public:
|
|||
|
||||
virtual void CompileFunc(StdCompiler* pComp);
|
||||
virtual void DenumeratePointers() { Object.DenumeratePointers(); }
|
||||
virtual void EnumeratePointers() { Object.EnumeratePointers(); }
|
||||
private:
|
||||
C4ObjectPtr Object;
|
||||
C4Real Begin;
|
||||
|
@ -158,7 +154,6 @@ public:
|
|||
|
||||
virtual void CompileFunc(StdCompiler* pComp);
|
||||
virtual void DenumeratePointers() { Object.DenumeratePointers(); }
|
||||
virtual void EnumeratePointers() { Object.EnumeratePointers(); }
|
||||
private:
|
||||
C4ObjectPtr Object;
|
||||
C4Real Begin;
|
||||
|
@ -175,7 +170,6 @@ public:
|
|||
|
||||
virtual void CompileFunc(StdCompiler* pComp);
|
||||
virtual void DenumeratePointers() { Object.DenumeratePointers(); }
|
||||
virtual void EnumeratePointers() { Object.EnumeratePointers(); }
|
||||
private:
|
||||
C4ObjectPtr Object;
|
||||
C4Real Begin;
|
||||
|
@ -192,7 +186,6 @@ public:
|
|||
|
||||
virtual void CompileFunc(StdCompiler* pComp);
|
||||
virtual void DenumeratePointers() { Object.DenumeratePointers(); }
|
||||
virtual void EnumeratePointers() { Object.EnumeratePointers(); }
|
||||
private:
|
||||
C4ObjectPtr Object;
|
||||
C4Real Begin;
|
||||
|
@ -209,7 +202,6 @@ public:
|
|||
|
||||
virtual void CompileFunc(StdCompiler* pComp);
|
||||
virtual void DenumeratePointers() { Object.DenumeratePointers(); }
|
||||
virtual void EnumeratePointers() { Object.EnumeratePointers(); }
|
||||
private:
|
||||
C4ObjectPtr Object;
|
||||
C4Real Begin;
|
||||
|
@ -226,7 +218,6 @@ public:
|
|||
|
||||
virtual void CompileFunc(StdCompiler* pComp);
|
||||
virtual void DenumeratePointers() { Object.DenumeratePointers(); }
|
||||
virtual void EnumeratePointers() { Object.EnumeratePointers(); }
|
||||
private:
|
||||
C4ObjectPtr Object;
|
||||
C4Real Begin;
|
||||
|
@ -243,7 +234,6 @@ public:
|
|||
|
||||
virtual void CompileFunc(StdCompiler* pComp);
|
||||
virtual void DenumeratePointers() { Object.DenumeratePointers(); }
|
||||
virtual void EnumeratePointers() { Object.EnumeratePointers(); }
|
||||
private:
|
||||
C4ObjectPtr Object;
|
||||
C4Real Begin;
|
||||
|
@ -260,7 +250,6 @@ public:
|
|||
|
||||
virtual void CompileFunc(StdCompiler* pComp);
|
||||
virtual void DenumeratePointers() { Object.DenumeratePointers(); }
|
||||
virtual void EnumeratePointers() { Object.EnumeratePointers(); }
|
||||
private:
|
||||
C4ObjectPtr Object;
|
||||
C4Real Begin;
|
||||
|
@ -277,7 +266,6 @@ public:
|
|||
|
||||
virtual void CompileFunc(StdCompiler* pComp);
|
||||
virtual void DenumeratePointers() { Object.DenumeratePointers(); }
|
||||
virtual void EnumeratePointers() { Object.EnumeratePointers(); }
|
||||
private:
|
||||
C4ObjectPtr Object;
|
||||
};
|
||||
|
|
|
@ -106,11 +106,6 @@ void C4MeshDenumerator::CompileFunc(StdCompiler* pComp, StdMeshInstance::Attache
|
|||
}
|
||||
}
|
||||
|
||||
void C4MeshDenumerator::EnumeratePointers(StdMeshInstance::AttachedMesh* attach)
|
||||
{
|
||||
Object.EnumeratePointers();
|
||||
}
|
||||
|
||||
void C4MeshDenumerator::DenumeratePointers(StdMeshInstance::AttachedMesh* attach)
|
||||
{
|
||||
Object.DenumeratePointers();
|
||||
|
@ -1788,11 +1783,10 @@ StdStrBuf C4Object::GetDataString()
|
|||
}
|
||||
|
||||
StdStrBuf Output2;
|
||||
// FIXME: Make decompile save without this
|
||||
EnumeratePointers();
|
||||
C4ValueNumbers numbers;
|
||||
DecompileToBuf_Log<StdCompilerINIWrite>(mkNamingAdapt(mkParAdapt(*this, &numbers), "Object"), &Output2, "C4Object::GetDataString");
|
||||
Denumerate(&numbers);
|
||||
DecompileToBuf_Log<StdCompilerINIWrite>(mkNamingAdapt(mkInsertAdapt(mkParAdapt(*this, &numbers),
|
||||
mkNamingAdapt(numbers, "Values"), false),
|
||||
"Object"), &Output2, "C4Object::GetDataString");
|
||||
Output.Append(LineFeed);
|
||||
Output.Append(Output2);
|
||||
return Output;
|
||||
|
@ -2323,6 +2317,7 @@ void C4Object::CompileFunc(StdCompiler *pComp, C4ValueNumbers * numbers)
|
|||
|
||||
pComp->Value(mkNamingAdapt( mkParAdapt(static_cast<C4PropListNumbered&>(*this), numbers), "Properties"));
|
||||
pComp->Value(mkNamingAdapt( Status, "Status", 1 ));
|
||||
if (Info) nInfo = Info->Name; else nInfo.Clear();
|
||||
pComp->Value(mkNamingAdapt( toC4CStrBuf(nInfo), "Info", "" ));
|
||||
pComp->Value(mkNamingAdapt( Owner, "Owner", NO_OWNER ));
|
||||
pComp->Value(mkNamingAdapt( Timer, "Timer", 0 ));
|
||||
|
@ -2459,34 +2454,6 @@ void C4Object::CompileFunc(StdCompiler *pComp, C4ValueNumbers * numbers)
|
|||
|
||||
}
|
||||
|
||||
void C4Object::EnumeratePointers()
|
||||
{
|
||||
// Standard enumerated pointers
|
||||
Contained.EnumeratePointers();
|
||||
Action.Target.EnumeratePointers();
|
||||
Action.Target2.EnumeratePointers();
|
||||
Layer.EnumeratePointers();
|
||||
|
||||
// Info by name
|
||||
//if (Info) SCopy(Info->Name,nInfo,C4MaxName);
|
||||
if (Info) nInfo = Info->Name; else nInfo.Clear();
|
||||
|
||||
// Commands
|
||||
for (C4Command *pCom=Command; pCom; pCom=pCom->Next)
|
||||
pCom->EnumeratePointers();
|
||||
|
||||
// effects
|
||||
if (pEffects) pEffects->EnumeratePointers();
|
||||
|
||||
// gfx overlays
|
||||
if (pGfxOverlay)
|
||||
for (C4GraphicsOverlay *pGfxOvrl = pGfxOverlay; pGfxOvrl; pGfxOvrl = pGfxOvrl->GetNext())
|
||||
pGfxOvrl->EnumeratePointers();
|
||||
|
||||
// mesh instance
|
||||
if (pMeshInstance) pMeshInstance->EnumeratePointers();
|
||||
}
|
||||
|
||||
void C4Object::Denumerate(C4ValueNumbers * numbers)
|
||||
{
|
||||
C4PropList::Denumerate(numbers);
|
||||
|
|
|
@ -94,7 +94,6 @@ public:
|
|||
C4MeshDenumerator(C4Object* object): Def(NULL), Object(object) {}
|
||||
|
||||
virtual void CompileFunc(StdCompiler* pComp, StdMeshInstance::AttachedMesh* attach);
|
||||
virtual void EnumeratePointers(StdMeshInstance::AttachedMesh* attach);
|
||||
virtual void DenumeratePointers(StdMeshInstance::AttachedMesh* attach);
|
||||
};
|
||||
|
||||
|
@ -237,14 +236,13 @@ public:
|
|||
bool AssignPlrViewRange();
|
||||
void DrawPicture(C4Facet &cgo, bool fSelected=false, C4RegionList *pRegions=NULL,C4DrawTransform* transform=NULL);
|
||||
void Picture2Facet(C4FacetSurface &cgo); // set picture to facet, or create facet in current size and draw if specific states are being needed
|
||||
virtual void Denumerate(C4ValueNumbers *);
|
||||
void EnumeratePointers();
|
||||
void Default();
|
||||
bool Init(C4PropList *ndef, C4Object *pCreator,
|
||||
int32_t owner, C4ObjectInfo *info,
|
||||
int32_t nx, int32_t ny, int32_t nr,
|
||||
C4Real nxdir, C4Real nydir, C4Real nrdir, int32_t iController);
|
||||
void CompileFunc(StdCompiler *pComp, C4ValueNumbers *);
|
||||
virtual void Denumerate(C4ValueNumbers *);
|
||||
void DrawLine(C4TargetFacet &cgo);
|
||||
bool SetPhase(int32_t iPhase);
|
||||
void AssignRemoval(bool fExitContents=false);
|
||||
|
|
|
@ -457,15 +457,6 @@ void C4ObjectList::DrawIfCategory(C4TargetFacet &cgo, int iPlayer, uint32_t dwCa
|
|||
clnk->Obj->DrawTopFace(cgo, iPlayer);
|
||||
}
|
||||
|
||||
void C4ObjectList::Enumerate()
|
||||
{
|
||||
C4ObjectLink *cLnk;
|
||||
// Enumerate object pointers
|
||||
for (cLnk=First; cLnk; cLnk=cLnk->Next)
|
||||
if (cLnk->Obj->Status)
|
||||
cLnk->Obj->EnumeratePointers();
|
||||
}
|
||||
|
||||
bool C4ObjectList::IsContained(C4Object *pObj)
|
||||
{
|
||||
C4ObjectLink *cLnk;
|
||||
|
|
|
@ -92,8 +92,6 @@ public:
|
|||
virtual void Default();
|
||||
virtual void Clear();
|
||||
void Sort();
|
||||
void Enumerate();
|
||||
void Denumerate(C4ValueNumbers *);
|
||||
void Copy(const C4ObjectList &rList);
|
||||
void DrawIfCategory(C4TargetFacet &cgo, int iPlayer, uint32_t dwCat, bool fInvert); // draw all objects that match dwCat (or don't match if fInvert)
|
||||
void Draw(C4TargetFacet &cgo, int iPlayer, int MinPlane, int MaxPlane); // draw all objects
|
||||
|
@ -119,6 +117,7 @@ public:
|
|||
bool Write(char *szTarget);
|
||||
void CompileFunc(StdCompiler *pComp, C4ValueNumbers * = 0);
|
||||
void CompileFunc(StdCompiler *pComp, bool fSkipPlayerObjects, C4ValueNumbers *);
|
||||
void Denumerate(C4ValueNumbers *);
|
||||
|
||||
bool IsContained(C4Object *pObj);
|
||||
int ClearPointers(C4Object *pObj);
|
||||
|
|
|
@ -24,48 +24,30 @@
|
|||
|
||||
#include <limits>
|
||||
|
||||
namespace
|
||||
{
|
||||
C4ObjectPtr NullEnumerated()
|
||||
{
|
||||
C4ObjectPtr ptr(NULL);
|
||||
ptr.EnumeratePointers();
|
||||
return ptr;
|
||||
}
|
||||
}
|
||||
|
||||
const C4ObjectPtr C4ObjectPtr::Null(NullEnumerated());
|
||||
const C4ObjectPtr C4ObjectPtr::Null(0);
|
||||
|
||||
void C4ObjectPtr::CompileFunc(StdCompiler* pComp)
|
||||
{
|
||||
// Pointer needs to be enumerated when decompiling
|
||||
assert(pComp->isCompiler() || !fDenumerated);
|
||||
|
||||
assert(data.nptr < std::numeric_limits<int32_t>::max());
|
||||
int32_t nptr = static_cast<int32_t>(data.nptr);
|
||||
pComp->Value(nptr); // TODO: Use mkIntPackAdapt?
|
||||
data.nptr = nptr;
|
||||
|
||||
#ifndef NDEBUG
|
||||
// After having read a value the pointer is enumerated
|
||||
if(pComp->isCompiler()) fDenumerated = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void C4ObjectPtr::EnumeratePointers()
|
||||
{
|
||||
// Pointer needs to be denumerated when decompiling
|
||||
assert(fDenumerated);
|
||||
|
||||
data.nptr = data.ptr ? data.ptr->Number : 0;
|
||||
|
||||
int32_t nptr = 0;
|
||||
if (!pComp->isCompiler() && data.ptr)
|
||||
nptr = data.ptr->Number;
|
||||
pComp->Value(nptr);
|
||||
if (pComp->isCompiler())
|
||||
{
|
||||
data.nptr = nptr;
|
||||
#ifndef NDEBUG
|
||||
// After having read a value the pointer is enumerated
|
||||
fDenumerated = false;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void C4ObjectPtr::DenumeratePointers()
|
||||
{
|
||||
assert(!fDenumerated);
|
||||
assert(!fDenumerated || !data.ptr);
|
||||
|
||||
assert(data.nptr < std::numeric_limits<int32_t>::max());
|
||||
data.ptr = ::Objects.ObjectPointer(static_cast<int32_t>(data.nptr));
|
||||
|
|
|
@ -25,8 +25,8 @@ class C4ObjectPtr
|
|||
{
|
||||
public:
|
||||
// For use with mkNamingAdapt because simply 0 becomes 0 (the int)
|
||||
// which makes correct template deduction fail. This constant is an
|
||||
// enumerated(!) null pointer.
|
||||
// which makes correct template deduction fail. This constant is a
|
||||
// denumerated null pointer which can be repeatedly denumerated.
|
||||
static const C4ObjectPtr Null;
|
||||
|
||||
C4ObjectPtr() {} // uninitialized
|
||||
|
@ -50,7 +50,6 @@ public:
|
|||
#endif
|
||||
|
||||
void CompileFunc(StdCompiler* pComp);
|
||||
void EnumeratePointers();
|
||||
void DenumeratePointers();
|
||||
|
||||
bool operator!() const { assert(fDenumerated); return !data.ptr; }
|
||||
|
|
|
@ -1349,17 +1349,6 @@ void C4Player::DoTeamSelection(int32_t idTeam)
|
|||
::Control.DoInput(CID_Script, new C4ControlScript(FormatString("InitScenarioPlayer(%d,%d)", (int)Number, (int)idTeam).getData()), CDT_Queue);
|
||||
}
|
||||
|
||||
void C4Player::EnumeratePointers()
|
||||
{
|
||||
// Cursor
|
||||
Cursor.EnumeratePointers();
|
||||
// ViewCursor
|
||||
ViewCursor.EnumeratePointers();
|
||||
// messageboard-queries
|
||||
for (C4MessageBoardQuery *pCheck = pMsgBoardQuery; pCheck; pCheck = pCheck->pNext)
|
||||
pCheck->CallbackObj.EnumeratePointers();
|
||||
}
|
||||
|
||||
void C4Player::DenumeratePointers()
|
||||
{
|
||||
// Crew
|
||||
|
|
|
@ -195,7 +195,6 @@ public:
|
|||
bool IsHostileTowards(const C4Player *opponent) const;
|
||||
void CompileFunc(StdCompiler *pComp, C4ValueNumbers *);
|
||||
void DenumeratePointers();
|
||||
void EnumeratePointers();
|
||||
bool LoadRuntimeData(C4Group &hGroup, C4ValueNumbers *);
|
||||
bool ActivateMenuMain();
|
||||
bool ActivateMenuTeamSelection(bool fFromMain);
|
||||
|
|
|
@ -612,12 +612,6 @@ bool C4PlayerList::RemoveLocal(bool fDisconnect, bool fNoCalls)
|
|||
return true;
|
||||
}
|
||||
|
||||
void C4PlayerList::EnumeratePointers()
|
||||
{
|
||||
for (C4Player *pPlr=First; pPlr; pPlr=pPlr->Next)
|
||||
pPlr->EnumeratePointers();
|
||||
}
|
||||
|
||||
void C4PlayerList::DenumeratePointers()
|
||||
{
|
||||
for (C4Player *pPlr=First; pPlr; pPlr=pPlr->Next)
|
||||
|
|
|
@ -42,7 +42,6 @@ public:
|
|||
void Clear();
|
||||
void Execute();
|
||||
void DenumeratePointers();
|
||||
void EnumeratePointers();
|
||||
void ClearPointers(C4Object *pObj);
|
||||
int GetCount() const;
|
||||
int GetCount(C4PlayerType eType) const;
|
||||
|
|
|
@ -164,19 +164,6 @@ C4Effect::~C4Effect()
|
|||
}
|
||||
}
|
||||
|
||||
void C4Effect::EnumeratePointers()
|
||||
{
|
||||
// enum in all effects
|
||||
C4Effect *pEff = this;
|
||||
do
|
||||
{
|
||||
// command target
|
||||
pEff->CommandTarget.EnumeratePointers();
|
||||
// effect var denumeration: not necessary, because this is done while saving
|
||||
}
|
||||
while ((pEff=pEff->pNext));
|
||||
}
|
||||
|
||||
void C4Effect::Denumerate(C4ValueNumbers * numbers)
|
||||
{
|
||||
// denum in all effects
|
||||
|
|
|
@ -98,7 +98,6 @@ public:
|
|||
static C4Effect * New(C4Object * pForObj, C4String * szName, int32_t iPrio, int32_t iTimerInterval, C4Object * pCmdTarget, C4ID idCmdTarget, const C4Value &rVal1, const C4Value &rVal2, const C4Value &rVal3, const C4Value &rVal4);
|
||||
~C4Effect(); // dtor - deletes all following effects
|
||||
|
||||
void EnumeratePointers(); // object pointers to numbers
|
||||
void Denumerate(C4ValueNumbers *); // numbers to object pointers
|
||||
void ClearPointers(C4Object *pObj); // clear all pointers to object - may kill some effects w/o callback, because the callback target is lost
|
||||
|
||||
|
|
|
@ -1467,11 +1467,9 @@ static C4Value FnGetObjectVal(C4AulContext* cthr, C4Value* strEntry_C4V, C4Value
|
|||
|
||||
// get value
|
||||
C4ValueNumbers numbers;
|
||||
cthr->Obj->EnumeratePointers();
|
||||
C4Value retval = GetValByStdCompiler(strEntry, strSection, iEntryNr, mkNamingAdapt(mkParAdapt(*cthr->Obj, &numbers), "Object"));
|
||||
cthr->Obj->Denumerate(&numbers);
|
||||
retval.Denumerate(&numbers);
|
||||
numbers.Denumerate();
|
||||
retval.Denumerate(&numbers);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
@ -1521,11 +1519,9 @@ static C4Value FnGetPlayerVal(C4AulContext* cthr, C4Value* strEntry_C4V, C4Value
|
|||
|
||||
// get value
|
||||
C4ValueNumbers numbers;
|
||||
pPlayer->EnumeratePointers();
|
||||
C4Value retval = GetValByStdCompiler(strEntry, strSection, iEntryNr, mkNamingAdapt(mkParAdapt(*pPlayer, &numbers), "Player"));
|
||||
pPlayer->DenumeratePointers();
|
||||
retval.Denumerate(&numbers);
|
||||
numbers.Denumerate();
|
||||
retval.Denumerate(&numbers);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
|
@ -1182,22 +1182,6 @@ void StdMeshInstance::AnimationNode::CompileFunc(StdCompiler* pComp, const StdMe
|
|||
}
|
||||
}
|
||||
|
||||
void StdMeshInstance::AnimationNode::EnumeratePointers()
|
||||
{
|
||||
SerializableValueProvider* value_provider = NULL;
|
||||
switch(Type)
|
||||
{
|
||||
case LeafNode:
|
||||
value_provider = dynamic_cast<SerializableValueProvider*>(Leaf.Position);
|
||||
break;
|
||||
case LinearInterpolationNode:
|
||||
value_provider = dynamic_cast<SerializableValueProvider*>(LinearInterpolation.Weight);
|
||||
break;
|
||||
}
|
||||
|
||||
if(value_provider) value_provider->EnumeratePointers();
|
||||
}
|
||||
|
||||
void StdMeshInstance::AnimationNode::DenumeratePointers()
|
||||
{
|
||||
SerializableValueProvider* value_provider = NULL;
|
||||
|
@ -1287,11 +1271,6 @@ void StdMeshInstance::AttachedMesh::CompileFunc(StdCompiler* pComp, DenumeratorF
|
|||
pComp->Value(mkParAdapt(*ChildDenumerator, this));
|
||||
}
|
||||
|
||||
void StdMeshInstance::AttachedMesh::EnumeratePointers()
|
||||
{
|
||||
ChildDenumerator->EnumeratePointers(this);
|
||||
}
|
||||
|
||||
void StdMeshInstance::AttachedMesh::DenumeratePointers()
|
||||
{
|
||||
ChildDenumerator->DenumeratePointers(this);
|
||||
|
@ -1854,16 +1833,6 @@ void StdMeshInstance::CompileFunc(StdCompiler* pComp, AttachedMesh::DenumeratorF
|
|||
}
|
||||
}
|
||||
|
||||
void StdMeshInstance::EnumeratePointers()
|
||||
{
|
||||
for(unsigned int i = 0; i < AnimationNodes.size(); ++i)
|
||||
if(AnimationNodes[i])
|
||||
AnimationNodes[i]->EnumeratePointers();
|
||||
|
||||
for(unsigned int i = 0; i < AttachChildren.size(); ++i)
|
||||
AttachChildren[i]->EnumeratePointers();
|
||||
}
|
||||
|
||||
void StdMeshInstance::DenumeratePointers()
|
||||
{
|
||||
for(unsigned int i = 0; i < AnimationNodes.size(); ++i)
|
||||
|
|
|
@ -451,7 +451,6 @@ public:
|
|||
}
|
||||
|
||||
virtual void CompileFunc(StdCompiler* pComp);
|
||||
virtual void EnumeratePointers() {}
|
||||
virtual void DenumeratePointers() {}
|
||||
};
|
||||
|
||||
|
@ -485,7 +484,6 @@ public:
|
|||
C4Real GetWeight() const { assert(Type == LinearInterpolationNode); return LinearInterpolation.Weight->Value; }
|
||||
|
||||
void CompileFunc(StdCompiler* pComp, const StdMesh* Mesh);
|
||||
void EnumeratePointers();
|
||||
void DenumeratePointers();
|
||||
|
||||
protected:
|
||||
|
@ -543,7 +541,6 @@ public:
|
|||
virtual ~Denumerator() {}
|
||||
|
||||
virtual void CompileFunc(StdCompiler* pComp, AttachedMesh* attach) = 0;
|
||||
virtual void EnumeratePointers(AttachedMesh* attach) {}
|
||||
virtual void DenumeratePointers(AttachedMesh* attach) {}
|
||||
};
|
||||
|
||||
|
@ -570,7 +567,6 @@ public:
|
|||
uint32_t GetFlags() const { return Flags; }
|
||||
|
||||
void CompileFunc(StdCompiler* pComp, DenumeratorFactoryFunc Factory);
|
||||
void EnumeratePointers();
|
||||
void DenumeratePointers();
|
||||
|
||||
private:
|
||||
|
@ -627,7 +623,6 @@ public:
|
|||
void ReorderFaces(StdMeshMatrix* global_trans);
|
||||
|
||||
void CompileFunc(StdCompiler* pComp, AttachedMesh::DenumeratorFactoryFunc Factory);
|
||||
void EnumeratePointers();
|
||||
void DenumeratePointers();
|
||||
|
||||
const StdMesh& Mesh;
|
||||
|
|
Loading…
Reference in New Issue