~baltix/+junk/irrlicht-test

« back to all changes in this revision

Viewing changes to tests/meshLoaders.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) 2008-2011 Colin MacDonald
 
2
// No rights reserved: this software is in the public domain.
 
3
 
 
4
#include "testUtils.h"
 
5
 
 
6
using namespace irr;
 
7
 
 
8
// Tests mesh loading features and the mesh cache.
 
9
/** This won't test render results. Currently, not all mesh loaders are tested. */
 
10
bool meshLoaders(void)
 
11
{
 
12
        IrrlichtDevice *device = createDevice(video::EDT_NULL, core::dimension2d<u32>(160, 120), 32);
 
13
        assert(device);
 
14
        if (!device)
 
15
                return false;
 
16
 
 
17
        scene::ISceneManager * smgr = device->getSceneManager();
 
18
        scene::IAnimatedMesh* mesh = smgr->getMesh("../media/ninja.b3d");
 
19
        assert(mesh);
 
20
 
 
21
        bool result = (mesh != 0);
 
22
 
 
23
        if (mesh)
 
24
        {
 
25
                if (mesh != smgr->getMesh("../media/ninja.b3d"))
 
26
                {
 
27
                        logTestString("Loading from same file results in different meshes!");
 
28
                                result=false;
 
29
                }
 
30
        }
 
31
 
 
32
        device->closeDevice();
 
33
        device->run();
 
34
        device->drop();
 
35
 
 
36
        return result;
 
37
}