Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
Enumerations | Functions
dynlist_proc.h File Reference
#include <ultra64.h>
#include "gd_types.h"

Go to the source code of this file.

Enumerations

enum  DParmPtr { PARM_PTR_OBJ_VTX = 1, PARM_PTR_CHAR = 5 }
 parameters types for d_set_parm_ptr() More...
 
enum  DParmF { PARM_F_ALPHA = 1, PARM_F_RANGE_LEFT = 2, PARM_F_RANGE_RIGHT = 3, PARM_F_VARVAL = 6 }
 parameters for d_set_parm_f() More...
 
enum  DObjTypes {
  D_CAR_DYNAMICS = 0, D_NET = 1, D_JOINT = 2, D_ANOTHER_JOINT = 3,
  D_CAMERA = 4, D_VERTEX = 5, D_FACE = 6, D_PLANE = 7,
  D_BONE = 8, D_MATERIAL = 9, D_SHAPE = 10, D_GADGET = 11,
  D_LABEL = 12, D_VIEW = 13, D_ANIMATOR = 14, D_DATA_GRP = 15,
  D_PARTICLE = 16, D_LIGHT = 17, D_GROUP = 18
}
 d_makeobj() object types More...
 

Functions

void push_dynobj_stash (void)
 Store the active dynamic GdObj into a one object stash. More...
 
void pop_dynobj_stash (void)
 Set the stashed GdObj as the active dynamic GdObj. More...
 
void reset_dynlist (void)
 Reset dynlist related variables to a starting state. More...
 
struct GdObjproc_dynlist (struct DynList *dylist)
 Parse a DynList array into active GdObjs. More...
 
void d_copystr_to_idbuf (char *)
 Copy input str into a buffer that will be concatenated to a dynamic GdObj's name string when creating a new dynamic object. More...
 
struct GdObjd_makeobj (enum DObjTypes type, DynId id)
 Create a new GdObj of type and add that object to the dynamic object list with id. More...
 
void d_set_shapeptrptr (struct ObjShape **)
 Set the shape pointer of the current active dynamic object to the pointer pointed to by shpPtrptr. More...
 
struct GdObjd_use_obj (DynId)
 Set the current active dynamic object to object id. More...
 
void set_cur_dynobj ()
 
void d_start_group (DynId)
 Start a dynamic ObjGroup identified with id. More...
 
void d_end_group (DynId)
 Add all dynamic objects created between the start of dynamic ObjGroup id and this call. More...
 
void dynid_is_int (s32)
 Set if DynId should be treated as integer values, or as char * string pointers. More...
 
void d_set_init_pos (f32, f32, f32)
 Set the initial position of the current dynamic object to (x, y, z). More...
 
void d_get_init_pos (struct GdVec3f *)
 Get the initial position of the current dynamic object and store in dst. More...
 
void d_get_init_rot (struct GdVec3f *)
 Get the initial rotation of the current dynamic object and store in dst. More...
 
void d_set_rel_pos (f32, f32, f32)
 Set the position of the current dynamic object. More...
 
void d_get_rel_pos (struct GdVec3f *)
 Store the current dynamic object's position into dst. More...
 
struct ObjGroupd_get_att_objgroup (void)
 Return a pointer to the attached object group of the current dynamic object. More...
 
void d_get_scale (struct GdVec3f *)
 Store the current dynamic object's scale into dst. More...
 
void d_set_world_pos (f32, f32, f32)
 Set the world position of the current dynamic object. More...
 
void d_get_world_pos (struct GdVec3f *)
 Copy the world position of the current dynamic object into dst. More...
 
void d_set_scale (f32, f32, f32)
 Scale the current dynamic object by factor (x, y, z). More...
 
void d_add_valptr (DynId, u32, s32, u32)
 Create a new ObjValPtr to dynamic object objId and attach that valptr to the current dynamic object. More...
 
void d_add_valproc (union ObjVarVal *(*)(union ObjVarVal *, union ObjVarVal))
 
void d_set_flags (s32)
 Set the object specific flags of the current dynamic object. More...
 
void d_set_parm_f (enum DParmF, f32)
 Set variable float parameters on the current dynamic object. More...
 
void d_set_parm_ptr (enum DParmPtr, void *)
 Set various pointer parameters for the current dynamic object. More...
 
void d_set_obj_draw_flag (enum ObjDrawingFlags)
 Set the generic drawing flags for the current dynamic object. More...
 
void d_set_type (s32)
 Set an object specific type field for the current dynamic object. More...
 
void d_set_colour_num (s32)
 Set the colour of the current dynamic object. More...
 
void d_set_diffuse (f32, f32, f32)
 Set the diffuse color of the current dynamic ObjMaterial or ObjLight. More...
 
