124 lines
4.6 KiB
C++
124 lines
4.6 KiB
C++
#ifndef _ITF_ANIMPACKERCONFIGURATION_H_
|
|
#define _ITF_ANIMPACKERCONFIGURATION_H_
|
|
|
|
#ifndef _ITF_SUBANIMLIGHTSET_H_
|
|
#include "engine/animation/SubAnimSet.h"
|
|
#endif //_ITF_SUBANIMLIGHTSET_H_
|
|
|
|
#ifndef _ITF_PLATFORM_H_
|
|
#include "core/Platform.h"
|
|
#endif //_ITF_PLATFORM_H_
|
|
|
|
#ifndef _ITF_PATH_H_
|
|
#include "core/file/Path.h"
|
|
#endif //_ITF_PATH_H_
|
|
|
|
namespace ITF
|
|
{
|
|
namespace AnimTexPacker
|
|
{
|
|
|
|
struct PackConfigSourceData
|
|
{
|
|
PackConfigSourceData()
|
|
: m_scale(1.f)
|
|
, m_sceneVersion(0)
|
|
, m_useDataFolder(btrue)
|
|
, m_useRelative(bfalse)
|
|
, m_subIlu(bfalse)
|
|
{
|
|
}
|
|
|
|
AnimResourcePackage m_resourcePackage;
|
|
|
|
f32 m_scale;
|
|
f32 m_sceneVersion;
|
|
bbool m_useDataFolder;
|
|
bbool m_useRelative;
|
|
bbool m_subIlu;
|
|
};
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////
|
|
///Configuration of animation packer
|
|
class AnimPackerConfiguration
|
|
{
|
|
public:
|
|
///////////////////////////////////////////////////////////////////////////////////////////
|
|
/// Description of size constraint on important bone
|
|
struct ImportantBone
|
|
{
|
|
String8 m_boneName;
|
|
int m_sizeInPixel;
|
|
};
|
|
///////////////////////////////////////////////////////////////////////////////////////////
|
|
///A PBK merge list
|
|
struct PbkConcatDesc
|
|
{
|
|
ITF_VECTOR<String8> m_pbkFilter;
|
|
///////////////////////////////////////////////////////////////////////////////////////////
|
|
///Parsing of PbkConcatDesc (pbk names separated by '+')
|
|
void makeFromString(String8 _desc);
|
|
///////////////////////////////////////////////////////////////////////////////////////////
|
|
/// does filename match?
|
|
bbool checkFileMatch(const String8 &_pbkBaseName /*WithoutExtension*/) const;
|
|
};
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////
|
|
///Several PBK merge lists
|
|
typedef ITF_LIST<PbkConcatDesc> PbkConcatDescList;
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////
|
|
AnimPackerConfiguration()
|
|
: m_maxElementSize(0)
|
|
, m_maxTextureSize(4096)
|
|
, m_processBankChange(bfalse)
|
|
, m_useSimpleMerge(bfalse)
|
|
, m_baseName("pbk")
|
|
, m_sampling(0)
|
|
, m_hdDownscale(1.f)
|
|
, m_hdDownscaleMask(0)
|
|
{
|
|
parsePbkConcatList("*");
|
|
}
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////
|
|
///Open configuration file and setup members
|
|
bbool openConfigurationFile(const Platform& _platform_w, const Path &_path);
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////
|
|
ITF_VECTOR<ImportantBone> m_importantBones;
|
|
PbkConcatDescList m_concatenatedPbkList;
|
|
PbkConcatDesc m_ignorePbkList;
|
|
PbkConcatDesc m_fullIgnorePbkList;
|
|
int m_maxElementSize;
|
|
int m_maxTextureSize;
|
|
Path m_mainPath;
|
|
String8 m_baseName;
|
|
Path m_outputPath;
|
|
bbool m_processBankChange;
|
|
bbool m_useSimpleMerge;
|
|
u32 m_sampling;
|
|
f32 m_hdDownscale;
|
|
u32 m_hdDownscaleMask;
|
|
PackConfigSourceData m_packConfigSrc;
|
|
|
|
//parse list of pbk concatenations
|
|
void parsePbkConcatList(String8 _desc);
|
|
void parsePbkIgnoreList(String8 _ignore);
|
|
void parsePbkFullIgnoreList(String8 _fullIgnore);
|
|
|
|
private:
|
|
|
|
//Display error message
|
|
void incorrectConfigurationFile();
|
|
//Parse important bone declaration : bone=size
|
|
bbool parseImportantBone(const String8 &_importantBoneDecl);
|
|
//
|
|
bbool parseImportantBoneList(String8 _importantBoneList);
|
|
|
|
};
|
|
}
|
|
}
|
|
|
|
|
|
#endif
|