Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MorsGames
GitHub Repository: MorsGames/sm64plus
Path: blob/master/src/goddard/objects.h
7858 views
1
#ifndef GD_OBJECTS_H
2
#define GD_OBJECTS_H
3
4
#include <PR/ultratypes.h>
5
6
#include "gd_types.h"
7
#include "macros.h"
8
9
// types
10
// Type to erase for func arg to `apply_to_obj_types_in_group`. Maybe one day this
11
// can be the proper type of 'void (*)(struct GdObj *)...
12
typedef void (*applyproc_t)(void *);
13
14
// structs
15
struct DebugCounters {
16
u32 ctr0;
17
s32 ctr1;
18
};
19
20
// bss
21
extern struct GdBoundingBox gSomeBoundingBox;
22
extern struct ObjCamera *sCurrentMoveCamera;
23
extern struct ObjView *sCurrentMoveView;
24
extern struct DebugCounters gGdCounter;
25
extern Mat4f D_801B9DC8;
26
extern struct GdVec3f D_801B9E08;
27
extern struct ObjGroup* sCurrentMoveGrp;
28
extern struct GdVec3f D_801B9E18;
29
extern struct GdVec3f D_801B9E28;
30
extern f32 D_801B9E34;
31
extern Mat4f* D_801B9E38; /* never read from */
32
extern struct ObjParticle *D_801B9E3C; /* never read from */
33
extern s32 D_801B9E40; /* always 0 */
34
extern s32 D_801B9E44;
35
extern Mat4f* D_801B9E48;
36
extern struct ObjCamera* gGdCameraList;
37
extern void* D_801B9E50;
38
extern struct ObjGroup* gGdGroupList;
39
extern s32 gGdObjCount;
40
extern s32 gGdGroupCount;
41
extern s32 gGdPlaneCount;
42
extern s32 gGdCameraCount;
43
extern struct Unk801B9E68 sGdViewInfo; /* count in first member? */
44
extern void* D_801B9E80;
45
extern struct ObjJoint* gGdJointList;
46
extern struct ObjBone* gGdBoneList;
47
extern struct GdObj* gGdObjectList;
48
extern struct ObjGroup* gGdViewsGroup;
49
50
// functions
51
void reset_bounding_box(void);
52
void add_obj_pos_to_bounding_box(struct GdObj *a0);
53
void get_some_bounding_box(struct GdBoundingBox *a0);
54
void stub_objects_1(UNUSED struct ObjGroup *a0, UNUSED struct GdObj *a1);
55
struct GdObj *make_object(enum ObjTypeFlag objFlag);
56
struct ObjZone *make_zone(struct ObjGroup *a0, struct GdBoundingBox *a1, struct ObjGroup *a2);
57
struct ObjUnk200000 *func_8017C7A0(struct ObjVertex *a0, struct ObjFace *a1);
58
struct ListNode *make_link_to_obj(struct ListNode *head, struct GdObj *a1);
59
struct VtxLink *make_vtx_link(struct VtxLink *prevLink, Vtx *data);
60
struct ObjValPtr *make_valptr(struct GdObj *obj, s32 flags, enum ValPtrType type, size_t offset);
61
void reset_plane(struct ObjPlane *plane);
62
struct ObjPlane *make_plane(s32 inZone, struct ObjFace *a1);
63
struct ObjCamera *make_camera(s32 a0, struct GdObj *a1);
64
struct ObjMaterial *make_material(UNUSED s32 a0, char *name, s32 id);
65
struct ObjLight *make_light(s32 flags, char *name, s32 id);
66
struct ObjView *make_view(const char *name, s32 flags, s32 a2, s32 ulx, s32 uly, s32 lrx, s32 lry,
67
struct ObjGroup *parts);
68
struct ObjAnimator *make_animator(void);
69
struct ObjWeight *make_weight(UNUSED s32 a0, s32 id, struct ObjVertex *vtx, f32 weight);
70
struct ObjGroup *make_group_of_type(enum ObjTypeFlag, struct GdObj*, struct GdObj*);
71
void format_object_id(char*, struct GdObj*);
72
struct ObjGroup* make_group(s32 count, ...);
73
void addto_group(struct ObjGroup *group, struct GdObj *obj);
74
void addto_groupfirst(struct ObjGroup *group, struct GdObj *obj);
75
s32 group_contains_obj(struct ObjGroup *group, struct GdObj *obj);
76
void show_details(enum ObjTypeFlag type);
77
s32 stub_objects_2(void);
78
s32 make_scene(void);
79
void menu_cb_reset_positions(void);
80
s32 apply_to_obj_types_in_group(s32 types, applyproc_t fn, struct ObjGroup *group);
81
void func_8017E584(struct ObjNet *a0, struct GdVec3f *a1, struct GdVec3f *a2);
82
void func_8017E838(struct ObjNet *a0, struct GdVec3f *a1, struct GdVec3f *a2);
83
void func_8017E9EC(struct ObjNet *a0);
84
s32 func_8017EA94(struct GdVec3f *vec, Mat4f matrix);
85
s32 func_8017EB24(struct GdObj *a0, struct GdObj *a1);
86
s32 is_obj_xz_in_bounding_box(struct GdObj *a0, struct GdBoundingBox *a1);
87
s32 is_point_xz_in_bounding_box(struct GdVec3f *a0, struct GdBoundingBox *a1);
88
s32 gd_plane_point_within(struct GdBoundingBox *a0, struct GdBoundingBox *a1);
89
s32 transform_child_objects_recursive(struct GdObj *a0, struct GdObj *a1);
90
s32 func_8017F210(struct GdObj *a0, struct GdObj *a1);
91
void stub_objects_3(UNUSED f32 a0, UNUSED struct GdObj *a1, UNUSED struct GdObj *a2);
92
void interpolate_animation_transform(struct GdAnimTransform *a0, struct GdAnimTransform *a1, f32 a2);
93
void move_animator(struct ObjAnimator *animObj);
94
void drag_picked_object(struct GdObj *inputObj);
95
void move_animators(struct ObjGroup *group);
96
void find_and_drag_picked_object(struct ObjGroup *group);
97
void move_camera(struct ObjCamera *cam);
98
void move_cameras_in_grp(struct ObjGroup *group);
99
void func_8018100C(struct ObjLight *light);
100
void move_lights_in_grp(struct ObjGroup *group);
101
void proc_view_movement(struct ObjView *view);
102
void reset_nets_and_gadgets(struct ObjGroup *group);
103
void null_obj_lists(void);
104
105
#endif // GD_OBJECTS_H
106
107