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. --- .../irrlicht-1.8.1/source/Irrlicht/CDMFLoader.h | 91 ++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 src/others/irrlicht-1.8.1/source/Irrlicht/CDMFLoader.h (limited to 'src/others/irrlicht-1.8.1/source/Irrlicht/CDMFLoader.h') diff --git a/src/others/irrlicht-1.8.1/source/Irrlicht/CDMFLoader.h b/src/others/irrlicht-1.8.1/source/Irrlicht/CDMFLoader.h new file mode 100644 index 0000000..a314913 --- /dev/null +++ b/src/others/irrlicht-1.8.1/source/Irrlicht/CDMFLoader.h @@ -0,0 +1,91 @@ +// 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 +// +// This file was originally written by Salvatore Russo. +// I (Nikolaus Gebhardt) did some minor modifications changes to it and integrated +// it into Irrlicht: +// - removed STL dependency +// - removed log file and replaced it with irrlicht logging +// - adapted code formatting a bit to Irrlicht style +// - removed memory leaks +// Thanks a lot to Salvatore for his work on this and that he gave me +// his permission to add it into Irrlicht. + +/* + CDMFLoader by Salvatore Russo + Version 1.3 + + This loader is used to load DMF files in Irrlicht. + Look at the documentation for a sample application. + + Parts of this code are from Murphy McCauley COCTLoader just like + GetFaceNormal() or indexes creation routines and a routine to add faces. So + please refer to COCTLoader.h to know more about rights granted. + + You can use this software as you wish but you must not remove these notes about license nor + credits to others for parts of this code. +*/ + +#ifndef __C_DMF_LOADER_H_INCLUDED__ +#define __C_DMF_LOADER_H_INCLUDED__ + +#include "IMeshLoader.h" +#include "IReadFile.h" +#include "IFileSystem.h" +#include "SMesh.h" +#include "IVideoDriver.h" +#include "ISceneManager.h" +#include "SAnimatedMesh.h" + +namespace irr +{ +namespace scene +{ + /** A class to load DeleD mesh files.*/ + class CDMFLoader : public IMeshLoader + { + public: + + /** constructor*/ + CDMFLoader(ISceneManager* smgr, io::IFileSystem* filesys); + + //! returns true if the file maybe is able to be loaded by this class + //! based on the file extension (e.g. ".cob") + virtual bool isALoadableFileExtension(const io::path& filename) const; + + /** creates/loads an animated mesh from the file. + \return Pointer to the created mesh. Returns 0 if loading failed. + If you no longer need the mesh, you should call IAnimatedMesh::drop(). + See IReferenceCounted::drop() for more information.*/ + virtual IAnimatedMesh* createMesh(io::IReadFile* file); + + /** loads dynamic lights present in this scene. + Note that loaded lights from DeleD must have the suffix \b dynamic_ and must be \b pointlight. + Irrlicht correctly loads specular color, diffuse color , position and distance of object affected by light. + \return number of lights loaded or 0 if loading failed.*/ + int loadLights(const c8 * filename, ISceneManager* smgr, + ISceneNode* parent = 0, s32 base_id = 1000); + + /** loads water plains present in this scene. + Note that loaded water plains from DeleD must have the suffix \b water_ and must be \b rectangle (with just 1 rectangular face). + Irrlicht correctly loads position and rotation of water plain as well as texture layers. + \return number of water plains loaded or 0 if loading failed.*/ + int loadWaterPlains(const c8 *filename, + ISceneManager* smgr, + ISceneNode * parent = 0, + s32 base_id = 2000, + bool mode = true); + + private: + void findFile(bool use_mat_dirs, const core::stringc& path, const core::stringc& matPath, core::stringc& filename); + + ISceneManager* SceneMgr; + io::IFileSystem* FileSystem; + }; + +} // end namespace scene +} // end namespace irr + +#endif + -- cgit v1.1