mirror of
https://github.com/minetest/irrlicht.git
synced 2024-11-11 21:00:35 +01:00
51 lines
1.1 KiB
C++
51 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include "IAnimatedMesh.h"
|
|
#include "IMeshLoader.h"
|
|
#include "CSkinnedMesh.h"
|
|
#include "IReadFile.h"
|
|
#include "SB3DStructs.h"
|
|
#include "path.h"
|
|
#include "json/json.hpp"
|
|
#include <tuple>
|
|
|
|
using json = nlohmann::json;
|
|
|
|
namespace irr
|
|
{
|
|
|
|
namespace scene
|
|
{
|
|
|
|
class CB3DJSONMeshFileLoader : public IMeshLoader
|
|
{
|
|
private:
|
|
// Fields.
|
|
CSkinnedMesh* AnimatedMesh;
|
|
core::array<SB3dTexture> Textures;
|
|
/*
|
|
Quick note about JSON.
|
|
This is static memory, it's a static memory address so I do not think
|
|
that this needs to be freed.
|
|
So once this model goes out of scope, I'm pretty sure that this will
|
|
be pointing to the next model. Or maybe the last model loaded.
|
|
*/
|
|
json JSONDataContainer;
|
|
|
|
// Methods.
|
|
CSkinnedMesh* cleanUp(std::string);
|
|
std::tuple<bool, std::string> parseJSONFile(io::IReadFile* file);
|
|
std::tuple<bool, std::string> load();
|
|
std::tuple<bool, std::string> readChunkTEXS();
|
|
|
|
public:
|
|
|
|
CB3DJSONMeshFileLoader();
|
|
|
|
bool isALoadableFileExtension(const io::path& fileName) const override;
|
|
|
|
IAnimatedMesh* createMesh(io::IReadFile* file) override;
|
|
|
|
};// class CB3DJSONMeshFileLoader
|
|
} // namespace scene
|
|
} // namespace irr
|