2013-07-02 07:06:03 +01:00
|
|
|
#pragma once
|
2013-07-02 08:40:43 +02:00
|
|
|
#ifndef _LOADERDFF_HPP_
|
|
|
|
#define _LOADERDFF_HPP_
|
2013-07-02 07:06:03 +01:00
|
|
|
|
2016-04-07 01:13:46 +01:00
|
|
|
#include <loaders/RWBinaryStream.hpp>
|
2013-07-02 07:06:03 +01:00
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
2016-04-07 01:13:46 +01:00
|
|
|
#include <platform/FileHandle.hpp>
|
2015-03-06 04:38:22 +00:00
|
|
|
#include <data/ResourceHandle.hpp>
|
2013-07-02 07:06:03 +01:00
|
|
|
|
2013-09-25 09:05:18 +01:00
|
|
|
class Model;
|
2013-12-20 16:02:46 +00:00
|
|
|
class GameData;
|
2013-07-02 07:06:03 +01:00
|
|
|
|
2014-08-04 22:21:01 +01:00
|
|
|
class DFFLoaderException
|
|
|
|
{
|
|
|
|
std::string _message;
|
|
|
|
public:
|
|
|
|
|
|
|
|
DFFLoaderException(const std::string& message)
|
|
|
|
: _message(message)
|
|
|
|
{}
|
|
|
|
|
|
|
|
const std::string& which() { return _message; }
|
|
|
|
};
|
|
|
|
|
2013-07-02 07:06:03 +01:00
|
|
|
class LoaderDFF
|
|
|
|
{
|
2014-08-04 22:21:01 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief loads a Frame List chunk from stream into model.
|
|
|
|
* @param model
|
|
|
|
* @param stream
|
|
|
|
*/
|
|
|
|
void readFrameList(Model* model, const RWBStream &stream);
|
|
|
|
|
|
|
|
void readGeometryList(Model* model, const RWBStream& stream);
|
|
|
|
|
|
|
|
void readGeometry(Model* model, const RWBStream& stream);
|
|
|
|
|
|
|
|
void readMaterialList(Model* model, const RWBStream& stream);
|
|
|
|
|
|
|
|
void readMaterial(Model* model, const RWBStream& stream);
|
|
|
|
|
|
|
|
void readTexture(Model* model, const RWBStream& stream);
|
|
|
|
|
|
|
|
void readGeometryExtension(Model* model, const RWBStream& stream);
|
|
|
|
|
|
|
|
void readBinMeshPLG(Model* model, const RWBStream& stream);
|
|
|
|
|
|
|
|
void readAtomic(Model* model, const RWBStream& stream);
|
2013-07-02 07:06:03 +01:00
|
|
|
|
|
|
|
public:
|
2015-03-06 04:38:22 +00:00
|
|
|
Model* loadFromMemory(FileHandle file);
|
2014-06-04 11:53:11 +01:00
|
|
|
};
|
|
|
|
|
2013-07-24 01:44:08 +01:00
|
|
|
#endif
|