Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MorsGames
GitHub Repository: MorsGames/sm64plus
Path: blob/master/levels/ttm/areas/1/painting.inc.c
7861 views
1
#include "game/paintings.h"
2
3
// 0x070122F0 - 0x07012308
4
static const Lights1 ttm_seg7_lights_070122F0 = gdSPDefLights1(
5
0x50, 0x50, 0x50,
6
0xff, 0xff, 0xff, 0x32, 0x32, 0x32
7
);
8
9
// 0x07012308 - 0x07012388
10
static const Vtx ttm_seg7_vertex_07012308[] = {
11
{{{ 0, 0, 0}, 0, { -32, 992}, {0x00, 0x00, 0x7f, 0xff}}},
12
{{{ 614, 0, 0}, 0, { 2012, 992}, {0x00, 0x00, 0x7f, 0xff}}},
13
{{{ 614, 307, 0}, 0, { 2012, 0}, {0x00, 0x00, 0x7f, 0xff}}},
14
{{{ 0, 307, 0}, 0, { -32, 0}, {0x00, 0x00, 0x7f, 0xff}}},
15
{{{ 0, 307, 0}, 0, { -32, 992}, {0x00, 0x00, 0x7f, 0xff}}},
16
{{{ 614, 307, 0}, 0, { 2012, 992}, {0x00, 0x00, 0x7f, 0xff}}},
17
{{{ 614, 614, 0}, 0, { 2012, -28}, {0x00, 0x00, 0x7f, 0xff}}},
18
{{{ 0, 614, 0}, 0, { -32, -28}, {0x00, 0x00, 0x7f, 0xff}}},
19
};
20
21
// 0x07012388 - 0x070123A0
22
const Gfx ttm_seg7_dl_07012388[] = {
23
gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0),
24
gsSPEndDisplayList(),
25
};
26
27
// 0x070123A0 - 0x070123B8
28
const Gfx ttm_seg7_dl_070123A0[] = {
29
gsSP2Triangles( 4, 5, 6, 0x0, 4, 6, 7, 0x0),
30
gsSPEndDisplayList(),
31
};
32
33
// 0x070123B8 - 0x07012410
34
const Gfx ttm_seg7_dl_070123B8[] = {
35
gsDPPipeSync(),
36
gsSPSetGeometryMode(G_LIGHTING | G_SHADING_SMOOTH),
37
gsDPSetCombineMode(G_CC_MODULATERGB, G_CC_MODULATERGB),
38
gsSPLight(&ttm_seg7_lights_070122F0.l, 1),
39
gsSPLight(&ttm_seg7_lights_070122F0.a, 2),
40
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD),
41
gsDPTileSync(),
42
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 5, G_TX_NOLOD, G_TX_CLAMP, 6, G_TX_NOLOD),
43
gsDPSetTileSize(0, 0, 0, (64 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC),
44
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
45
gsSPEndDisplayList(),
46
};
47
48
// 0x07012410 - 0x07012430
49
const Gfx ttm_seg7_dl_07012410[] = {
50
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
51
gsDPPipeSync(),
52
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
53
gsSPEndDisplayList(),
54
};
55
56
// 0x07012430 - 0x07012450
57
static const Gfx ttm_seg7_painting_dl_07012430[] = {
58
gsDPTileSync(),
59
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 5, G_TX_NOLOD, G_TX_CLAMP, 6, G_TX_NOLOD),
60
gsDPSetTileSize(0, 0, 0, (64 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC),
61
gsSPEndDisplayList(),
62
};
63
64
// 0x07012450 - 0x0701296A
65
static const PaintingData ttm_seg7_painting_texture_map_bottom_07012450[] = {
66
85, // num mappings
67
// Format:
68
// mesh vtx ID, texture X, texture Y
69
49, 2016, 889,
70
53, 2016, 685,
71
55, 1843, 787,
72
50, 2016, 992,
73
51, 1843, 992,
74
52, 1843, 583,
75
75, 2016, 513,
76
54, 1671, 889,
77
59, 1671, 685,
78
62, 1502, 787,
79
56, 1502, 992,
80
57, 1671, 992,
81
58, 1502, 583,
82
60, 1671, 513,
83
61, 1330, 889,
84
65, 1330, 685,
85
63, 1162, 992,
86
64, 1330, 992,
87
66, 1162, 583,
88
67, 1330, 513,
89
69, 1162, 787,
90
68, 989, 889,
91
70, 821, 992,
92
71, 989, 992,
93
73, 989, 685,
94
72, 821, 583,
95
74, 989, 513,
96
77, 2016, 308,
97
78, 1843, 410,
98
76, 1843, 204,
99
81, 1502, 410,
100
80, 1671, 308,
101
47, 1671, 102,
102
79, 1502, 204,
103
46, 1330, 102,
104
82, 1162, 204,
105
83, 1330, 308,
106
84, 1162, 410,
107
86, 989, 308,
108
85, 821, 204,
109
48, 989, 102,
110
25, 1502, 0,
111
31, 1162, 0,
112
19, 1843, 0,
113
37, 821, 0,
114
120, 821, 787,
115
119, 649, 889,
116
122, 481, 992,
117
121, 649, 992,
118
124, 649, 685,
119
125, 481, 583,
120
123, 649, 513,
121
127, 481, 787,
122
126, 308, 889,
123
129, 140, 992,
124
128, 308, 992,
125
132, 308, 513,
126
131, 308, 685,
127
130, 140, 583,
128
134, 140, 787,
129
133, -32, 889,
130
135, -32, 513,
131
136, 821, 410,
132
116, 649, 102,
133
137, 649, 308,
134
114, 481, 204,
135
138, 481, 410,
136
139, 308, 308,
137
118, 140, 204,
138
115, 308, 102,
139
140, 140, 410,
140
117, -32, 102,
141
99, 481, 0,
142
105, 140, 0,
143
143, 2016, 102,
144
145, 1330, 0,
145
144, 1671, 0,
146
142, 2016, 0,
147
146, 989, 0,
148
155, -32, 685,
149
156, -32, 992,
150
154, -32, 308,
151
151, 308, 0,
152
150, 649, 0,
153
153, -32, 0,
154
155
132, // num groups
156
// Grouped by 5 + one remainder group,
157
// = 15 vertices per group + a few extra triangles
158
13, 8, 5,
159
0, 1, 2,
160
3, 0, 4,
161
4, 0, 2,
162
5, 2, 1,
163
1, 6, 5,
164
7, 2, 8,
165
5, 8, 2,
166
2, 7, 4,
167
7, 8, 9,
168
10, 7, 9,
169
11, 7, 10,
170
7, 11, 4,
171
12, 9, 8,
172
8, 13, 12,
173
21, 24, 45,
174
14, 9, 15,
175
12, 15, 9,
176
9, 14, 10,
177
16, 14, 20,
178
17, 14, 16,
179
14, 15, 20,
180
14, 17, 10,
181
15, 19, 18,
182
18, 20, 15,
183
19, 15, 12,
184
20, 21, 16,
185
18, 24, 20,
186
21, 20, 24,
187
22, 21, 45,
188
23, 21, 22,
189
21, 23, 16,
190
24, 26, 25,
191
25, 45, 24,
192
26, 24, 18,
193
6, 27, 28,
194
5, 6, 28,
195
29, 28, 27,
196
27, 74, 29,
197
29, 31, 28,
198
13, 28, 31,
199
28, 13, 5,
200
36, 34, 35,
201
12, 13, 30,
202
13, 31, 30,
203
31, 32, 33,
204
32, 31, 29,
205
33, 30, 31,
206
33, 36, 30,
207
30, 19, 12,
208
19, 30, 36,
209
18, 19, 37,
210
19, 36, 37,
211
34, 36, 33,
212
35, 37, 36,
213
37, 26, 18,
214
35, 38, 37,
215
26, 37, 38,
216
25, 26, 62,
217
26, 38, 62,
218
38, 40, 39,
219
39, 62, 38,
220
40, 38, 35,
221
41, 34, 33,
222
33, 32, 41,
223
42, 34, 75,
224
34, 41, 75,
225
35, 34, 42,
226
32, 43, 76,
227
41, 32, 76,
228
43, 32, 29,
229
29, 74, 43,
230
43, 74, 77,
231
46, 49, 52,
232
42, 40, 35,
233
39, 40, 44,
234
40, 42, 78,
235
44, 40, 78,
236
25, 49, 45,
237
45, 46, 22,
238
46, 45, 49,
239
47, 46, 52,
240
48, 46, 47,
241
46, 48, 22,
242
58, 59, 57,
243
49, 51, 50,
244
50, 52, 49,
245
51, 49, 25,
246
50, 57, 52,
247
52, 53, 47,
248
53, 52, 57,
249
53, 55, 47,
250
54, 53, 59,
251
55, 53, 54,
252
53, 57, 59,
253
56, 57, 50,
254
57, 56, 58,
255
58, 79, 59,
256
59, 60, 54,
257
60, 59, 79,
258
60, 80, 54,
259
61, 79, 58,
260
62, 51, 25,
261
39, 64, 62,
262
51, 62, 64,
263
50, 51, 66,
264
51, 64, 66,
265
63, 64, 39,
266
64, 63, 65,
267
65, 66, 64,
268
66, 56, 50,
269
56, 66, 67,
270
65, 67, 66,
271
58, 56, 70,
272
56, 67, 70,
273
67, 69, 68,
274
68, 70, 67,
275
69, 67, 65,
276
70, 61, 58,
277
68, 81, 70,
278
61, 70, 81,
279
71, 73, 84,
280
71, 81, 68,
281
72, 69, 65,
282
65, 63, 72,
283
68, 69, 73,
284
69, 72, 82,
285
73, 69, 82,
286
44, 63, 39,
287
63, 44, 83,
288
72, 63, 83,
289
73, 71, 68,
290
};
291
292
293
// 0x0701296C - 0x07012E84
294
static const PaintingData ttm_seg7_painting_top_0701296C[] = {
295
85, // num mappings
296
// Format:
297
// mesh vtx ID, texture X, texture Y
298
0, 2016, 72,
299
1, 2016, 0,
300
2, 1843, 0,
301
3, 1843, 174,
302
4, 2016, 276,
303
5, 1671, 72,
304
6, 1671, 0,
305
8, 989, 72,
306
7, 989, 0,
307
10, 821, 0,
308
9, 1162, 0,
309
11, 821, 174,
310
12, 989, 276,
311
13, 1162, 174,
312
14, 1330, 72,
313
15, 1502, 0,
314
16, 1671, 276,
315
17, 1502, 174,
316
18, 1330, 276,
317
19, 1843, 992,
318
20, 2016, 889,
319
22, 2016, 685,
320
21, 1843, 583,
321
23, 1843, 787,
322
24, 1671, 889,
323
25, 1502, 992,
324
26, 1502, 583,
325
27, 1671, 685,
326
28, 1671, 481,
327
30, 1502, 787,
328
29, 1330, 889,
329
31, 1162, 992,
330
32, 1330, 481,
331
33, 1162, 583,
332
34, 1330, 685,
333
35, 1162, 787,
334
36, 989, 889,
335
37, 821, 992,
336
39, 821, 583,
337
38, 989, 685,
338
40, 989, 481,
339
41, 2016, 481,
340
42, 1843, 378,
341
43, 1502, 378,
342
44, 1162, 378,
343
45, 821, 378,
344
87, 649, 72,
345
88, -32, 0,
346
90, 140, 0,
347
89, -32, 72,
348
92, 308, 72,
349
91, 140, 174,
350
94, 481, 174,
351
93, 649, 276,
352
95, 481, 0,
353
96, 308, 276,
354
97, 821, 787,
355
98, 649, 889,
356
99, 481, 992,
357
102, 649, 481,
358
101, 649, 685,
359
100, 481, 583,
360
103, 481, 787,
361
104, 308, 889,
362
105, 140, 992,
363
108, 308, 481,
364
107, 308, 685,
365
106, 140, 583,
366
110, -32, 889,
367
109, 140, 787,
368
111, -32, 481,
369
112, 481, 378,
370
113, 140, 378,
371
141, 1330, 0,
372
142, 2016, 992,
373
144, 1671, 992,
374
145, 1330, 992,
375
146, 989, 992,
376
147, 649, 0,
377
148, -32, 276,
378
149, 308, 0,
379
150, 649, 992,
380
151, 308, 992,
381
152, -32, 685,
382
153, -32, 992,
383
384
132, // num groups
385
// Grouped by 5 + one remainder group,
386
// = 15 vertices per group + a few extra triangles
387
10, 7, 13,
388
0, 1, 2,
389
3, 0, 2,
390
4, 0, 3,
391
5, 2, 6,
392
2, 5, 3,
393
7, 8, 9,
394
8, 7, 10,
395
11, 7, 9,
396
12, 7, 11,
397
7, 12, 13,
398
13, 14, 10,
399
14, 73, 10,
400
5, 6, 15,
401
5, 16, 3,
402
16, 5, 17,
403
17, 5, 15,
404
14, 15, 73,
405
15, 14, 17,
406
18, 14, 13,
407
14, 18, 17,
408
19, 74, 20,
409
19, 20, 23,
410
28, 27, 22,
411
21, 41, 22,
412
22, 23, 21,
413
20, 21, 23,
414
23, 24, 19,
415
22, 27, 23,
416
24, 23, 27,
417
19, 24, 75,
418
25, 75, 24,
419
25, 24, 29,
420
24, 27, 29,
421
26, 29, 27,
422
27, 28, 26,
423
31, 36, 77,
424
26, 34, 29,
425
29, 30, 25,
426
30, 29, 34,
427
25, 30, 76,
428
31, 76, 30,
429
31, 30, 35,
430
30, 34, 35,
431
32, 34, 26,
432
33, 35, 34,
433
34, 32, 33,
434
35, 36, 31,
435
33, 39, 35,
436
36, 35, 39,
437
37, 36, 56,
438
36, 39, 56,
439
37, 77, 36,
440
28, 16, 43,
441
38, 56, 39,
442
39, 40, 38,
443
40, 39, 33,
444
22, 41, 42,
445
41, 4, 42,
446
3, 42, 4,
447
42, 28, 22,
448
28, 42, 16,
449
3, 16, 42,
450
26, 28, 43,
451
17, 43, 16,
452
43, 32, 26,
453
32, 43, 18,
454
17, 18, 43,
455
33, 32, 44,
456
32, 18, 44,
457
13, 44, 18,
458
13, 12, 44,
459
44, 40, 33,
460
40, 44, 12,
461
38, 40, 45,
462
40, 12, 45,
463
11, 45, 12,
464
9, 46, 11,
465
46, 9, 78,
466
47, 49, 48,
467
48, 49, 51,
468
49, 79, 51,
469
50, 80, 48,
470
51, 50, 48,
471
57, 56, 60,
472
46, 53, 11,
473
52, 46, 54,
474
53, 46, 52,
475
46, 78, 54,
476
54, 50, 52,
477
50, 54, 80,
478
50, 55, 52,
479
55, 50, 51,
480
38, 60, 56,
481
56, 57, 37,
482
58, 57, 62,
483
57, 60, 62,
484
58, 81, 57,
485
37, 57, 81,
486
59, 60, 38,
487
60, 59, 61,
488
61, 62, 60,
489
62, 63, 58,
490
63, 62, 66,
491
61, 66, 62,
492
63, 66, 69,
493
58, 63, 82,
494
64, 82, 63,
495
64, 63, 69,
496
45, 59, 38,
497
65, 66, 61,
498
66, 65, 67,
499
67, 69, 66,
500
68, 69, 83,
501
69, 68, 64,
502
67, 83, 69,
503
64, 68, 84,
504
70, 83, 67,
505
11, 53, 45,
506
59, 45, 53,
507
59, 53, 71,
508
61, 59, 71,
509
52, 71, 53,
510
52, 55, 71,
511
65, 71, 55,
512
71, 65, 61,
513
65, 55, 72,
514
67, 65, 72,
515
51, 72, 55,
516
70, 72, 79,
517
51, 79, 72,
518
72, 70, 67,
519
};
520
521
522
// 0x07012E88
523
static const PaintingData *const ttm_seg7_painting_texture_maps_07012E88[] = {
524
ttm_seg7_painting_texture_map_bottom_07012450,
525
ttm_seg7_painting_top_0701296C,
526
};
527
528
UNUSED static const u64 ttm_unused_0 = 0x0;
529
530
531
// 0x07012E98 - 0x07012EF8
532
static const Gfx ttm_seg7_painting_dl_07012E98[] = {
533
gsSPDisplayList(ttm_seg7_dl_070123B8),
534
gsSPVertex(ttm_seg7_vertex_07012308, 8, 0),
535
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, ttm_seg7_texture_07004000),
536
gsDPLoadSync(),
537
gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 64 * 32 - 1, CALC_DXT(64, G_IM_SIZ_16b_BYTES)),
538
gsSPDisplayList(ttm_seg7_dl_07012388),
539
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, ttm_seg7_texture_07003000),
540
gsDPLoadSync(),
541
gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 64 * 32 - 1, CALC_DXT(64, G_IM_SIZ_16b_BYTES)),
542
gsSPDisplayList(ttm_seg7_dl_070123A0),
543
gsSPDisplayList(ttm_seg7_dl_07012410),
544
gsSPEndDisplayList(),
545
};
546
547
// 0x07012EF8 - 0x07012F78
548
ALIGNED8 static const Texture *const ttm_seg7_painting_textures_07012EF8[] = {
549
ttm_seg7_texture_07004000, ttm_seg7_texture_07003000,
550
};
551
552
// 0x07012F00 (PaintingData)
553
struct Painting ttm_slide_painting = {
554
/* id */ 0x0000,
555
/* Image Count */ 0x02,
556
/* Texture Type */ PAINTING_IMAGE,
557
/* Floor Status */ 0x00, 0x00, 0x00 /* which of the painting's nearby special floors Mario's on */,
558
/* Ripple Status */ 0x00,
559
/* Rotation */ 0.0f, 90.0f,
560
/* Position */ 3072.0f, 921.6f, -819.2f,
561
/* curr passive entry */
562
/* Ripple Magnitude */ 0.0f, 20.0f, 80.0f,
563
/* Ripple Decay */ 1.0f, 0.9608f, 0.9524f,
564
/* Ripple Rate */ 0.0f, 0.24f, 0.14f,
565
/* Ripple Dispersion */ 0.0f, 40.0f, 30.0f,
566
/* Curr Ripple Timer */ 0.0f,
567
/* Curr Ripple x, y */ 0.0f, 0.0f,
568
/* Normal DList */ ttm_seg7_painting_dl_07012E98,
569
/* Texture Maps */ ttm_seg7_painting_texture_maps_07012E88,
570
/* Textures */ ttm_seg7_painting_textures_07012EF8,
571
/* Texture w, h */ 64, 32,
572
/* Ripple DList */ ttm_seg7_painting_dl_07012430,
573
/* Ripple Trigger */ RIPPLE_TRIGGER_PROXIMITY,
574
/* Alpha */ 0xFF,
575
/* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */
576
/* Size */ 460.8f,
577
};
578
579