Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
hos_01.inc.c File Reference

Go to the source code of this file.

Functions

void N build_gfx_yellow_stars (s32 index)
 
void N build_gfx_blue_stars (s32 index)
 
void N build_gfx_green_stars (s32 index)
 
void N build_gfx_pink_stars (s32 index)
 
Stage A (hos_01)
 

Function Documentation

◆ build_gfx_yellow_stars()

void N build_gfx_yellow_stars ( s32 index)

Definition at line 8 of file hos_01.inc.c.

8 {
9 Vtx* firstVertex;
10 Vtx* copiedVertices;
11 s32 numVertices;
12 s32 i;
13 s32 temp3;
14
15 index--;
16 mdl_get_copied_vertices(index, &firstVertex, &copiedVertices, &numVertices);
17
18 for (i = 0; i < numVertices; i++) {
19 Vtx* vtx = &copiedVertices[i];
20 s16 temp1 = (sins(N(StarPhaseAngles)[index] * (i % 3 + 1) + i) + 0x8000) / 2;
21 s32 temp2 = temp1 * 155;
22 vtx->v.cn[0] = temp2 / 0x8000 + 100;
23 vtx->v.cn[1] = temp2 / 0x8000 + 100;
24
25 temp3 = sins(N(StarPhaseAngles)[index] / 0x8000 * (((i / 2) % 3 + 1) << 15) + N(StarPhaseAngles)[index] / 0x4000 * 0x8000 + i) + 0x8000;
26 vtx->v.cn[2] = vtx->v.cn[0] * temp3 / 0x10000;
27 }
28
29 gSPDisplayList(gMainGfxPos++, mdl_get_copied_gfx(index));
30 N(StarPhaseAngles)[index] += (s32)RAD_TO_BINANG(25.1898);
31}
Gfx * mdl_get_copied_gfx(s32 copyIndex)
Definition model.c:4086
void mdl_get_copied_vertices(s32 copyIndex, Vtx **firstVertex, Vtx **copiedVertices, s32 *numCopied)
Definition model.c:4077
#define RAD_TO_BINANG(x)
Definition macros.h:133
Gfx * gMainGfxPos
Definition cam_main.c:15

◆ build_gfx_blue_stars()

void N build_gfx_blue_stars ( s32 index)

Definition at line 33 of file hos_01.inc.c.

33 {
34 Vtx* firstVertex;
35 Vtx* copiedVertices;
36 s32 numVertices;
37 s32 i;
38 s32 temp3;
39
40 index--;
41 mdl_get_copied_vertices(index, &firstVertex, &copiedVertices, &numVertices);
42
43 for (i = 0; i < numVertices; i++) {
44 u8* colors = copiedVertices[i].v.cn;
45 s16 temp1 = (sins(N(StarPhaseAngles)[index] * (i % 3 + 1) + i) + 0x8000) / 2;
46 colors[0] = temp1 * 155 / 0x8000 + 48.62745098039216;
47 colors[1] = temp1 * 155 / 0x8000 + 89.41176470588236;
48
49 temp3 = sins(N(StarPhaseAngles)[index] / 0x8000 * (((i / 2) % 3 + 1) << 15) + N(StarPhaseAngles)[index] / 0x4000 * 0x8000 + i) + 0x8000;
50 colors[2] = colors[0] * temp3 / 0x10000 + 99.6078431372549;
51 }
52
53 gSPDisplayList(gMainGfxPos++, mdl_get_copied_gfx(index));
54 N(StarPhaseAngles)[index] += (s32)RAD_TO_BINANG(25.1898);
55}

◆ build_gfx_green_stars()

void N build_gfx_green_stars ( s32 index)

Definition at line 57 of file hos_01.inc.c.

57 {
58 Vtx* firstVertex;
59 Vtx* copiedVertices;
60 s32 numVertices;
61 s32 i;
62 s32 temp3;
63
64 index--;
65 mdl_get_copied_vertices(index, &firstVertex, &copiedVertices, &numVertices);
66
67 for (i = 0; i < numVertices; i++) {
68 u8* colors = copiedVertices[i].v.cn;
69 s16 temp1 = (sins(N(StarPhaseAngles)[index] * (i % 3 + 1) + i) + 0x8000) / 2;
70 colors[0] = temp1 * 155 / 0x8000 + 67.45098039215686;
71 colors[1] = temp1 * 155 / 0x8000 + 100.0;
72
73 temp3 = sins(N(StarPhaseAngles)[index] / 0x8000 * (((i / 2) % 3 + 1) << 15) + N(StarPhaseAngles)[index] / 0x4000 * 0x8000 + i) + 0x8000;
74 colors[2] = colors[0] * temp3 / 0x10000 + 59.21568627450981;
75 }
76
77 gSPDisplayList(gMainGfxPos++, mdl_get_copied_gfx(index));
78 N(StarPhaseAngles)[index] += (s32)RAD_TO_BINANG(25.1898);
79}

◆ build_gfx_pink_stars()

void N build_gfx_pink_stars ( s32 index)

Definition at line 81 of file hos_01.inc.c.

81 {
82 Vtx* firstVertex;
83 Vtx* copiedVertices;
84 s32 numVertices;
85 s32 i;
86 s32 temp3;
87
88 index--;
89 mdl_get_copied_vertices(index, &firstVertex, &copiedVertices, &numVertices);
90
91 for (i = 0; i < numVertices; i++) {
92 u8* colors = copiedVertices[i].v.cn;
93 s16 temp1 = (sins(N(StarPhaseAngles)[index] * (i % 3 + 1) + i) + 0x8000) / 2;
94 colors[0] = temp1 * 155 / 0x8000 + 100.0;
95 colors[1] = temp1 * 155 / 0x8000 + 80.3921568627451;
96
97 temp3 = sins(N(StarPhaseAngles)[index] / 0x8000 * (((i / 2) % 3 + 1) << 15) + N(StarPhaseAngles)[index] / 0x4000 * 0x8000 + i) + 0x8000;
98 colors[2] = colors[0] * temp3 / 0x10000 + 96.07843137254902;
99 }
100
101 gSPDisplayList(gMainGfxPos++, mdl_get_copied_gfx(index));
102 N(StarPhaseAngles)[index] += (s32)RAD_TO_BINANG(25.1898);
103}

◆ A()

Stage A ( hos_01 )