Loading [MathJax]/extensions/tex2jax.js
Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
GXDraw.c File Reference

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

◆ AddNormal()

static void AddNormal ( f32 n[3])
static

◆ CmpNormal32()

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

◆ DumpTriangle()

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

◆ GetVertState()

static void GetVertState ( void )
static

◆ GXDrawCube()

void GXDrawCube ( void )

◆ GXDrawCubeFace()

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 )
static

◆ GXDrawCylinder()

void GXDrawCylinder ( u8 numEdges)

◆ GXDrawDodeca()

void GXDrawDodeca ( void )

◆ GXDrawIcosahedron()

void GXDrawIcosahedron ( void )

◆ GXDrawOctahedron()

void GXDrawOctahedron ( void )

◆ GXDrawSphere()

void GXDrawSphere ( u8 numMajor,
u8 numMinor )

◆ GXDrawSphere1()

void GXDrawSphere1 ( u8 depth)

◆ GXDrawTorus()

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

◆ GXGenNormalTable()

u32 GXGenNormalTable ( u8 depth,
f32 * table )

◆ myvertex()

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

◆ normalize()

static void normalize ( f32 v[3])
static

◆ RestoreVertState()

static void RestoreVertState ( void )
static

◆ Subdivide()

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

◆ SubdivideNrm()

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

◆ SubDivNrm()

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

◆ SubDivTriangle()

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

◆ vcross()

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

◆ vsub()

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

Variable Documentation

◆ 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

◆ 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 },
}

◆ 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 },
}

◆ vat

GXVtxAttrFmtList vat[27]
static

◆ vcd

GXVtxDescList vcd[27]
static

◆ 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 },
}