diff options
author | hecks <42101236+hecktest@users.noreply.github.com> | 2021-07-23 16:23:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-23 16:23:44 +0200 |
commit | 4ab3de3bab13c18bc0eed6bac565be3b80ebac10 (patch) | |
tree | 54274982be545669f28b2849f5f94aa1c37f39af /tests/md2Animation.cpp | |
parent | dc2246dae75dda77d5a9be7f810930b5dd9b1ed8 (diff) | |
download | irrlicht-4ab3de3bab13c18bc0eed6bac565be3b80ebac10.tar.xz |
Delete lots of unused features (#48)
Diffstat (limited to 'tests/md2Animation.cpp')
-rw-r--r-- | tests/md2Animation.cpp | 128 |
1 files changed, 0 insertions, 128 deletions
diff --git a/tests/md2Animation.cpp b/tests/md2Animation.cpp deleted file mode 100644 index 2901374..0000000 --- a/tests/md2Animation.cpp +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald
-// No rights reserved: this software is in the public domain.
-
-#include "testUtils.h"
-
-using namespace irr;
-using namespace core;
-
-namespace
-{
-// Tests MD2 animations.
-/** At the moment, this just verifies that the last frame of the animation produces the expected bitmap. */
-bool testLastFrame()
-{
- // Use EDT_BURNINGSVIDEO since it is not dependent on (e.g.) OpenGL driver versions.
- IrrlichtDevice *device = createDevice(video::EDT_BURNINGSVIDEO, dimension2d<u32>(160, 120), 32);
- if (!device)
- return false;
-
- video::IVideoDriver* driver = device->getVideoDriver();
- scene::ISceneManager * smgr = device->getSceneManager();
-
- scene::IAnimatedMesh* mesh = smgr->getMesh("./media/sydney.md2");
-
- bool result = (mesh != 0);
- if (mesh)
- {
- scene::IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode(mesh);
-
- if (node)
- {
- node->setPosition(vector3df(20, 0, 30));
- node->setMaterialFlag(video::EMF_LIGHTING, false);
- node->setMaterialTexture(0, driver->getTexture("./media/sydney.bmp"));
- node->setLoopMode(false);
-
- (void)smgr->addCameraSceneNode();
-
- // Just jump to the last frame since that's all we're interested in.
- node->setMD2Animation(scene::EMAT_DEATH_FALLBACK);
- node->setCurrentFrame((f32)(node->getEndFrame()));
- node->setAnimationSpeed(0);
- device->run();
- driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255, 255, 255, 0));
- smgr->drawAll();
- driver->endScene();
- if (mesh->getBoundingBox() != mesh->getMesh(node->getEndFrame())->getBoundingBox())
- {
- logTestString("bbox of md2 mesh not updated.\n");
- result = false;
- }
- //TODO: Does not yet work, not sure if this is correct or not
-#if 0
- if (node->getBoundingBox() != mesh->getMesh(node->getFrameNr())->getBoundingBox())
- {
- logTestString("bbox of md2 scene node not updated.\n");
- result = false;
- }
-#endif
- if (node->getTransformedBoundingBox() == core::aabbox3df())
- {
- logTestString("md2 node returns empty bbox.\n");
- result = false;
- }
- }
- }
-
- result &= takeScreenshotAndCompareAgainstReference(driver, "-md2Animation.png");
- device->closeDevice();
- device->run();
- device->drop();
-
- return result;
-}
-
-// Tests MD2 normals.
-bool testNormals()
-{
- // Use EDT_BURNINGSVIDEO since it is not dependent on (e.g.) OpenGL driver versions.
- IrrlichtDevice *device = createDevice(video::EDT_BURNINGSVIDEO, dimension2d<u32>(160, 120), 32);
- if (!device)
- return false;
-
- video::IVideoDriver* driver = device->getVideoDriver();
- scene::ISceneManager * smgr = device->getSceneManager();
-
- scene::IAnimatedMesh* mesh = smgr->getMesh("./media/sydney.md2");
-
- bool result = (mesh != 0);
- if (mesh)
- {
- scene::IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode(mesh);
- if (node)
- {
- node->setPosition(vector3df(20, 0, 30));
- node->setMaterialFlag(video::EMF_LIGHTING, false);
- node->setDebugDataVisible(scene::EDS_NORMALS);
- node->setMaterialTexture(0, driver->getTexture("./media/sydney.bmp"));
- node->setLoopMode(false);
-
- (void)smgr->addCameraSceneNode();
-
- node->setMD2Animation(scene::EMAT_STAND);
- node->setAnimationSpeed(0);
- device->run();
- driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255, 255, 255, 0));
- smgr->drawAll();
- driver->endScene();
- }
- }
-
- result &= takeScreenshotAndCompareAgainstReference(driver, "-md2Normals.png");
- device->closeDevice();
- device->run();
- device->drop();
-
- return result;
-}
-
-}
-
-// test md2 features
-bool md2Animation(void)
-{
- bool result = testLastFrame();
- result &= testNormals();
- return result;
-}
|