2011-03-03 16:10:22 +00:00
|
|
|
/*
|
|
|
|
* OpenClonk, http://www.openclonk.org
|
|
|
|
*
|
2013-12-17 20:01:09 +00:00
|
|
|
* Copyright (c) 1998-2000, Matthes Bender
|
|
|
|
* Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de/
|
2016-04-03 18:18:29 +00:00
|
|
|
* Copyright (c) 2009-2016, The OpenClonk Team and contributors
|
2011-03-03 16:10:22 +00:00
|
|
|
*
|
2013-12-17 20:01:09 +00:00
|
|
|
* Distributed under the terms of the ISC license; see accompanying file
|
|
|
|
* "COPYING" for details.
|
2011-03-03 16:10:22 +00:00
|
|
|
*
|
2013-12-17 20:01:09 +00:00
|
|
|
* "Clonk" is a registered trademark of Matthes Bender, used with permission.
|
|
|
|
* See accompanying file "TRADEMARK" for details.
|
2011-03-03 16:10:22 +00:00
|
|
|
*
|
2013-12-17 20:01:09 +00:00
|
|
|
* To redistribute this file separately, substitute the full license texts
|
|
|
|
* for the above references.
|
2011-03-03 16:10:22 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* Object definition */
|
|
|
|
|
|
|
|
#ifndef INC_C4DefList
|
|
|
|
#define INC_C4DefList
|
|
|
|
|
2016-10-22 11:19:22 +00:00
|
|
|
#include "graphics/C4FontLoaderCustomImages.h"
|
2011-03-11 02:43:38 +00:00
|
|
|
|
2016-10-22 11:19:22 +00:00
|
|
|
class C4DefList: public CStdFontCustomImages
|
2011-03-03 16:10:22 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
C4DefList();
|
|
|
|
virtual ~C4DefList();
|
|
|
|
public:
|
|
|
|
bool LoadFailure;
|
|
|
|
typedef std::map<C4ID, C4Def*> Table;
|
|
|
|
Table table;
|
|
|
|
protected:
|
|
|
|
C4Def *FirstDef;
|
|
|
|
public:
|
|
|
|
void Default();
|
|
|
|
void Clear();
|
|
|
|
int32_t Load(C4Group &hGroup,
|
|
|
|
DWORD dwLoadWhat, const char *szLanguage,
|
|
|
|
C4SoundSystem *pSoundSystem = NULL,
|
|
|
|
bool fOverload = false,
|
|
|
|
bool fSearchMessage = false, int32_t iMinProgress=0, int32_t iMaxProgress=0, bool fLoadSysGroups = true);
|
2012-01-27 23:33:28 +00:00
|
|
|
int32_t Load(const char *szFilename,
|
2011-03-03 16:10:22 +00:00
|
|
|
DWORD dwLoadWhat, const char *szLanguage,
|
|
|
|
C4SoundSystem *pSoundSystem = NULL,
|
|
|
|
bool fOverload = false, int32_t iMinProgress=0, int32_t iMaxProgress=0);
|
|
|
|
C4Def *ID2Def(C4ID id);
|
2011-03-07 20:26:56 +00:00
|
|
|
C4Def *GetDef(int32_t Index);
|
2016-04-09 18:20:31 +00:00
|
|
|
std::vector<C4Def*> GetAllDefs(C4String *filter_property=NULL) const;
|
2011-03-03 16:10:22 +00:00
|
|
|
C4Def *GetByPath(const char *szPath);
|
2013-03-03 18:25:18 +00:00
|
|
|
C4Def *GetByName(const StdStrBuf &);
|
2011-03-07 20:26:56 +00:00
|
|
|
int32_t GetDefCount();
|
2011-03-03 16:10:22 +00:00
|
|
|
int32_t GetIndex(C4ID id);
|
|
|
|
int32_t RemoveTemporary();
|
2014-12-12 20:57:52 +00:00
|
|
|
int32_t CheckEngineVersion(int32_t ver1, int32_t ver2);
|
2011-03-03 16:10:22 +00:00
|
|
|
int32_t CheckRequireDef();
|
|
|
|
void Draw(C4ID id, C4Facet &cgo, bool fSelected, int32_t iColor);
|
|
|
|
void Remove(C4Def *def);
|
|
|
|
bool Remove(C4ID id);
|
|
|
|
bool Reload(C4Def *pDef, DWORD dwLoadWhat, const char *szLanguage, C4SoundSystem *pSoundSystem = NULL);
|
|
|
|
bool Add(C4Def *ndef, bool fOverload);
|
|
|
|
void BuildTable();
|
|
|
|
void ResetIncludeDependencies(); // resets all pointers into foreign definitions caused by include chains
|
|
|
|
void CallEveryDefinition();
|
2016-06-07 22:22:43 +00:00
|
|
|
void SortByPriority();
|
2011-03-03 16:10:22 +00:00
|
|
|
void Synchronize();
|
2014-12-26 12:46:14 +00:00
|
|
|
void AppendAndIncludeSkeletons();
|
|
|
|
StdMeshSkeletonLoader& GetSkeletonLoader();
|
2011-03-03 16:10:22 +00:00
|
|
|
|
|
|
|
// callback from font renderer: get ID image
|
2012-01-10 21:40:46 +00:00
|
|
|
virtual bool DrawFontImage(const char* szImageTag, C4Facet& rTarget, C4DrawTransform* pTransform);
|
|
|
|
virtual float GetFontImageAspect(const char* szImageTag);
|
2014-12-26 13:46:31 +00:00
|
|
|
private:
|
|
|
|
std::unique_ptr<StdMeshSkeletonLoader> SkeletonLoader;
|
2011-03-03 16:10:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern C4DefList Definitions;
|
|
|
|
|
|
|
|
inline C4Def *C4Id2Def(C4ID id)
|
|
|
|
{
|
|
|
|
return ::Definitions.ID2Def(id);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|