@@ -8,18 +8,16 @@ static u8 bush_uvwh[] = {
8
8
// Seems to be used when continuing a bush from one of the above starts?
9
9
static u8 bush_uvwh_cont [] = {
10
10
UVWH (0x80 , 0x80 , 0x38 , 0x42 ), UVWH (0x80 , 0x80 , 0x2C , 0x34 )};
11
- // clang-format off
12
- static s16 bush_unk_data [] = {0 , 20 , 0 , 32 , 1 , 32 , 0 , 8 , 2 , 20 , 1 , 16 , 0xFFFF , 0 ,
13
- 3 , 63 , 0xFFFF , 0 ,
14
- 4 , 64 , 4 , 96 , 0xFFFF , 0 ,
15
- 5 , 80 , 5 , 96 , 5 , 32 , 0xFFFF , 0 };
16
- // clang-format on
11
+ static s16 bush_unk_1 [] = {0 , 20 , 0 , 32 , 1 , 32 , 0 , 8 , 2 , 20 , 1 , 16 , 0xFFFF , 0 };
12
+ static s16 bush_unk_2 [] = {3 , 63 , 0xFFFF , 0 };
13
+ static s16 bush_unk_3 [] = {4 , 64 , 4 , 96 , 0xFFFF , 0 };
14
+ static s16 bush_unk_4 [] = {5 , 80 , 5 , 96 , 5 , 32 , 0xFFFF , 0 };
17
15
// VZ, Priority, Clut, and an X value. 4 such sets.
18
16
static s16 bush_render_data [] = {
19
17
0x00C0 , 0x005E , 0x0017 , 0x0080 , 0x0200 , 0x005B , 0x0014 , 0x003F ,
20
18
0x0140 , 0x005D , 0x003C , 0x00A0 , 0x01C0 , 0x005C , 0x003C , 0x00D0 };
21
- static s16 * bush_unk_starts [] = {& bush_unk_data [ 0 ], & bush_unk_data [ 14 ],
22
- & bush_unk_data [ 18 ], & bush_unk_data [ 24 ] };
19
+ static s16 * bush_unk_starts [] = {
20
+ bush_unk_1 , bush_unk_2 , bush_unk_3 , bush_unk_4 };
23
21
static s16 backgroundTreePositions [][2 ] = {
24
22
{0x200 , 0 }, {0x280 , 12 }, {0x300 , 4 }, {0x380 , 16 }};
25
23
static u16 backgroundTreeCluts [] = {0x15 , 0x46 , 0x47 , 0x48 };
@@ -40,9 +38,9 @@ void EntityBackgroundBushes(Entity* self) {
40
38
s32 yOffset ;
41
39
s16 xPos ;
42
40
s16 yPos ;
43
- s32 rotTransXYResult ;
44
- s32 unused1 ; // return args for rottranspers
45
- s32 unused2 ; // we don't use them.
41
+ long rotTransXYResult ;
42
+ long unused1 ; // return args for rottranspers
43
+ long unused2 ; // we don't use them.
46
44
VECTOR trans ;
47
45
MATRIX m ;
48
46
@@ -217,105 +215,3 @@ void EntityBackgroundTrees(Entity* self) {
217
215
prim = prim -> next ;
218
216
}
219
217
}
220
-
221
- static u8 transWaterCluts [] = {
222
- 0x24 , 0x1A , 0x21 , 0x1A , 0x2B , 0x1B , 0x22 , 0x1B , 0x2C , 0x1C , 0x23 ,
223
- 0x1C , 0x2D , 0x1D , 0x24 , 0x1D , 0x2E , 0x1E , 0x25 , 0x1E , 0x2F , 0x1F ,
224
- 0x26 , 0x1F , 0x56 , 0x20 , 0x21 , 0x20 , 0xFF , 0x00 , 0x00 , 0x00 };
225
- static u8 transWaterUV [] = {
226
- UVWH (0xA1 , 0x01 , 0x26 , 0x3E ), UVWH (0xC9 , 0x01 , 0x26 , 0x3E ),
227
- UVWH (0xA1 , 0x41 , 0x26 , 0x3E )};
228
- static u8 transWaterAnim [] = {10 , 0 , 10 , 1 , 10 , 2 , 10 , 1 , 0 , 0 , 0 , 0 };
229
- // Transparent water plane that can be seen in the merman room
230
- void EntityTransparentWater (Entity * self ) {
231
- Primitive * prim ;
232
- s32 primIndex ;
233
- u32 selfY ;
234
- s32 uCoord ;
235
- s32 vCoord ;
236
- u8 * uvPtr ;
237
- u8 * clutIdx ;
238
- s32 prim_xPos ;
239
-
240
- switch (self -> step ) {
241
- case 0 :
242
- InitializeEntity (g_EInitInteractable );
243
- self -> ext .transparentWater .unk80 = 4 ;
244
- primIndex = g_api .AllocPrimitives (PRIM_GT4 , 16 );
245
- if (primIndex == -1 ) {
246
- DestroyEntity (self );
247
- return ;
248
- }
249
- self -> flags |= FLAG_HAS_PRIMS ;
250
- self -> primIndex = primIndex ;
251
- prim = & g_PrimBuf [primIndex ];
252
- self -> ext .transparentWater .prim = prim ;
253
- while (prim != NULL ) {
254
- prim -> tpage = 0xF ;
255
- prim -> clut = 0x18 ;
256
- prim -> priority = 0xB0 ;
257
- prim -> drawMode = DRAW_HIDE ;
258
- prim = prim -> next ;
259
- }
260
- break ;
261
-
262
- case 1 :
263
- clutIdx = & transWaterCluts [0 ];
264
- while (* clutIdx != 0xFF ) {
265
- g_ClutIds [clutIdx [0 ]] = g_ClutIds [clutIdx [2 ] + 0x200 ];
266
- clutIdx += 4 ;
267
- }
268
-
269
- if (!-- self -> ext .transparentWater .unk80 ) {
270
- self -> ext .transparentWater .unk80 = 4 ;
271
- self -> step ++ ;
272
- }
273
- break ;
274
-
275
- case 2 :
276
- clutIdx = & transWaterCluts [0 ];
277
- while (* clutIdx != 0xFF ) {
278
- g_ClutIds [clutIdx [0 ]] = g_ClutIds [clutIdx [3 ] + 0x200 ];
279
- clutIdx += 4 ;
280
- }
281
-
282
- if (!-- self -> ext .transparentWater .unk80 ) {
283
- self -> ext .transparentWater .unk80 = 4 ;
284
- self -> step -- ;
285
- }
286
- break ;
287
- }
288
-
289
- AnimateEntity (transWaterAnim , self );
290
-
291
- prim_xPos = -1 * g_Tilemap .scrollX .i .hi % 38 ;
292
- prim_xPos += 304 ;
293
- if (self -> params ) {
294
- prim_xPos = 96 ;
295
- }
296
-
297
- uvPtr = transWaterUV ;
298
- uvPtr += 4 * self -> animCurFrame ;
299
- uCoord = uvPtr [0 ];
300
- vCoord = uvPtr [1 ];
301
- selfY = self -> posY .i .hi ;
302
- prim = self -> ext .transparentWater .prim ;
303
- while (prim_xPos > 0 ) {
304
- prim -> u0 = prim -> u2 = uCoord ;
305
- prim -> u1 = prim -> u3 = uCoord + 0x26 ;
306
- prim -> v0 = prim -> v1 = vCoord ;
307
- prim -> v2 = prim -> v3 = vCoord + 0x3E ;
308
- prim -> x1 = prim -> x3 = prim_xPos ;
309
- prim_xPos -= 0x26 ;
310
- prim -> x0 = prim -> x2 = prim_xPos ;
311
- prim -> y0 = prim -> y1 = selfY ;
312
- prim -> y2 = prim -> y3 = selfY + 0x3E ;
313
- prim -> drawMode = DRAW_TPAGE2 | DRAW_TPAGE | DRAW_UNK02 | DRAW_TRANSP ;
314
- prim = prim -> next ;
315
- }
316
-
317
- while (prim != NULL ) {
318
- prim -> drawMode = DRAW_HIDE ;
319
- prim = prim -> next ;
320
- }
321
- }
0 commit comments