SSBM Decomp
Loading...
Searching...
No Matches
GXDraw.c File Reference
#include <macros.h>
#include <math.h>
#include "__gx.h"
#include <dolphin/gx.h>
#include <dolphin/os.h>

Functions

static void GetVertState (void)
static void RestoreVertState (void)
static void vsub (f32 p1[3], f32 p2[3], f32 u[3])
static void vcross (f32 u[3], f32 v[3], f32 n[3])
static void normalize (f32 v[3])
static void myvertex (f32 v[3], f32 n[3])
static void DumpTriangle (f32 v0[3], f32 v1[3], f32 v2[3])
static void Subdivide (u8 depth, f32 v0[3], f32 v1[3], f32 v2[3])
static void SubDivTriangle (u8 depth, u8 i, f32(*data)[3], u8(*ndx)[3])
void GXDrawCylinder (u8 numEdges)
void GXDrawTorus (f32 rc, u8 numc, u8 numt)
void GXDrawSphere (u8 numMajor, u8 numMinor)
static void GXDrawCubeFace (f32 nx, f32 ny, f32 nz, f32 tx, f32 ty, f32 tz, f32 bx, f32 by, f32 bz, GXAttrType binormal, GXAttrType texture)
void GXDrawCube (void)
void GXDrawDodeca (void)
void GXDrawOctahedron (void)
void GXDrawIcosahedron (void)
void GXDrawSphere1 (u8 depth)
static u32 CmpNormal32 (f32 n1[3], f32 n2[3])
static void AddNormal (f32 n[3])
static void SubdivideNrm (u8 depth, f32 v0[3], f32 v1[3], f32 v2[3])
static void SubDivNrm (u8 depth, u8 i, f32(*data)[3], u8(*ndx)[3])
u32 GXGenNormalTable (u8 depth, f32 *table)

Variables

static GXVtxDescList vcd [27]
static GXVtxAttrFmtList vat [27]
static u32 polygons [12][5]
static f32 verts [20][3]
static f32 odata [6][3]
static u8 ondex [8][3]
static f32 idata [12][3]
static u8 index [20][3]
static u32 nrm_cnt
static f32nrm_tab

Function Documentation

◆ GetVertState()

void GetVertState ( void )
static

◆ RestoreVertState()

void RestoreVertState ( void )
static

◆ vsub()

void vsub ( f32 p1[3],
f32 p2[3],
f32 u[3] )
static

◆ vcross()

void vcross ( f32 u[3],
f32 v[3],
f32 n[3] )
static

◆ normalize()

void normalize ( f32 v[3])
static

◆ myvertex()

void myvertex ( f32 v[3],
f32 n[3] )
static

◆ DumpTriangle()

void DumpTriangle ( f32 v0[3],
f32 v1[3],
f32 v2[3] )
static

◆ Subdivide()

void Subdivide ( u8 depth,
f32 v0[3],
f32 v1[3],
f32 v2[3] )
static

◆ SubDivTriangle()

void SubDivTriangle ( u8 depth,
u8 i,
f32(*) data[3],
u8(*) ndx[3] )
static

◆ GXDrawCylinder()

void GXDrawCylinder ( u8 numEdges)

◆ GXDrawTorus()

void GXDrawTorus ( f32 rc,
u8 numc,
u8 numt )

◆ GXDrawSphere()

void GXDrawSphere ( u8 numMajor,
u8 numMinor )

◆ GXDrawCubeFace()

void GXDrawCubeFace ( f32 nx,
f32 ny,
f32 nz,
f32 tx,
f32 ty,
f32 tz,
f32 bx,
f32 by,
f32 bz,
GXAttrType binormal,
GXAttrType texture )
static

◆ GXDrawCube()

void GXDrawCube ( void )

◆ GXDrawDodeca()

void GXDrawDodeca ( void )

◆ GXDrawOctahedron()

void GXDrawOctahedron ( void )

◆ GXDrawIcosahedron()

void GXDrawIcosahedron ( void )

◆ GXDrawSphere1()

void GXDrawSphere1 ( u8 depth)

◆ CmpNormal32()

u32 CmpNormal32 ( f32 n1[3],
f32 n2[3] )
static

◆ AddNormal()

void AddNormal ( f32 n[3])
static

◆ SubdivideNrm()

void SubdivideNrm ( u8 depth,
f32 v0[3],
f32 v1[3],
f32 v2[3] )
static

◆ SubDivNrm()