struct GdPlaneFd_get_plane (void)
 Get a pointer to a GdPlaneF in the current dynamic object. More...
 
void d_get_matrix (Mat4f *)
 Copy the matrix from the current dynamic object into dst. More...
 
Mat4fd_get_rot_mtx_ptr (void)
 Get a pointer to the current dynamic object's rotation matrix. More...
 
void d_set_idn_mtx (Mat4f *)
 Copy src into the identity matrix of the current dynamic object. More...
 
Mat4fd_get_matrix_ptr (void)
 Get a pointer to the current dynamic object's matrix. More...
 
Mat4fd_get_idn_mtx_ptr (void)
 Get a pointer to the current dynamic object's identity matrix. More...
 
f32 d_calc_world_dist_btwn (struct GdObj *, struct GdObj *)
 Use the dynamic object system to calculate the distance between two GdObjs. More...
 

DynId Type

A new type for identification of GdObjs in the dynamic object list.

#define DynIdAsStr(id)   ((char *)(id))
 Macros for casting between types of ids, as the id can be either a number or a string. More...
 
#define DynIdAsInt(id)   ((u32)(id))
 
#define AsDynId(unk)   ((DynId)(unk))
 
typedef voidDynId
 

Macro Definition Documentation

◆ AsDynId

#define AsDynId (   unk)    ((DynId)(unk))

◆ DynIdAsInt

#define DynIdAsInt (   id)    ((u32)(id))

◆ DynIdAsStr

#define DynIdAsStr (   id)    ((char *)(id))

Macros for casting between types of ids, as the id can be either a number or a string.

Typedef Documentation

◆ DynId

Enumeration Type Documentation

◆ DObjTypes

enum DObjTypes

d_makeobj() object types

Enumerator
D_CAR_DYNAMICS 
D_NET 
D_JOINT 
D_ANOTHER_JOINT 
D_CAMERA 
D_VERTEX 
D_FACE 
D_PLANE 
D_BONE 
D_MATERIAL 
D_SHAPE 
D_GADGET 
D_LABEL 
D_VIEW 
D_ANIMATOR 
D_DATA_GRP 

An ObjGroup that links to raw vertex or face data.

D_PARTICLE 
D_LIGHT 
D_GROUP 

◆ DParmF

enum DParmF

parameters for d_set_parm_f()

Enumerator
PARM_F_ALPHA 

Set the alpha value for an ObjShape or ObjVertex

PARM_F_RANGE_LEFT 

Set the left range for an ObjGadget

PARM_F_RANGE_RIGHT 

Set the right range for an ObjGadget

PARM_F_VARVAL 

Set the float variable value union in an ObjGadget

◆ DParmPtr

enum DParmPtr

parameters types for d_set_parm_ptr()

Enumerator
PARM_PTR_OBJ_VTX 

parameter is an ObjVertex to add to an ObjFace

PARM_PTR_CHAR 

parameter is a char *

Function Documentation

◆ d_add_valproc()

void d_add_valproc ( union ObjVarVal *)(union ObjVarVal *, union ObjVarVal)

◆ d_add_valptr()

void d_add_valptr ( DynId  objId,
u32  vflags,
s32  type,
u32  offset 
)

Create a new ObjValPtr to dynamic object objId and attach that valptr to the current dynamic object.

Parameters
typeValPtrType

◆ d_calc_world_dist_btwn()

f32 d_calc_world_dist_btwn ( struct GdObj obj1,
struct GdObj obj2 
)

Use the dynamic object system to calculate the distance between two GdObjs.

The objects don't have to be dynamic objects.

◆ d_copystr_to_idbuf()

void d_copystr_to_idbuf ( char str)

Copy input str into a buffer that will be concatenated to a dynamic GdObj's name string when creating a new dynamic object.

If input is NULL, then a generic string is created based on the number of unnamed objects.

◆ d_end_group()

void d_end_group ( DynId  )

Add all dynamic objects created between the start of dynamic ObjGroup id and this call.

◆ d_get_att_objgroup()

struct ObjGroup* d_get_att_objgroup ( void  )

Return a pointer to the attached object group of the current dynamic object.

◆ d_get_idn_mtx_ptr()

Mat4f* d_get_idn_mtx_ptr ( void  )

Get a pointer to the current dynamic object's identity matrix.

◆ d_get_init_pos()

void d_get_init_pos ( struct GdVec3f )

Get the initial position of the current dynamic object and store in dst.

◆ d_get_init_rot()

void d_get_init_rot ( struct GdVec3f )

Get the initial rotation of the current dynamic object and store in dst.

◆ d_get_matrix()

void d_get_matrix ( Mat4f )

Copy the matrix from the current dynamic object into dst.

◆ d_get_matrix_ptr()

Mat4f* d_get_matrix_ptr ( void  )

