mirror of
https://github.com/minetest/irrlicht.git
synced 2025-02-20 13:00:18 +01:00
Add r-value reference constructor to ModelParser
This commit is contained in:
parent
85fdf95afa
commit
50da04297f
@ -19,6 +19,7 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
// A helper function to disable tinygltf embedded image loading
|
||||
@ -106,7 +107,7 @@ IAnimatedMesh* CGLTFMeshFileLoader::createMesh(io::IReadFile* file)
|
||||
std::vector<u16> indicesBuffer(model.accessors[
|
||||
indicesAccessorId].count);
|
||||
|
||||
ModelParser parser(model);
|
||||
ModelParser parser(std::move(model));
|
||||
|
||||
parser.getIndices(indicesAccessorId, indicesBuffer);
|
||||
parser.getVertices(positionAccessorId,
|
||||
@ -141,6 +142,12 @@ CGLTFMeshFileLoader::ModelParser::ModelParser(
|
||||
{
|
||||
}
|
||||
|
||||
CGLTFMeshFileLoader::ModelParser::ModelParser(
|
||||
const tinygltf::Model&& model)
|
||||
: m_model(model)
|
||||
{
|
||||
}
|
||||
|
||||
void CGLTFMeshFileLoader::ModelParser::getIndices(
|
||||
const std::size_t accessorId,
|
||||
std::vector<u16>& outIndices) const
|
||||
|
@ -58,6 +58,8 @@ private:
|
||||
public:
|
||||
ModelParser(const tinygltf::Model& model);
|
||||
|
||||
ModelParser(const tinygltf::Model&& model);
|
||||
|
||||
void getIndices(const std::size_t accessorId,
|
||||
std::vector<u16>& outIndices) const;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user