2016-12-11 16:46:22 +00:00
|
|
|
#pragma once
|
2016-12-12 15:47:38 +00:00
|
|
|
#include "FileInterface.h"
|
2016-12-11 16:46:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
struct ChunkHeader {
|
|
|
|
char name[5];
|
|
|
|
std::uint32_t size;
|
|
|
|
std::streampos position;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2016-12-12 15:47:38 +00:00
|
|
|
class MshFile : public FileInterface
|
2016-12-11 16:46:22 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
MshFile(const char* path);
|
|
|
|
~MshFile();
|
|
|
|
|
|
|
|
private:
|
2016-12-12 15:47:38 +00:00
|
|
|
virtual void import() override final;
|
2016-12-11 16:46:22 +00:00
|
|
|
|
|
|
|
void loadChunks(std::list<ChunkHeader*> &destination, std::streampos start, const std::uint32_t length);
|
|
|
|
|
|
|
|
void analyseMsh2Chunks(std::list<ChunkHeader*> &chunkList);
|
|
|
|
|
|
|
|
void analyseMatdChunks(std::list<ChunkHeader*> &chunkList);
|
|
|
|
|
|
|
|
void analyseModlChunks(Model* dataDestination, std::list<ChunkHeader*> &chunkList);
|
|
|
|
void analyseGeomChunks(Model* dataDestination, std::list<ChunkHeader*> &chunkList);
|
|
|
|
void analyseSegmChunks(Model* dataDestination, std::list<ChunkHeader*> &chunkList);
|
|
|
|
void analyseClthChunks(Model* dataDestination, std::list<ChunkHeader*> &chunkList);
|
|
|
|
|
|
|
|
void readVertex(Segment* dataDestination, std::streampos position);
|
|
|
|
void readUV(Segment* dataDestination, std::streampos position);
|
|
|
|
};
|