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
|
#include <common.h>
#include <game.h>
#include <g3dhax.h>
#include "daEnDosun_c.h"
#if 0
/* called from _vf228 */
/* handles overall scale */
void sub_8009ea50( _464_struct* data ) {
u32 ctr = data->ctr; // _0x14
dEn_c* en = data->en; // _0x18
if(!ctr) {
en->scale.x = en->scale.y = en->scale.z = 1.0;
data->x = data->y = data->z = data->_0xC = 1.0
return;
}
data->ctr--;
/*FIXME continue */
}
#endif
class daEnMegaDosun_c : public daEnDosun_c {
//int onCreate(); // overload for mega
//int onExecute();
static daEnMegaDosun_c *build();
//int checkZoneBoundaries(int);
//FIXME
//USING_STATES(daEnMegaDosun_c);
//DECLARE_STATE(Wait);
};
daEnMegaDosun_c *daEnMegaDosun_c::build() {
void *buffer = AllocFromGameHeap1(sizeof(daEnMegaDosun_c));
return new(buffer) daEnMegaDosun_c;
}
#if 0
int daEnMegaDosun_c::onCreate() {
//FIXME
this->bigOrSmall = 1; // 0=small,1=big,2=mega
this->setupBodyModel(); // add this for linking/rename
this->_36D = 0; // byte
this->holdsFromSettings = this->settings & 0xf; //0=normal,1=??,2=fall
this->frzMgr.setSomething(1,1,1); //@0x809f5c5c
this->pos.y -= 21.0;
this->pos.z = -280.0; // behind layer1 (hides spikes)
//FIXME might be u32 0x11804101
/*
this->collision_struct[0] = 0x11;
this->collision_struct[1] = 0x80;
this->collision_struct[2] = 0x41;
this->collision_struct[3] = 0x01;
*/
this->collision_struct = 0x11804101;
this->_5C0 = 0xFFFE1000;
this->_5C4 = 0x1F000;
this->_5C8 = 0x5000;
/*
//0x80ACF990 + 0x8C = 80acfa1C
0.0,41.0,36.0,38.0,
0x03, 0x00, 0x0000,0x0000004F,0x0000820E,0x0100,0x0000
dEn_c::collisionCallback (0x80095950)
*/
ActivePhysics::Info hm;
hm.xDistToCenter = 0.0;
hm.yDistToCenter = 41.0;
hm.xDistToEdge = 36.0;
hm.yDistToEdge = 38.0;
hm.category1 = 0x03;
hm.category2 = 0x00;
hm.bitfield1 = 0x0000004F;
hm.bitfield2 = 0x0000820E;
hm.unkShort1C = 0x0100;
hm.callback = &dEn_c::collisionCallback;
this->aPhysics.initWithStruct(this, &hm);
/* 0x00000001,0xfffe1000,0x0001f000,0x00055000,
* 0.0,20.0,16.0,19.0
* 0x03000000,0x0000004f,0x0000820e,0x01000000,
* dEn_c::collisionCallback
*/
u8 s3[] = {0,0,0,1,0xff,0xfe,0x10,0,0,1,0xf0,0,0,5,0x50,0};
//FIXME 0x80ACF990 + 0x58 = 80acf9e8
this->collMgr.Init(this,(u8*)&this->collision_struct,(u8*)&s3,0);
this->pos_delta2.x = 0.0;
this->pos_delta2.y = 36.0;
this->pos_delta2.z = 0.0;
this->_320 = 0.0;
this->_324 = 48.0;
this->aPhysics.addToList();
this->scale.x = 1.0;
this->scale.y = 1.0;
this->scale.z = 1.0;
this->max_speed.x = 0.0;
this->max_speed.y = -8.0;
this->max_speed.z = 0.0;
this->y_speed_inc = -0.25;
this->rot.x = 0;
this->rot.y = 0;
this->rot.z = 0;
// check settings bit
if(this->holdsFromSettings == 2) {
this->doStateChange(&StateID_DownMove_Kameck);
}else{
this->doStateChange(&StateID_UpWait);
}
return 1;
}
#endif
#if 0
int daEnMegaDosun_c::onExecute() {
acState.execute();
//FIXME change to do outro when leaving screen
//this->checkZoneBoundaries(0);
return 1;
}
#endif
//FIXME
#if 0
int daEnMegaDosun_c::checkZoneBoundaries(int foo) {
if(this->_36C == 2) { // is eaten
return 0;
}
if( (0 == (foo&0x8)) && \
(this->collMgr.checkBits15and16ofBitfield() != 0) ) {
return 0;
}
int ret = 0;
#if 0
Rect tempRect = (Rect){this->_320, this->_324,
0.5 * this->spriteSomeRectX, 0.5 * this->spriteSomeRectY};
Rect tempRect2 = (Rect){_338, _33C, _340, _344};
if(this->s800064da0(pos, &tempRect, currentZoneId) ||
(!(foo&0x4) && s_800b56e0(pos, &tempRect, &tempRect2, currentZoneId)) )
{
ret = 1;
}
#endif
if(ret && !(foo & 0x2))
this->Delete(this->_390);
return ret;
}
#endif
#if 0
extern "C" bool CollidedWithTile(u8 *);
extern "C" void *SomeStrangeModification(dEn_c *);
void ThwompaDompMoveC(dEn_c *Sprite) {
bool FirstCheck;
bool SecondCheck;
// Check for collisions with walls?
FirstCheck = CollidedWithTile(Sprite->collMgr);
SomeStrangeModification(Sprite);
SecondCheck = CollidedWithTile(Sprite->collMgr);
OSReport("XPos = %f, FirstCheck = %d, SecondCheck = %d", Sprite->pos.x, FirstCheck, SecondCheck);
if ((FirstCheck != 0) && (SecondCheck != 0)) {
OSReport("Actually doing something, I swear");
Sprite->pos.y = Sprite->pos.y + 16.0;
Sprite->pos.x = Sprite->pos.x - 180.0;
if (Sprite->direction == 0) {
Sprite->direction = 1;
Sprite->pos.x = Sprite->pos.x - 80.0; }
else {
Sprite->direction = 0;
Sprite->pos.x = Sprite->pos.x + 80.0; }
}
else {
if (Sprite->direction == 0) {
Sprite->pos.x = Sprite->pos.x + 1.0; }
else {
Sprite->pos.x = Sprite->pos.x - 1.0; }
}
return;
}
#endif
/*
class daYoshi_c : public dStageActor_c {
u32 _1520; // holds actorID of actor eaten
};
*/
|