mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-07 03:12:36 +01:00
4fd92a1549
Also move up source files into the root directory, as there's nothing else in this directory
64 lines
1.6 KiB
C++
64 lines
1.6 KiB
C++
#ifndef _LIBRW_LOADERDFF_HPP_
|
|
#define _LIBRW_LOADERDFF_HPP_
|
|
|
|
#include <data/Clump.hpp>
|
|
#include <gl/TextureData.hpp>
|
|
#include <rw/forward.hpp>
|
|
|
|
#include <functional>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
class RWBStream;
|
|
|
|
class DFFLoaderException {
|
|
std::string _message;
|
|
|
|
public:
|
|
template <class String>
|
|
DFFLoaderException(String&& message) : _message(message) {
|
|
}
|
|
|
|
const std::string& which() {
|
|
return _message;
|
|
}
|
|
};
|
|
|
|
class LoaderDFF {
|
|
public:
|
|
using TextureLookupCallback = std::function<TextureData::Handle(
|
|
const std::string&, const std::string&)>;
|
|
using GeometryList = std::vector<GeometryPtr>;
|
|
using FrameList = std::vector<ModelFramePtr>;
|
|
|
|
ClumpPtr loadFromMemory(const FileContentsInfo& file);
|
|
|
|
void setTextureLookupCallback(const TextureLookupCallback& tlc) {
|
|
texturelookup = tlc;
|
|
}
|
|
|
|
private:
|
|
TextureLookupCallback texturelookup;
|
|
|
|
FrameList readFrameList(const RWBStream& stream);
|
|
|
|
GeometryList readGeometryList(const RWBStream& stream);
|
|
|
|
GeometryPtr readGeometry(const RWBStream& stream);
|
|
|
|
void readMaterialList(const GeometryPtr& geom, const RWBStream& stream);
|
|
|
|
void readMaterial(const GeometryPtr& geom, const RWBStream& stream);
|
|
|
|
void readTexture(Geometry::Material& material, const RWBStream& stream);
|
|
|
|
void readGeometryExtension(const GeometryPtr& geom, const RWBStream& stream);
|
|
|
|
void readBinMeshPLG(const GeometryPtr& geom, const RWBStream& stream);
|
|
|
|
AtomicPtr readAtomic(FrameList& framelist, GeometryList& geometrylist,
|
|
const RWBStream& stream);
|
|
};
|
|
|
|
#endif
|