OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
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 #include "lib/StdMesh.h"
19 #include "object/C4ObjectPtr.h"
20 
21 // Helper struct to serialize an object's mesh instance with other object's mesh instances attached
23 {
24 private:
25  C4Def* Def; // Set if a definition mesh was attached
26  C4ObjectPtr Object; // Set if an instance mesh was attached
27 
28 public:
29  C4MeshDenumerator(): Def(nullptr), Object(nullptr) {}
30  C4MeshDenumerator(C4Def* def): Def(def), Object(nullptr) {}
31  C4MeshDenumerator(C4Object* object): Def(nullptr), Object(object) {}
32 
33  C4Object* GetObject() { return Object; }
34 
35  virtual void CompileFunc(StdCompiler* pComp, StdMeshInstance::AttachedMesh* attach);
37  virtual bool ClearPointers(C4Object* pObj);
38 };
39 
const StdMeshInstance::AttachedMesh::DenumeratorFactoryFunc C4MeshDenumeratorFactory
C4MeshDenumerator(C4Object *object)
virtual void CompileFunc(StdCompiler *pComp, StdMeshInstance::AttachedMesh *attach)
Denumerator *(* DenumeratorFactoryFunc)()
Definition: StdMesh.h:501
C4Object * GetObject()
Definition: C4Def.h:100
virtual void DenumeratePointers(StdMeshInstance::AttachedMesh *attach)
virtual bool ClearPointers(C4Object *pObj)
C4MeshDenumerator(C4Def *def)