OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4DefList.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 /* Object definition */
19 
20 #ifndef INC_C4DefList
21 #define INC_C4DefList
22 
24 
26 {
27 public:
28  C4DefList();
29  virtual ~C4DefList();
30 public:
32  typedef std::map<C4ID, C4Def*> Table;
33  Table table;
34 protected:
36 public:
37  void Default();
38  void Clear();
39  int32_t Load(C4Group &hGroup,
40  DWORD dwLoadWhat, const char *szLanguage,
41  C4SoundSystem *pSoundSystem = nullptr,
42  bool fOverload = false,
43  bool fSearchMessage = false, int32_t iMinProgress=0, int32_t iMaxProgress=0, bool fLoadSysGroups = true);
44  int32_t Load(const char *szFilename,
45  DWORD dwLoadWhat, const char *szLanguage,
46  C4SoundSystem *pSoundSystem = nullptr,
47  bool fOverload = false, int32_t iMinProgress=0, int32_t iMaxProgress=0);
48  C4Def *ID2Def(C4ID id);
49  C4Def *GetDef(int32_t Index);
50  std::vector<C4Def*> GetAllDefs(C4String *filter_property=nullptr) const;
51  C4Def *GetByPath(const char *szPath);
52  C4Def *GetByName(const StdStrBuf &);
53  int32_t GetDefCount();
54  int32_t GetIndex(C4ID id);
55  int32_t RemoveTemporary();
56  int32_t CheckEngineVersion(int32_t ver1, int32_t ver2);
57  int32_t CheckRequireDef();
58  void Draw(C4ID id, C4Facet &cgo, bool fSelected, int32_t iColor);
59  void Remove(C4Def *def);
60  bool Remove(C4ID id);
61  bool Reload(C4Def *pDef, DWORD dwLoadWhat, const char *szLanguage, C4SoundSystem *pSoundSystem = nullptr);
62  bool Add(C4Def *ndef, bool fOverload);
63  void BuildTable();
64  void ResetIncludeDependencies(); // resets all pointers into foreign definitions caused by include chains
65  void CallEveryDefinition();
66  void SortByPriority();
67  void Synchronize();
70 
71  // callback from font renderer: get ID image
72  virtual bool DrawFontImage(const char* szImageTag, C4Facet& rTarget, C4DrawTransform* pTransform);
73  virtual float GetFontImageAspect(const char* szImageTag);
74 private:
75  std::unique_ptr<StdMeshSkeletonLoader> SkeletonLoader;
76 };
77 
78 extern C4DefList Definitions;
79 
80 inline C4Def *C4Id2Def(C4ID id)
81 {
83 }
84 
85 #endif
86 
C4Def * ID2Def(C4ID id)
virtual ~C4DefList()
C4Def * GetDef(int32_t Index)
C4DefList Definitions
Definition: C4Globals.cpp:49
void BuildTable()
Definition: C4DefList.cpp:500
C4Def * GetByPath(const char *szPath)
Definition: C4DefList.cpp:309
virtual float GetFontImageAspect(const char *szImageTag)
Definition: stub-handle.cpp:80
bool Add(C4Def *ndef, bool fOverload)
int32_t GetDefCount()
bool Reload(C4Def *pDef, DWORD dwLoadWhat, const char *szLanguage, C4SoundSystem *pSoundSystem=nullptr)
Definition: C4DefList.cpp:406
virtual bool DrawFontImage(const char *szImageTag, C4Facet &rTarget, C4DrawTransform *pTransform)
Definition: stub-handle.cpp:79
StdMeshSkeletonLoader & GetSkeletonLoader()
Definition: C4DefList.cpp:512
void AppendAndIncludeSkeletons()
Definition: C4DefList.cpp:507
void Remove(C4Def *def)
Definition: C4DefList.cpp:208
void CallEveryDefinition()
Definition: stub-handle.cpp:77
int32_t CheckRequireDef()
Definition: C4DefList.cpp:370
Definition: C4Def.h:100
void Clear()
C4Def * GetByName(const StdStrBuf &)
Definition: C4Id.h:28
int32_t Load(C4Group &hGroup, DWORD dwLoadWhat, const char *szLanguage, C4SoundSystem *pSoundSystem=nullptr, bool fOverload=false, bool fSearchMessage=false, int32_t iMinProgress=0, int32_t iMaxProgress=0, bool fLoadSysGroups=true)
Definition: C4DefList.cpp:74
bool LoadFailure
Definition: C4DefList.h:31
void ResetIncludeDependencies()
Definition: stub-handle.cpp:78
void Draw(C4ID id, C4Facet &cgo, bool fSelected, int32_t iColor)
Definition: C4DefList.cpp:393
void Default()
Definition: C4DefList.cpp:399
void SortByPriority()
Definition: stub-handle.cpp:76
void Synchronize()
Definition: C4DefList.cpp:444
int32_t GetIndex(C4ID id)
Definition: C4DefList.cpp:261
C4Def * C4Id2Def(C4ID id)
Definition: C4DefList.h:80
std::map< C4ID, C4Def * > Table
Definition: C4DefList.h:32
int32_t CheckEngineVersion(int32_t ver1, int32_t ver2)
Definition: C4DefList.cpp:351
int32_t RemoveTemporary()
Definition: C4DefList.cpp:329
uint32_t DWORD
std::vector< C4Def * > GetAllDefs(C4String *filter_property=nullptr) const
Definition: C4DefList.cpp:290
C4Def * FirstDef
Definition: C4DefList.h:35
Table table
Definition: C4DefList.h:33