2013-03-28 10:04:07 -07:00
|
|
|
// Copyright (C) 2008-2012 Colin MacDonald
|
2010-01-23 12:13:43 -08:00
|
|
|
// No rights reserved: this software is in the public domain.
|
|
|
|
|
|
|
|
#include "testUtils.h"
|
|
|
|
|
|
|
|
using namespace irr;
|
|
|
|
|
|
|
|
// Tests mesh loading features and the mesh cache.
|
|
|
|
/** This won't test render results. Currently, not all mesh loaders are tested. */
|
|
|
|
bool meshLoaders(void)
|
|
|
|
{
|
2011-06-09 00:08:47 -07:00
|
|
|
IrrlichtDevice *device = createDevice(video::EDT_NULL, core::dimension2d<u32>(160, 120), 32);
|
2013-04-04 09:15:53 -07:00
|
|
|
assert_log(device);
|
2010-01-23 12:13:43 -08:00
|
|
|
if (!device)
|
|
|
|
return false;
|
|
|
|
|
2011-06-09 00:08:47 -07:00
|
|
|
scene::ISceneManager * smgr = device->getSceneManager();
|
|
|
|
scene::IAnimatedMesh* mesh = smgr->getMesh("../media/ninja.b3d");
|
2013-04-04 09:15:53 -07:00
|
|
|
assert_log(mesh);
|
2010-01-23 12:13:43 -08:00
|
|
|
|
|
|
|
bool result = (mesh != 0);
|
|
|
|
|
|
|
|
if (mesh)
|
|
|
|
{
|
|
|
|
if (mesh != smgr->getMesh("../media/ninja.b3d"))
|
|
|
|
{
|
|
|
|
logTestString("Loading from same file results in different meshes!");
|
|
|
|
result=false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-01-14 07:36:50 -08:00
|
|
|
device->closeDevice();
|
|
|
|
device->run();
|
2010-01-23 12:13:43 -08:00
|
|
|
device->drop();
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|