~baltix/+junk/irrlicht-test

« back to all changes in this revision

Viewing changes to source/Irrlicht/CMD3MeshFileLoader.cpp

  • Committer: Mantas Kriaučiūnas
  • Date: 2011-07-18 13:06:25 UTC
  • Revision ID: mantas@akl.lt-20110718130625-c5pvifp61e7kj1ol
Included whole irrlicht SVN libraries to work around launchpad recipe issue with quilt, see https://answers.launchpad.net/launchpad/+question/165193

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (C) 2002-2011 Nikolaus Gebhardt
 
2
// This file is part of the "Irrlicht Engine".
 
3
// For conditions of distribution and use, see copyright notice in irrlicht.h
 
4
 
 
5
#include "IrrCompileConfig.h"
 
6
#ifdef _IRR_COMPILE_WITH_MD3_LOADER_
 
7
 
 
8
#include "CMD3MeshFileLoader.h"
 
9
#include "CAnimatedMeshMD3.h"
 
10
#include "irrString.h"
 
11
 
 
12
namespace irr
 
13
{
 
14
namespace scene
 
15
{
 
16
 
 
17
//! Constructor
 
18
CMD3MeshFileLoader::CMD3MeshFileLoader( scene::ISceneManager* smgr)
 
19
: SceneManager(smgr)
 
20
{
 
21
}
 
22
 
 
23
 
 
24
//! destructor
 
25
CMD3MeshFileLoader::~CMD3MeshFileLoader()
 
26
{
 
27
}
 
28
 
 
29
 
 
30
//! returns true if the file maybe is able to be loaded by this class
 
31
//! based on the file extension (e.g. ".bsp")
 
32
bool CMD3MeshFileLoader::isALoadableFileExtension(const io::path& filename) const
 
33
{
 
34
        return core::hasFileExtension ( filename, "md3" );
 
35
}
 
36
 
 
37
 
 
38
IAnimatedMesh* CMD3MeshFileLoader::createMesh(io::IReadFile* file)
 
39
{
 
40
        CAnimatedMeshMD3 * mesh = new CAnimatedMeshMD3();
 
41
 
 
42
        if ( mesh->loadModelFile ( 0, file, SceneManager->getFileSystem(), SceneManager->getVideoDriver() ) )
 
43
                return mesh;
 
44
 
 
45
        mesh->drop ();
 
46
        return 0;
 
47
}
 
48
 
 
49
 
 
50
} // end namespace scene
 
51
} // end namespace irr
 
52
 
 
53
#endif // _IRR_COMPILE_WITH_MD3_LOADER_