Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
Functions | Variables
draw_objects.h File Reference
#include "gd_types.h"

Go to the source code of this file.

Functions

void draw_light (struct ObjLight *)
 
void draw_material (struct ObjMaterial *)
 
struct GdColourgd_get_colour (s32)
 Convert a numeric index into pointer to a struct GdColour. More...
 
void draw_face (struct ObjFace *)
 Rendering function for ObjFace structures. More...
 
void draw_label (struct ObjLabel *)
 
void draw_net (struct ObjNet *)
 
void draw_gadget (struct ObjGadget *)
 
void draw_camera (struct ObjCamera *)
 
void func_80179B9C (struct GdVec3f *, struct ObjCamera *, struct ObjView *)
 
void nop_obj_draw (struct GdObj *)
 
void draw_particle (struct GdObj *)
 Rendering function for ObjParticle. More...
 
void draw_bone (struct GdObj *)
 Rendering fucntion for ObjBone. More...
 
void draw_joint (struct GdObj *)
 Rendering function for ObjJoint. More...
 
void draw_group (struct ObjGroup *)
 Call apply_obj_draw_fn() to all GdObj in input ObjGroup More...
 
void draw_plane (struct GdObj *)
 Rendering function for ObjPlane. More...
 
void apply_obj_draw_fn (struct GdObj *)
 Apply GdObj.objDrawFn to the input GdObj if that object is draw-able. More...
 
void create_gddl_for_shapes (struct ObjGroup *)
 Create GdDisplayList structs for all ObjShapes in grp by calling create_shape_gddl(). More...
 
void map_face_materials (struct ObjGroup *, struct ObjGroup *)
 Map material id's to ObjMaterial pointers for an ObjGroup of ObjFace structs. More...
 
void map_vertices (struct ObjGroup *, struct ObjGroup *)
 Convert vertex ID numbers for an ObjGroup of ObjFaces into pointers to ObjVertex structures. More...
 
void update_view (struct ObjView *)
 The main per-frame function for handling a view. More...
 

Variables

struct ObjCameragViewUpdateCamera
 
u8 gUnref_801B9B30 [0x88]
 
struct ObjGroupgGdLightGroup
 

Function Documentation

◆ apply_obj_draw_fn()

void apply_obj_draw_fn ( struct GdObj obj)

Apply GdObj.objDrawFn to the input GdObj if that object is draw-able.

Parameters
objGdObj to draw
Returns
void

◆ create_gddl_for_shapes()

void create_gddl_for_shapes ( struct ObjGroup grp)

Create GdDisplayList structs for all ObjShapes in grp by calling create_shape_gddl().

Parameters
grpObjGroup containing ObjShape to create GdDLs for
Returns
void
Note
Contains string literals that suggest a removed printf call

◆ draw_bone()

void draw_bone ( struct GdObj obj)

Rendering fucntion for ObjBone.

Note
This function returns before doing any work. It seems that Goddard moved away from using bones in the final code

◆ draw_camera()

void draw_camera ( struct ObjCamera )

◆ draw_face()

void draw_face ( struct ObjFace face)

Rendering function for ObjFace structures.

It has a fair amount of stub code

Bug:
This function seems to have some parts based on older versions of ObjVertex as the struct requests fields passed the end of an ObjVertex. The bad code is statically unreachable, so...

◆ draw_gadget()

void draw_gadget ( struct ObjGadget )

◆ draw_group()

void draw_group ( struct ObjGroup grp)

Call apply_obj_draw_fn() to all GdObj in input ObjGroup

Parameters
grpObjGroup of objects to draw
Returns
void

◆ draw_joint()

void draw_joint ( struct GdObj )

Rendering function for ObjJoint.

◆ draw_label()

void draw_label ( struct ObjLabel )

◆ draw_light()

void draw_light ( struct ObjLight )

◆ draw_material()

void draw_material ( struct ObjMaterial )

◆ draw_net()

void draw_net ( struct ObjNet )

◆ draw_particle()

void draw_particle ( struct GdObj )

Rendering function for ObjParticle.

◆ draw_plane()

void draw_plane ( struct GdObj )

Rendering function for ObjPlane.

◆ func_80179B9C()

void func_80179B9C ( struct GdVec3f ,
struct ObjCamera ,
struct ObjView  
)

◆ gd_get_colour()

struct GdColour* gd_get_colour ( s32  idx)

Convert a numeric index into pointer to a struct GdColour.

A simple switch case to convert from index idx to a pointer to the three f32 GdColour structure. Goddard stored the index in a structure, and uses this function to get the colour RGB values if needed. -1 uses the environment colour. A possible enhancement for this is to ennumerate all colours, and then use those enumerations and/or enum type where ever a colour is requested

Parameters
idxIndex of colour
Returns
Pointer to a GdColour struct

◆ map_face_materials()

void map_face_materials ( struct ObjGroup faces,
struct ObjGroup mtls 
)

Map material id's to ObjMaterial pointers for an ObjGroup of ObjFace structs.

This is the final function used in dynlist processing (see chk_shapegen())

Parameters
[in,out]facesObjGroup of ObjFace structs to map over
[in]mtlsObjGroup of ObjMaterial structs to map ids to pointers
Returns
void

◆ map_vertices()

void map_vertices ( struct ObjGroup facegrp,
struct ObjGroup vtxgrp 
)

Convert vertex ID numbers for an ObjGroup of ObjFaces into pointers to ObjVertex structures.

This function takes an ObjGroup of ObjFace structures whose vertices field has indices and not pointers. These indices are transformed into pointers of ObjVertex or ObjParticle structures from the vtxgrp ObjGroup.

Parameters
facegrpObjGroup of ObjFaces to map vertex indices to pointers
vtxgrpObjGroup of ObjVertices/ObjParticles to be mapped against
Returns
void
Note
It seems that this function was replaced by chk_shapegen(), which performs a very similar task...

◆ nop_obj_draw()

void nop_obj_draw ( struct GdObj )

◆ update_view()

void update_view ( struct ObjView view)

The main per-frame function for handling a view.

This function handles updating and rendering a given ObjView structure. It also handles the A button input for grabbing an area of an ObjShape that is contained in the ObjView.components group

Parameters
viewThe ObjView to update
Returns
void

Variable Documentation

◆ gGdLightGroup

struct ObjGroup* gGdLightGroup

◆ gUnref_801B9B30

u8 gUnref_801B9B30[0x88]

◆ gViewUpdateCamera

struct ObjCamera* gViewUpdateCamera