Remove remaining MD2 support

This commit is contained in:
Vincent Lejeune 2015-01-10 21:10:07 +01:00
parent 53c8df6733
commit a08a9b1af4
6 changed files with 2 additions and 149 deletions

View File

@ -503,7 +503,6 @@ include/IGUITable.h
include/IGUIButton.h
include/EMaterialFlags.h
include/EDeviceTypes.h
include/IAnimatedMeshMD2.h
include/IGUIWindow.h
include/EAttributes.h
include/S3DVertex.h

View File

@ -1,79 +0,0 @@
// 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
#ifndef __I_ANIMATED_MESH_MD2_H_INCLUDED__
#define __I_ANIMATED_MESH_MD2_H_INCLUDED__
#include "IAnimatedMesh.h"
namespace irr
{
namespace scene
{
//! Types of standard md2 animations
enum EMD2_ANIMATION_TYPE
{
EMAT_STAND = 0,
EMAT_RUN,
EMAT_ATTACK,
EMAT_PAIN_A,
EMAT_PAIN_B,
EMAT_PAIN_C,
EMAT_JUMP,
EMAT_FLIP,
EMAT_SALUTE,
EMAT_FALLBACK,
EMAT_WAVE,
EMAT_POINT,
EMAT_CROUCH_STAND,
EMAT_CROUCH_WALK,
EMAT_CROUCH_ATTACK,
EMAT_CROUCH_PAIN,
EMAT_CROUCH_DEATH,
EMAT_DEATH_FALLBACK,
EMAT_DEATH_FALLFORWARD,
EMAT_DEATH_FALLBACKSLOW,
EMAT_BOOM,
//! Not an animation, but amount of animation types.
EMAT_COUNT
};
//! Interface for using some special functions of MD2 meshes
class IAnimatedMeshMD2 : public IAnimatedMesh
{
public:
//! Get frame loop data for a default MD2 animation type.
/** \param l The EMD2_ANIMATION_TYPE to get the frames for.
\param outBegin The returned beginning frame for animation type specified.
\param outEnd The returned ending frame for the animation type specified.
\param outFPS The number of frames per second, this animation should be played at.
\return beginframe, endframe and frames per second for a default MD2 animation type. */
virtual void getFrameLoop(EMD2_ANIMATION_TYPE l, s32& outBegin,
s32& outEnd, s32& outFPS) const = 0;
//! Get frame loop data for a special MD2 animation type, identified by name.
/** \param name Name of the animation.
\param outBegin The returned beginning frame for animation type specified.
\param outEnd The returned ending frame for the animation type specified.
\param outFPS The number of frames per second, this animation should be played at.
\return beginframe, endframe and frames per second for a special MD2 animation type. */
virtual bool getFrameLoop(const c8* name,
s32& outBegin, s32& outEnd, s32& outFPS) const = 0;
//! Get amount of md2 animations in this file.
virtual s32 getAnimationCount() const = 0;
//! Get name of md2 animation.
/** \param nr: Zero based index of animation. */
virtual const c8* getAnimationName(s32 nr) const = 0;
};
} // end namespace scene
} // end namespace irr
#endif

View File

@ -7,7 +7,8 @@
#include "ISceneNode.h"
#include "IBoneSceneNode.h"
#include "IAnimatedMeshMD2.h"
#include "IMesh.h"
#include "IAnimatedMesh.h"
namespace irr
{
@ -139,31 +140,6 @@ namespace scene
/** \return Amount of joints in the mesh. */
virtual u32 getJointCount() const = 0;
//! Starts a default MD2 animation.
/** With this method it is easily possible to start a Run,
Attack, Die or whatever animation, if the mesh contained in
this scene node is an md2 mesh. Otherwise, nothing happens.
\param anim: An MD2 animation type, which should be played, for
example EMAT_STAND for the standing animation.
\return True if successful, and false if not, for example if
the mesh in the scene node is not a md2 mesh. */
virtual bool setMD2Animation(EMD2_ANIMATION_TYPE anim) = 0;
//! Starts a special MD2 animation.
/** With this method it is easily possible to start a Run,
Attack, Die or whatever animation, if the mesh contained in
this scene node is an md2 mesh. Otherwise, nothing happens.
This method uses a character string to identify the animation.
If the animation is a standard md2 animation, you might want to
start this animation with the EMD2_ANIMATION_TYPE enumeration
instead.
\param animationName: Name of the animation which should be
played.
\return Returns true if successful, and false if not, for
example if the mesh in the scene node is not an md2 mesh, or no
animation with this name could be found. */
virtual bool setMD2Animation(const c8* animationName) = 0;
//! Returns the currently displayed frame number.
virtual f32 getFrameNr() const = 0;
//! Returns the current start frame number.

View File

@ -54,7 +54,6 @@
#include "fast_atof.h"
#include "heapsort.h"
#include "IAnimatedMesh.h"
#include "IAnimatedMeshMD2.h"
#include "IAnimatedMeshSceneNode.h"
#include "IAttributeExchangingObject.h"
#include "IAttributes.h"

View File

@ -669,42 +669,6 @@ bool CAnimatedMeshSceneNode::removeChild(ISceneNode* child)
return false;
}
//! Starts a MD2 animation.
bool CAnimatedMeshSceneNode::setMD2Animation(EMD2_ANIMATION_TYPE anim)
{
if (!Mesh || Mesh->getMeshType() != EAMT_MD2)
return false;
IAnimatedMeshMD2* md = (IAnimatedMeshMD2*)Mesh;
s32 begin, end, speed;
md->getFrameLoop(anim, begin, end, speed);
setAnimationSpeed( f32(speed) );
setFrameLoop(begin, end);
return true;
}
//! Starts a special MD2 animation.
bool CAnimatedMeshSceneNode::setMD2Animation(const c8* animationName)
{
if (!Mesh || Mesh->getMeshType() != EAMT_MD2)
return false;
IAnimatedMeshMD2* md = (IAnimatedMeshMD2*)Mesh;
s32 begin, end, speed;
if (!md->getFrameLoop(animationName, begin, end, speed))
return false;
setAnimationSpeed( (f32)speed );
setFrameLoop(begin, end);
return true;
}
//! Sets looping mode which is on by default. If set to false,
//! animations will not be looped.
void CAnimatedMeshSceneNode::setLoopMode(bool playAnimationLooped)

View File

@ -110,12 +110,6 @@ namespace scene
//! or to remove attached childs.
virtual bool removeChild(ISceneNode* child);
//! Starts a MD2 animation.
virtual bool setMD2Animation(EMD2_ANIMATION_TYPE anim);
//! Starts a special MD2 animation.
virtual bool setMD2Animation(const c8* animationName);
//! Returns the current displayed frame number.
virtual f32 getFrameNr() const;
//! Returns the current start frame number.