forked from naclander/openmugen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ControllerExecuter.cpp
226 lines (197 loc) · 5.98 KB
/
ControllerExecuter.cpp
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
// Open Mugen is a redevelopment of Elecbyte's M.U.G.E.N wich will be 100% compatible to it
// Copyright (C) 2004 Sahin Vardar
//
// If you know bugs or have a wish on Open Muegn or (money/girls/a car) for me ;-)
// Feel free and email me: [email protected] ICQ:317502935
// Web: http://openmugen.sourceforge.net/
// --------------------------------------------------------------------------
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#include "global.h"
//Constructor
CControllerExecuter::CControllerExecuter()
{
//init ouer function table
InitFuncTable();
}
//Destructor
CControllerExecuter::~CControllerExecuter()
{
}
//Inits the Function Table
void CControllerExecuter::InitFuncTable()
{
pFuncTable[0]=&CControllerExecuter::NullController;
pFuncTable[1]=NULL;
pFuncTable[2]=NULL;
pFuncTable[3]=NULL;
pFuncTable[4]=NULL;
pFuncTable[5]=NULL;
pFuncTable[6]=NULL;
pFuncTable[7]=NULL;
pFuncTable[8]=NULL;
pFuncTable[9]=NULL;
pFuncTable[10]=NULL;
pFuncTable[11]=NULL;
pFuncTable[12]=NULL;
pFuncTable[13]=NULL;
pFuncTable[14]=NULL;
pFuncTable[15]=&CControllerExecuter::ChangeState;
pFuncTable[16]=NULL;
pFuncTable[17]=NULL;
pFuncTable[18]=NULL;
pFuncTable[19]=NULL;
pFuncTable[20]=NULL;
pFuncTable[21]=NULL;
pFuncTable[22]=NULL;
pFuncTable[23]=NULL;
pFuncTable[24]=NULL;
pFuncTable[25]=NULL;
pFuncTable[26]=NULL;
pFuncTable[27]=NULL;
pFuncTable[28]=NULL;
pFuncTable[29]=NULL;
pFuncTable[30]=NULL;
pFuncTable[31]=NULL;
pFuncTable[32]=NULL;
pFuncTable[33]=NULL;
pFuncTable[34]=NULL;
pFuncTable[35]=NULL;
pFuncTable[36]=NULL;
pFuncTable[37]=NULL;
pFuncTable[38]=NULL;
pFuncTable[39]=NULL;
pFuncTable[40]=NULL;
pFuncTable[41]=NULL;
pFuncTable[42]=NULL;
pFuncTable[43]=NULL;
pFuncTable[44]=NULL;
pFuncTable[45]=NULL;
pFuncTable[46]=NULL;
pFuncTable[47]=NULL;
pFuncTable[48]=NULL;
pFuncTable[49]=NULL;
pFuncTable[50]=NULL;
pFuncTable[51]=NULL;
pFuncTable[52]=NULL;
pFuncTable[53]=NULL;
pFuncTable[54]=NULL;
pFuncTable[55]=NULL;
pFuncTable[56]=NULL;
pFuncTable[57]=NULL;
pFuncTable[58]=NULL;
pFuncTable[59]=NULL;
pFuncTable[60]=NULL;
pFuncTable[61]=NULL;
pFuncTable[62]=NULL;
pFuncTable[63]=NULL;
pFuncTable[64]=NULL;
pFuncTable[65]=NULL;
pFuncTable[66]=NULL;
pFuncTable[67]=NULL;
pFuncTable[68]=NULL;
pFuncTable[69]=NULL;
pFuncTable[70]=NULL;
pFuncTable[71]=NULL;
pFuncTable[72]=NULL;
pFuncTable[73]=NULL;
pFuncTable[74]=NULL;
pFuncTable[75]=NULL;
pFuncTable[76]=NULL;
pFuncTable[77]=NULL;
pFuncTable[78]=NULL;
pFuncTable[79]=NULL;
pFuncTable[80]=&CControllerExecuter::VarSet;
pFuncTable[81]=NULL;
pFuncTable[82]=NULL;
pFuncTable[83]=&CControllerExecuter::VelSet;
pFuncTable[84]=NULL;
pFuncTable[85]=NULL;
pFuncTable[86]=NULL;
pFuncTable[87]=NULL;
}
//NUll Controller does nothing ;-)
void CControllerExecuter::NullController()
{
}
//executes the controller
void CControllerExecuter::ExecuteController(int nController)
{
#ifdef DEBUG
PrintMessage("Execute controller %i",nController-TNULL);
#endif
// (this->*pFuncTable[nController-TNULL])();
}
//ChangeState Controller
void CControllerExecuter::ChangeState()
{
/* int nStateToChange;
//Get the Statenumber to wich it will be changed
nStateToChange=(int)((CPlayer*)lpPlayer)->GetParamValue(PA_VALUE);
((CPlayer*)lpPlayer)->ChangeState(nStateToChange);*/
}
//Change Anim controller
void CControllerExecuter::ChangeAnim()
{
}
//VelSet controller
void CControllerExecuter::VelSet()
{
/* float x=((CPlayer*)lpPlayer)->GetParamValue(PA_XVALUE);
float y=((CPlayer*)lpPlayer)->GetParamValue(PA_YVALUE);
#ifdef DEBUG
PrintMessage("Velset X=%f,Y=%f",x,y);
#endif
if(x!=NOPARAM)
((CPlayer*)lpPlayer)->PlRtInfo.xvel=x;
if(y!=NOPARAM)
((CPlayer*)lpPlayer)->PlRtInfo.yvel=y;
*/
}
//VarSet Controller
void CControllerExecuter::VarSet()
{
/*float fVarValue=0;
int index=0;
//check which var to set
//VAR
fVarValue=((CPlayer*)lpPlayer)->GetParamValue(PA_VAR);
if(fVarValue!=NOPARAM)
{
index=(int)((CPlayer*)lpPlayer)->m_VM.m_Stack.Pop().Value;
((CPlayer*)lpPlayer)->SetIVar(index,fVarValue);
}
//FVAR
fVarValue=((CPlayer*)lpPlayer)->GetParamValue(PA_FVAR);
if(fVarValue!=NOPARAM)
{
index=(int)((CPlayer*)lpPlayer)->m_VM.m_Stack.Pop().Value;
((CPlayer*)lpPlayer)->SetFVar(index,fVarValue);
}
//SYSVAR
fVarValue=((CPlayer*)lpPlayer)->GetParamValue(PA_SYSVAR);
if(fVarValue!=NOPARAM)
{
index=(int)((CPlayer*)lpPlayer)->m_VM.m_Stack.Pop().Value;
((CPlayer*)lpPlayer)->SetSysVar(index,fVarValue);
}
//SYSFVAR
fVarValue=((CPlayer*)lpPlayer)->GetParamValue(PA_SYSFVAR);
if(fVarValue!=NOPARAM)
{
index=(int)((CPlayer*)lpPlayer)->m_VM.m_Stack.Pop().Value;
((CPlayer*)lpPlayer)->SetSysFVar(index,fVarValue);
}
*/
}