From 7028cbe09c688437910a25623098762bf0fa592d Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Mon, 28 Mar 2016 22:28:34 +1000 Subject: Move Irrlicht to src/others. --- .../source/Irrlicht/CMD3MeshFileLoader.cpp | 53 ++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/others/irrlicht-1.8.1/source/Irrlicht/CMD3MeshFileLoader.cpp (limited to 'src/others/irrlicht-1.8.1/source/Irrlicht/CMD3MeshFileLoader.cpp') diff --git a/src/others/irrlicht-1.8.1/source/Irrlicht/CMD3MeshFileLoader.cpp b/src/others/irrlicht-1.8.1/source/Irrlicht/CMD3MeshFileLoader.cpp new file mode 100644 index 0000000..68f8d80 --- /dev/null +++ b/src/others/irrlicht-1.8.1/source/Irrlicht/CMD3MeshFileLoader.cpp @@ -0,0 +1,53 @@ +// Copyright (C) 2002-2012 Nikolaus Gebhardt +// This file is part of the "Irrlicht Engine". +// For conditions of distribution and use, see copyright notice in irrlicht.h + +#include "IrrCompileConfig.h" +#ifdef _IRR_COMPILE_WITH_MD3_LOADER_ + +#include "CMD3MeshFileLoader.h" +#include "CAnimatedMeshMD3.h" +#include "irrString.h" + +namespace irr +{ +namespace scene +{ + +//! Constructor +CMD3MeshFileLoader::CMD3MeshFileLoader( scene::ISceneManager* smgr) +: SceneManager(smgr) +{ +} + + +//! destructor +CMD3MeshFileLoader::~CMD3MeshFileLoader() +{ +} + + +//! returns true if the file maybe is able to be loaded by this class +//! based on the file extension (e.g. ".bsp") +bool CMD3MeshFileLoader::isALoadableFileExtension(const io::path& filename) const +{ + return core::hasFileExtension ( filename, "md3" ); +} + + +IAnimatedMesh* CMD3MeshFileLoader::createMesh(io::IReadFile* file) +{ + CAnimatedMeshMD3 * mesh = new CAnimatedMeshMD3(); + + if ( mesh->loadModelFile ( 0, file, SceneManager->getFileSystem(), SceneManager->getVideoDriver() ) ) + return mesh; + + mesh->drop (); + return 0; +} + + +} // end namespace scene +} // end namespace irr + +#endif // _IRR_COMPILE_WITH_MD3_LOADER_ -- cgit v1.1