2015-07-26 21:39:49 +00:00
|
|
|
#ifndef CMATERIALLOADER_H
|
|
|
|
#define CMATERIALLOADER_H
|
|
|
|
|
|
|
|
#include "../CMaterialSet.h"
|
|
|
|
#include "../EFormatVersion.h"
|
|
|
|
#include <Core/CResCache.h>
|
|
|
|
|
2015-08-10 13:47:00 +00:00
|
|
|
#include <FileIO/FileIO.h>
|
|
|
|
#include <assimp/scene.h>
|
|
|
|
|
2015-07-26 21:39:49 +00:00
|
|
|
class CMaterialLoader
|
|
|
|
{
|
|
|
|
// Material data
|
|
|
|
CMaterialSet *mpSet;
|
|
|
|
CInputStream *mpFile;
|
|
|
|
EGame mVersion;
|
2015-08-01 03:44:50 +00:00
|
|
|
std::vector<CTexture*> mTextures;
|
2015-07-26 21:39:49 +00:00
|
|
|
bool mHasOPAC;
|
|
|
|
bool mHas0x400;
|
|
|
|
|
|
|
|
CColor mCorruptionColors[4];
|
|
|
|
u8 mCorruptionInts[5];
|
|
|
|
u32 mCorruptionFlags;
|
|
|
|
std::vector<u32> mPassOffsets;
|
|
|
|
|
|
|
|
CMaterialLoader();
|
|
|
|
~CMaterialLoader();
|
|
|
|
|
|
|
|
// Load Functions
|
|
|
|
void ReadPrimeMatSet();
|
|
|
|
CMaterial* ReadPrimeMaterial();
|
|
|
|
|
|
|
|
void ReadCorruptionMatSet();
|
|
|
|
CMaterial* ReadCorruptionMaterial();
|
|
|
|
void CreateCorruptionPasses(CMaterial *pMat);
|
|
|
|
|
2015-08-10 13:47:00 +00:00
|
|
|
CMaterial* LoadAssimpMaterial(const aiMaterial *pAiMat);
|
|
|
|
|
2015-08-08 15:21:49 +00:00
|
|
|
// Static
|
2015-07-26 21:39:49 +00:00
|
|
|
public:
|
|
|
|
static CMaterialSet* LoadMaterialSet(CInputStream& Mat, EGame Version);
|
2015-08-10 13:47:00 +00:00
|
|
|
static CMaterialSet* ImportAssimpMaterials(const aiScene *pScene, EGame targetVersion);
|
2015-07-26 21:39:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CMATERIALLOADER_H
|