-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathAnim.h
179 lines (165 loc) · 3.53 KB
/
Anim.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
#pragma once
#include "afx.h"
class CStimulus;
class CAnim :
public CObject
{
public:
CAnim(void);
~CAnim(void);
void Deassign(void);
virtual void Command(unsigned char message[], DWORD messageLength) = 0;
virtual void Advance(void) = 0;
CStimulus* m_pStimulus;
static BYTE m_defaultFinalActionMask;
union
{
BYTE mask;
struct
{
BYTE disable:1;
BYTE unused:1;
BYTE togglePD:1;
BYTE signalEvent:1;
BYTE restart:1;
BYTE reverse:1;
BYTE initialState:1;
BYTE endDeferredMode:1;
};
} m_finalAction;
protected:
void Finalize(void);
WORD m_errorCode;
private:
static HANDLE m_hfinalEvent;
public:
static bool CreateEvent(void);
};
///////////////////////////////////////////////////////////////////////////////////////////////////////
class CLoadedAnim :
public CAnim
{
public:
CLoadedAnim(void);
~CLoadedAnim(void);
virtual bool Init(LPCWSTR wzFilename) = 0;
};
class CAnimationPath :
public CLoadedAnim
{
public:
CAnimationPath(void);
~CAnimationPath(void);
bool Init(LPCWSTR wzFilename);
void Advance(void);
private:
void Command(unsigned char message[], DWORD messageLength);
D2D1_POINT_2F* m_pPathCoords;
unsigned short m_nPathCoords;
unsigned long m_index;
};
class CAnimLineSegPath :
public CAnim
{
public:
CAnimLineSegPath(WORD speed);
~CAnimLineSegPath(void);
void Advance(void);
private:
void Command(unsigned char message[], DWORD messageLength);
WORD m_speed;
short* m_pPathVertices;
unsigned short m_nPathVertices;
unsigned long m_index;
BYTE m_iSegment;
float m_vx;
float m_vy;
short m_x0;
short m_y0;
unsigned long m_nThisSegment;
void Finalize(void);
};
class CAnimHarmonic :
public CAnim
{
public:
CAnimHarmonic(WORD nQuaters);
~CAnimHarmonic(void);
void Advance(void);
private:
void Command(unsigned char message[], DWORD messageLength);
WORD m_nQuaters;
float m_A;
float m_phi;
float m_phiIncr;
float m_direction;
};
class CAnimLinearRange :
public CAnim
{
public:
CAnimLinearRange(float startValue, float endValue, float duration, BYTE mode);
~CAnimLinearRange(void);
void Advance(void);
private:
void Command(unsigned char message[], DWORD messageLength);
float m_startValue;
float m_endValue;
float m_increment;
float m_currentValue;
BYTE m_mode;
};
class CAnimFlash :
public CAnim
{
public:
CAnimFlash(WORD nFrames);
~CAnimFlash(void);
void Advance(void);
private:
void Command(unsigned char message[], DWORD messageLength);
WORD m_nFrames;
WORD m_frameCounter;
};
class CAnimFlicker :
public CAnim
{
public:
CAnimFlicker(WORD nOnFrames, WORD nOffFrames);
~CAnimFlicker(void);
void Advance(void);
private:
void Command(unsigned char message[], DWORD messageLength);
WORD m_nOnFrames;
WORD m_nOffFrames;
WORD m_frameCounter;
};
class CAnimExternalPositionControl :
public CLoadedAnim
{
public:
CAnimExternalPositionControl();
bool Init(LPCTSTR memMapName);
~CAnimExternalPositionControl(void);
void Advance(void);
private:
void Command(unsigned char message[], DWORD messageLength);
HANDLE m_hMemMap;
float* m_pMemMap;
float m_xOffset;
float m_yOffset;
};
class CAnimIntegerRange :
public CAnim
{
public:
CAnimIntegerRange(UINT32 startValue, UINT32 endValue, INT16 increment);
~CAnimIntegerRange(void);
void Advance(void);
private:
void Command(unsigned char message[], DWORD messageLength);
UINT32 m_startValue;
UINT32 m_endValue;
UINT32 m_currentValue;
INT16 m_increment;
};