1 // Copyright (C) 2002-2012 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 #ifndef __C_SCENE_NODE_ANIMATOR_TEXTURE_H_INCLUDED__
6 #define __C_SCENE_NODE_ANIMATOR_TEXTURE_H_INCLUDED__
7 
8 #include "irrArray.h"
9 #include "ISceneNodeAnimatorFinishing.h"
10 
11 namespace irr
12 {
13 namespace scene
14 {
15 	class CSceneNodeAnimatorTexture : public ISceneNodeAnimatorFinishing
16 	{
17 	public:
18 
19 		//! constructor
20 		CSceneNodeAnimatorTexture(const core::array<video::ITexture*>& textures,
21 			s32 timePerFrame, bool loop, u32 now);
22 
23 		//! destructor
24 		virtual ~CSceneNodeAnimatorTexture();
25 
26 		//! animates a scene node
27 		virtual void animateNode(ISceneNode* node, u32 timeMs);
28 
29 		//! Writes attributes of the scene node animator.
30 		virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const;
31 
32 		//! Reads attributes of the scene node animator.
33 		virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0);
34 
35 		//! Returns type of the scene node animator
getType()36 		virtual ESCENE_NODE_ANIMATOR_TYPE getType() const { return ESNAT_TEXTURE; }
37 
38 		//! Creates a clone of this animator.
39 		/** Please note that you will have to drop
40 		(IReferenceCounted::drop()) the returned pointer after calling
41 		this. */
42 		virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0);
43 
44 	private:
45 
46 		void clearTextures();
47 
48 		core::array<video::ITexture*> Textures;
49 		u32 TimePerFrame;
50 		u32 StartTime;
51 		bool Loop;
52 	};
53 
54 
55 } // end namespace scene
56 } // end namespace irr
57 
58 #endif
59 
60