77
88#include " base/ccTypes.h"
99#include " 2d/CCNode.h"
10+ #include " 2d/CCProtocols.h"
1011
1112#include " renderer/CCCustomCommand.h"
1213
@@ -16,23 +17,18 @@ class GLProgramState;
1617class Mesh ;
1718class Texture2D ;
1819
19- class Sprite3D : public Node
20+ class Sprite3D : public Node , public BlendProtocol
2021{
2122public:
2223 static Sprite3D* create (const std::string &modelPath);
2324 static Sprite3D* create (const std::string &modelPath, const std::string &texturePath);
24- // static Sprite3D* create(Mesh* mesh, const std::string& texturePath);
25- // todo add if we need multitexture in the sprite3d
26- // static Sprite3D* create(const std::string &modelPath, const std::vector<std::string> &texturePath);
27- // static Sprite3D* create(const std::string &modelPath, const std::vector<std::string> &texturePath);
28-
29- int getMeshPartCount () const ;
30-
31- Mesh* getMesh () const { return _mesh; }
3225
3326 void setTexture (const std::string& texFile);
3427 // void setTexture(Texture2D* texture);
35-
28+
29+ virtual void setBlendFunc (const BlendFunc &blendFunc) override ;
30+ virtual const BlendFunc &getBlendFunc () const override ;
31+
3632protected:
3733 Sprite3D ();
3834 virtual ~Sprite3D ();
@@ -47,6 +43,10 @@ class Sprite3D : public Node
4743
4844 virtual GLProgram* getDefGLProgram (bool textured = true );
4945
46+ int getMeshPartCount () const ;
47+
48+ Mesh* getMesh () const { return _mesh; }
49+
5050 CustomCommand _customCommand;
5151 Mesh *_mesh;
5252
@@ -59,7 +59,8 @@ class Sprite3D : public Node
5959 // Sprite3DEffect* _effect;
6060
6161 std::string _path;
62-
62+
63+ BlendFunc _blend;
6364
6465};
6566
0 commit comments