Get a pointer to the current dynamic object's matrix.

◆ d_get_plane()

struct GdPlaneF* d_get_plane ( void  )

Get a pointer to a GdPlaneF in the current dynamic object.

If the current object does not have a plane, a pointer to a global plane at (0,0) is returned.

◆ d_get_rel_pos()

void d_get_rel_pos ( struct GdVec3f )

Store the current dynamic object's position into dst.

◆ d_get_rot_mtx_ptr()

Mat4f* d_get_rot_mtx_ptr ( void  )

Get a pointer to the current dynamic object's rotation matrix.

◆ d_get_scale()

void d_get_scale ( struct GdVec3f )

Store the current dynamic object's scale into dst.

◆ d_get_world_pos()

void d_get_world_pos ( struct GdVec3f )

Copy the world position of the current dynamic object into dst.

◆ d_makeobj()

struct GdObj* d_makeobj ( enum DObjTypes  type,
DynId  id 
)

Create a new GdObj of type and add that object to the dynamic object list with id.

Created objects have default parameters, which are usually 0 or NULL.

Returns
pointer to created object
Bug:
Returns garbage when making D_DATA_GRP object
Bug:
When making a D_LABEL, the call to make_label() compiles incorrectly due to Goddard only declaring the functions, not prototyping the functions

◆ d_set_colour_num()

void d_set_colour_num ( s32  colornum)

Set the colour of the current dynamic object.

The input color is an index for gd_get_colour()

◆ d_set_diffuse()

void d_set_diffuse ( f32  ,
f32  ,
f32   
)

Set the diffuse color of the current dynamic ObjMaterial or ObjLight.

◆ d_set_flags()

void d_set_flags ( s32  )

Set the object specific flags of the current dynamic object.

◆ d_set_idn_mtx()

void d_set_idn_mtx ( Mat4f )

Copy src into the identity matrix of the current dynamic object.

◆ d_set_init_pos()

void d_set_init_pos ( f32  ,
f32  ,
f32   
)

Set the initial position of the current dynamic object to (x, y, z).

◆ d_set_obj_draw_flag()

void d_set_obj_draw_flag ( enum  ObjDrawingFlags)

Set the generic drawing flags for the current dynamic object.

◆ d_set_parm_f()

void d_set_parm_f ( enum DParmF  param,
f32  val 
)

Set variable float parameters on the current dynamic object.

These are mainly used for ObjGadgets to set the drawing size range.

◆ d_set_parm_ptr()

void d_set_parm_ptr ( enum DParmPtr  param,
void ptr 
)

Set various pointer parameters for the current dynamic object.

Normally, this is used to set char * pointer for various objects, but it can also set the vertices for an ObjFace.

◆ d_set_rel_pos()

void d_set_rel_pos ( f32  x,
f32  y,
f32  z 
)

Set the position of the current dynamic object.

Note
This function automatically adjusts the three zoom levels for an ObjCamera.

◆ d_set_scale()

void d_set_scale ( f32  x,
f32  y,
f32  z 
)

Scale the current dynamic object by factor (x, y, z).

Note
Sets the lower right coordinates of an ObjView

◆ d_set_shapeptrptr()

void d_set_shapeptrptr ( struct ObjShape **  )

Set the shape pointer of the current active dynamic object to the pointer pointed to by shpPtrptr.

◆ d_set_type()

void d_set_type ( s32  )

Set an object specific type field for the current dynamic object.

◆ d_set_world_pos()

void d_set_world_pos ( f32  x,
f32  y,
f32  z 
)

Set the world position of the current dynamic object.

Note
Sets the upper left coordinates of an ObjView

◆ d_start_group()

void d_start_group ( DynId  )

Start a dynamic ObjGroup identified with id.

◆ d_use_obj()

struct GdObj* d_use_obj ( DynId  )

Set the current active dynamic object to object id.

◆ dynid_is_int()

void dynid_is_int ( s32  isIntBool)

Set if DynId should be treated as integer values, or as char * string pointers.

Parameters
isIntBoolTRUE to interpret ids as integers

◆ pop_dynobj_stash()

void pop_dynobj_stash ( void  )

Set the stashed GdObj as the active dynamic GdObj.

◆ proc_dynlist()

struct GdObj* proc_dynlist ( struct DynList dylist)

Parse a DynList array into active GdObjs.

Returns
Pointer to current dynamically created dynamic GdObj. Normally the dynlist specifically sets an object for return.

◆ push_dynobj_stash()

void push_dynobj_stash ( void  )

Store the active dynamic GdObj into a one object stash.

◆ reset_dynlist()

void reset_dynlist ( void  )

Reset dynlist related variables to a starting state.

◆ set_cur_dynobj()

void set_cur_dynobj ( )