-
Notifications
You must be signed in to change notification settings - Fork 2
/
CCSWFNode.h
125 lines (107 loc) · 2.79 KB
/
CCSWFNode.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
//
// CCSWFNode.h
// GSGGameSWF
//
// Created by dario on 13-02-25.
// Modify by chenee (chenee543216@gmail.com) on 13-05-20
// @chenee: 1\change Objective-C to C++ ;2\change opengl es 1.1 to opengl es 2.0
//
#ifndef CCSWF_NODE
#define CCSWF_NODE
#include "cocos2d.h"
#include "CCTouchDelegateProtocol.h"
#include "cocos2d.h"
#include "gameswf.h"
#include "CCSWFNodeGroup.h"
using namespace cocos2d;
//@class CCSWFNode_imp;
//
//@interface CCSWFNode : CCSprite <CCTargetedTouchDelegate>
//{
// CCSWFNode_imp *imp;
// GLfloat m_movieWidth;
// GLfloat m_movieHeight;
// GLfloat m_localScaleX;
// GLfloat m_localScaleY;
// GLfloat m_scaleX;
// GLfloat m_scaleY;
// NSMutableArray *m_touchEvents;
//
//}
//
//@property (nonatomic, assign) NSString *movieName;
//
//+(id) nodeWithSWFFile:(NSString*)file;
//-(id) initWithSWFFile:(NSString*)file;
//
//@end
//@interface CCSWFNode_imp : NSObject
//{
//@public
// gameswf::gc_ptr<gameswf::player> m_player;
// gameswf::gc_ptr<gameswf::root> m_movie;
//}
//
//-(id) initWithSWFFile:(NSString*)file;
//
//@end
class CCSWFNode_imp;
class CCSWFNodeGroup;
class CCSWFNode : public cocos2d::CCSprite
{
private:
bool isGrouped;
bool isRuning;
CCSWFNode_imp *imp;
GLfloat m_movieWidth;
GLfloat m_movieHeight;
GLfloat m_localScaleX;
GLfloat m_localScaleY;
GLfloat m_scaleX;
GLfloat m_scaleY;
// NSMutableArray *m_touchEvents;
CCArray* m_touchEvents;
CCObject* m_listener;
SEL_MenuHandler m_pfnSelector;
int iListenFrame;
CCObject* m_endListener;
SEL_MenuHandler m_pfnEndSelector;
bool repeat;
int iFrameCount;
public:
CCSWFNode();
~CCSWFNode();
void setGrouped(bool flag){ isGrouped = flag;};
bool getGrouped(){ return isGrouped;};
bool gotoLabel(char* label);
bool gotoFrame(int frame);
CCString* movieName();
void setMovieName(char *movieName);
// CCSWFNode(char* file);
static CCSWFNode* create(const char* file);
bool initWithSWFFile(const char* file);
void setFlipX(bool flipX);
void setFlipY(bool flipY);
float scale();
void setScale(float scale);
float scaleX();
void setScaleX(float scaleX);
float scaleY();
void setScaleY(float scaleY);
// void dealloc();
void onEnterTransitionDidFinish();
void onExit();
void update(float dt);
void draw();
void stopFlash();
void runFlash();
bool Runing(){return isRuning;};
void addFrameListener(int iFrame, CCObject* target,SEL_MenuHandler selector);
void setNextAction(CCSWFNode* target);
void setRepeat(bool flag);
bool getRepeat();
// void registerScriptAccelerateHandler(LUA_FUNCTION nHandler);
void registerEndHandler(int nHandler);
void unregisterEndHandler(void);
};
#endif