Add a few corrections
MODIFY
src/irr/asset/CBufferLoaderBIN.cpp
src/irr/asset/CBufferLoaderBIN.cpp
@@ -12,7 +12,7 @@ namespace irr
SContext ctx(_file->getSize());
ctx.file = _file;
- ctx.file->read(ctx.sourceCodeBuffer.get(), ctx.file->getSize());
+ ctx.file->read(ctx.sourceCodeBuffer.get()->getPointer(), ctx.file->getSize());
return SAssetBundle({std::move(ctx.sourceCodeBuffer)});
}

MODIFY
src/irr/asset/CBufferLoaderBIN.h
src/irr/asset/CBufferLoaderBIN.h
@@ -12,23 +12,23 @@ namespace irr
namespace asset
{
//! Binaryloader capable of loading source code in binary format
- class CBufferLoaderBIN : public asset::IAssetLoader
+ class CBufferLoaderBIN final : public asset::IAssetLoader
{
protected:
~CBufferLoaderBIN();
public:
- virtual bool isALoadableFileFormat(io::IReadFile* _file) const override;
+ bool isALoadableFileFormat(io::IReadFile* _file) const override;
- virtual const char** getAssociatedFileExtensions() const override
+ const char** getAssociatedFileExtensions() const override
{
static const char* extensions[]{ "bin", nullptr };
return extensions;
}
- virtual uint64_t getSupportedAssetTypesBitfield() const override { return asset::IAsset::ET_BUFFER; }
+ uint64_t getSupportedAssetTypesBitfield() const override { return asset::IAsset::ET_BUFFER; }
- virtual asset::SAssetBundle loadAsset(io::IReadFile* _file, const asset::IAssetLoader::SAssetLoadParams& _params, asset::IAssetLoader::IAssetLoaderOverride* _override = nullptr, uint32_t _hierarchyLevel = 0u) override;
+ asset::SAssetBundle loadAsset(io::IReadFile* _file, const asset::IAssetLoader::SAssetLoadParams& _params, asset::IAssetLoader::IAssetLoaderOverride* _override = nullptr, uint32_t _hierarchyLevel = 0u) override;
private:
struct SContext
@@ -37,8 +37,6 @@ namespace irr
io::IReadFile* file;
core::smart_refctd_ptr<ICPUBuffer> sourceCodeBuffer;
};
-
- void loadEntireSourceCode(SContext& _ctx);
};
}
}

MODIFY
src/irr/asset/CSTLMeshFileLoader.cpp
src/irr/asset/CSTLMeshFileLoader.cpp
@@ -78,22 +78,13 @@ asset::SAssetBundle CSTLMeshFileLoader::loadAsset(io::IReadFile* _file, const as
auto performActionBasedOnOrientationSystem = [&](auto performOnRightHanded, auto performOnLeftHanded = [&](void) {})
{
- switch (_params.loaderFlags)
- {
- case E_LOADER_PARAMETER_FLAGS::ELPF_RIGHT_HANDED_MESHES:
- {
+ if(_params.loaderFlags & E_LOADER_PARAMETER_FLAGS::ELPF_RIGHT_HANDED_MESHES)
performOnRightHanded();
- break;
- }
- default:
- {
+ else
performOnLeftHanded();
- break;
- }
- }
};
- performActionBasedOnOrientationSystem([&]() {n.z = -n.z;}, [&]() {});
+ performActionBasedOnOrientationSystem([&]() {n.x = -n.x;}, [&]() {});
normals.push_back(core::normalize(n));
if (!binary)

Add a few corrections