OpenClonk
C4MeshDenumerator.h
Go to the documentation of this file.
1 /*
2  * OpenClonk, http://www.openclonk.org
3  *
4  * Copyright (c) 1998-2000, Matthes Bender
5  * Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de/
6  * Copyright (c) 2009-2016, The OpenClonk Team and contributors
7  *
8  * Distributed under the terms of the ISC license; see accompanying file
9  * "COPYING" for details.
10  *
11  * "Clonk" is a registered trademark of Matthes Bender, used with permission.
12  * See accompanying file "TRADEMARK" for details.
13  *
14  * To redistribute this file separately, substitute the full license texts
15  * for the above references.
16  */
17 
18 #ifndef INC_C4MeshDenumerator
19 #define INC_C4MeshDenumerator
20 
21 #include "lib/StdMesh.h"
22 #include "object/C4ObjectPtr.h"
23 
24 // Helper struct to serialize an object's mesh instance with other object's mesh instances attached
26 {
27 private:
28  C4Def* Def{nullptr}; // Set if a definition mesh was attached
29  C4ObjectPtr Object; // Set if an instance mesh was attached
30 
31 public:
32  C4MeshDenumerator(): Object(nullptr) {}
33  C4MeshDenumerator(C4Def* def): Def(def), Object(nullptr) {}
34  C4MeshDenumerator(C4Object* object): Def(nullptr), Object(object) {}
35 
36  C4Object* GetObject() { return Object; }
37 
38  void CompileFunc(StdCompiler* pComp, StdMeshInstance::AttachedMesh* attach) override;
40  bool ClearPointers(C4Object* pObj) override;
41 };
42 
44 
45 #endif
C4Object * Object(C4PropList *_this)
Definition: C4AulDefFunc.h:34
const StdMeshInstance::AttachedMesh::DenumeratorFactoryFunc C4MeshDenumeratorFactory
Definition: C4Def.h:99
C4MeshDenumerator(C4Object *object)
C4Object * GetObject()
void DenumeratePointers(StdMeshInstance::AttachedMesh *attach) override
C4MeshDenumerator(C4Def *def)
void CompileFunc(StdCompiler *pComp, StdMeshInstance::AttachedMesh *attach) override
bool ClearPointers(C4Object *pObj) override
Denumerator *(* DenumeratorFactoryFunc)()
Definition: StdMesh.h:499