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

Go to the source code of this file.

Functions

void N build_gfx_star (s32 index)
 

Function Documentation

◆ build_gfx_star()

void N build_gfx_star ( s32 index)

Definition at line 7 of file Snowflakes.inc.c.

7 {
8 Vtx* firstVertex;
9 Vtx* copiedVertices;
10 s32 numVertices;
11 s32 i;
12 s32 temp3;
13
14 mdl_get_copied_vertices(index, &firstVertex, &copiedVertices, &numVertices);
15
16 for (i = 0; i < numVertices; i++) {
17 Vtx* vtx = &copiedVertices[i];
18 s16 temp1 = (sins(N(StarAnimPhases)[index] * (i % 3 + 1) + i) + 0x8000) / 2;
19 s32 temp2 = temp1 * 155;
20 vtx->v.cn[2] = temp2 / 0x8000 + 100;
21 vtx->v.cn[1] = temp2 / 0x8000 + 50;
22
23 temp3 = sins(N(StarAnimPhases)[index] / 0x8000 * (((i / 2) % 3 + 1) << 15) + N(StarAnimPhases)[index] / 0x4000 * 0x8000 + i) + 0x8000;
24 vtx->v.cn[0] = vtx->v.cn[0] * temp3 / 0x10000;
25 }
26
27 gSPDisplayList(gMainGfxPos++, mdl_get_copied_gfx(index));
28 N(StarAnimPhases)[index] += 0x253;
29}
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
Gfx * gMainGfxPos
Definition cam_main.c:15