void SubDivNrm ( u8 depth,
u8 i,
f32(*) data[3],
u8(*) ndx[3] )
static

◆ GXGenNormalTable()

u32 GXGenNormalTable ( u8 depth,
f32 * table )

Variable Documentation

◆ vcd

GXVtxDescList vcd[27]
static

◆ vat

GXVtxAttrFmtList vat[27]
static

◆ polygons

u32 polygons[12][5]
static
Initial value:
= {
{ 0, 12, 10, 11, 16 }, { 1, 17, 8, 9, 13 }, { 2, 14, 9, 8, 18 },
{ 3, 19, 11, 10, 15 }, { 4, 14, 2, 3, 15 }, { 5, 12, 0, 1, 13 },
{ 6, 17, 1, 0, 16 }, { 7, 19, 3, 2, 18 }, { 8, 17, 6, 7, 18 },
{ 9, 14, 4, 5, 13 }, { 10, 12, 5, 4, 15 }, { 11, 19, 7, 6, 16 },
}

◆ verts

f32 verts[20][3]
static
Initial value:
= {
{ -0.809015f, 0.0f, 0.309015f },
{ -0.809015f, 0.0f, -0.309015f },
{ 0.809015f, 0.0f, -0.309015f },
{ 0.809015f, 0.0f, 0.309015f },
{ 0.309015f, -0.809015f, 0.0f },
{ -0.309015f, -0.809015f, 0.0f },
{ -0.309015f, 0.809015f, 0 },
{ 0.309015f, 0.809015f, 0 },
{ 0.0f, 0.309015f, -0.809015f },
{ 0.0f, -0.309015f, -0.809015f },
{ 0.0f, -0.309015f, 0.809015f },
{ 0.0f, 0.309015f, 0.809015f },
{ -0.5f, -0.5f, 0.5 },
{ -0.5f, -0.5f, -0.5 },
{ 0.5f, -0.5f, -0.5 },
{ 0.5f, -0.5f, 0.5 },
{ -0.5f, 0.5f, 0.5 },
{ -0.5f, 0.5f, -0.5 },
{ 0.5f, 0.5f, -0.5 },
{ 0.5f, 0.5f, 0.5 },
}

◆ odata

f32 odata[6][3]
static
Initial value:
= {
{ 1.0f, 0.0f, 0.0f }, { -1.0f, 0.0f, 0.0f }, { 0.0f, 1.0f, 0.0f },
{ 0.0f, -1.0f, 0.0f }, { 0.0f, 0.0f, 1.0f }, { 0.0f, 0.0f, -1.0f },
}

◆ ondex

u8 ondex[8][3]
static
Initial value:
= {
{ 0, 4, 2 }, { 1, 2, 4 }, { 0, 3, 4 }, { 1, 4, 3 },
{ 0, 2, 5 }, { 1, 5, 2 }, { 0, 5, 3 }, { 1, 3, 5 },
}

◆ idata

f32 idata[12][3]
static
Initial value:
= {
{ -0.5257311f, 0.0f, 0.8506508f }, { 0.5257311f, 0.0f, 0.8506508f },
{ -0.5257311f, 0.0f, -0.8506508f }, { 0.5257311f, 0.0f, -0.8506508f },
{ 0.0f, 0.8506508f, 0.5257311f }, { 0.0f, 0.8506508f, -0.5257311f },
{ 0.0f, -0.8506508f, 0.5257311f }, { 0.0f, -0.8506508f, -0.5257311f },
{ 0.8506508f, 0.5257311f, 0.0f }, { -0.8506508f, 0.5257311f, 0.0f },
{ 0.8506508f, -0.5257311f, 0.0f }, { -0.8506508f, -0.5257311f, 0.0f },
}

◆ index

u8 index[20][3]
static
Initial value:
= {
{ 0, 4, 1 }, { 0, 9, 4 }, { 9, 5, 4 }, { 4, 5, 8 }, { 4, 8, 1 },
{ 8, 10, 1 }, { 8, 3, 10 }, { 5, 3, 8 }, { 5, 2, 3 }, { 2, 7, 3 },
{ 7, 10, 3 }, { 7, 6, 10 }, { 7, 11, 6 }, { 11, 0, 6 }, { 0, 1, 6 },
{ 6, 1, 10 }, { 9, 0, 11 }, { 9, 11, 2 }, { 9, 2, 5 }, { 7, 2, 11 },
}

◆ nrm_cnt

u32 nrm_cnt
static

◆ nrm_tab

f32* nrm_tab
static