sm64

A Super Mario 64 decompilation
Log | Files | Refs | README | LICENSE

dynlist_proc.h (3350B)


      1 #ifndef GD_DYNLIST_PROCESSOR_H
      2 #define GD_DYNLIST_PROCESSOR_H
      3 
      4 #include <PR/ultratypes.h>
      5 
      6 #include "gd_types.h"
      7 
      8 // types
      9 /// @name DynObjName Type
     10 /// @{
     11 /// A new type for identification of `GdObj`s in the dynamic object list.
     12 typedef void *DynObjName;
     13 /// Macros for casting between types of names,
     14 /// as the name can be either a number or a string.
     15 /// @{
     16 #define DynNameAsStr(name) ((char *)(name))
     17 #define DynNameAsInt(name) ((u32)(uintptr_t)(name))
     18 #define AsDynName(unk)   ((DynObjName)(unk))
     19 /// @}
     20 /// @}
     21 
     22 /// parameters types for `d_set_parm_ptr()`
     23 enum DParmPtr {
     24     PARM_PTR_OBJ_VTX = 1, ///< parameter is the index of a vertex to add to an `ObjFace`
     25     PARM_PTR_CHAR    = 5  ///< parameter is a `char *`
     26 };
     27 
     28 /// parameters for `d_set_parm_f()`
     29 enum DParmF {
     30     PARM_F_ALPHA = 1,       ///< Set the alpha value for an `ObjShape` or `ObjVertex`
     31     PARM_F_RANGE_MIN = 2,  ///< Set the left range for an `ObjGadget`
     32     PARM_F_RANGE_MAX = 3, ///< Set the right range for an `ObjGadget`
     33     PARM_F_VARVAL = 6       ///< Set the float variable value union in an `ObjGadget`
     34 };
     35 
     36 /// `d_makeobj()` object types
     37 enum DObjTypes {
     38     D_CAR_DYNAMICS  = 0,
     39     D_NET           = 1,
     40     D_JOINT         = 2,
     41     D_ANOTHER_JOINT = 3,
     42     D_CAMERA        = 4,
     43     D_VERTEX        = 5,
     44     D_FACE          = 6,
     45     D_PLANE         = 7,
     46     D_BONE          = 8,
     47     D_MATERIAL      = 9,
     48     D_SHAPE         = 10,
     49     D_GADGET        = 11,
     50     D_LABEL         = 12,
     51     D_VIEW          = 13,
     52     D_ANIMATOR      = 14,
     53     D_DATA_GRP      = 15, ///< An `ObjGroup` that links to raw vertex or face data
     54     D_PARTICLE      = 16,
     55     D_LIGHT         = 17,
     56     D_GROUP         = 18
     57 };
     58 
     59 // functions
     60 void d_stash_dynobj(void);
     61 void d_unstash_dynobj(void);
     62 void reset_dynlist(void);
     63 struct GdObj *proc_dynlist(struct DynList *dylist);
     64 void d_set_name_suffix(char *str);
     65 struct GdObj *d_makeobj(enum DObjTypes type, DynObjName name);
     66 void d_set_shapeptrptr(struct ObjShape **shpPtrptr);
     67 struct GdObj *d_use_obj(DynObjName name);
     68 void set_cur_dynobj(struct GdObj *obj);
     69 void d_start_group(DynObjName name);
     70 void d_end_group(DynObjName name);
     71 void d_use_integer_names(s32 isIntBool);
     72 void d_set_init_pos(f32 x, f32 y, f32 z);
     73 void d_get_init_pos(struct GdVec3f *dst);
     74 void d_get_init_rot(struct GdVec3f *dst);
     75 void d_set_rel_pos(f32 x, f32 y, f32 z);
     76 void d_get_rel_pos(struct GdVec3f *dst);
     77 struct ObjGroup *d_get_att_objgroup(void);
     78 void d_get_scale(struct GdVec3f *dst);
     79 void d_set_world_pos(f32 x, f32 y, f32 z);
     80 void d_get_world_pos(struct GdVec3f *dst);
     81 void d_set_scale(f32 x, f32 y, f32 z);
     82 void d_add_valptr(DynObjName name, u32 vflags, enum ValPtrType type, size_t offset);
     83 void d_add_valproc(union ObjVarVal * (*)(union ObjVarVal *, union ObjVarVal));
     84 void d_set_flags(s32 flags);
     85 void d_set_parm_f(enum DParmF param, f32 val);
     86 void d_set_parm_ptr(enum DParmPtr param, void *ptr);
     87 void d_set_obj_draw_flag(enum ObjDrawingFlags flag);
     88 void d_set_type(s32 type);
     89 void d_set_colour_num(s32 colornum);
     90 void d_set_diffuse(f32 r, f32 g, f32 b);
     91 struct GdBoundingBox* d_get_bounding_box(void);
     92 void d_get_matrix(Mat4f *dst);
     93 Mat4f *d_get_rot_mtx_ptr(void);
     94 void d_set_i_matrix(Mat4f *src);
     95 Mat4f *d_get_matrix_ptr(void);
     96 Mat4f *d_get_i_mtx_ptr(void);
     97 f32 d_calc_world_dist_btwn(struct GdObj *obj1, struct GdObj *obj2);
     98 
     99 #endif // GD_DYNLIST_PROCESSOR_H