remove unused code from goddard
This commit is contained in:
1 parent
2e534b1ab2
commit
8181edd10f
10 files changed
-896
No files matched your search
@@ -882,128 +882,12 @@ s32 group_contains_obj(struct ObjGroup *group, struct GdObj *obj) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unused (not called) - this shows details about all objects in the main object linked list
|
||||
*/
|
||||
void show_details(enum ObjTypeFlag type) {
|
||||
enum ObjTypeFlag curObjType;
|
||||
struct ListNode *curGroupLink;
|
||||
struct ObjGroup *curSubGroup;
|
||||
struct GdObj *curObj;
|
||||
char idStrBuf[0x24];
|
||||
s32 curGroupTypes;
|
||||
|
||||
gd_printf("\nDetails about: ");
|
||||
switch (type) {
|
||||
case OBJ_TYPE_GROUPS:
|
||||
gd_printf("Groups\n");
|
||||
break;
|
||||
case OBJ_TYPE_BONES:
|
||||
gd_printf("Bones\n");
|
||||
break;
|
||||
case OBJ_TYPE_JOINTS:
|
||||
gd_printf("Joints\n");
|
||||
break;
|
||||
case OBJ_TYPE_PARTICLES:
|
||||
gd_printf("Particles\n");
|
||||
break;
|
||||
default:
|
||||
gd_printf("Everything?\n");
|
||||
break;
|
||||
}
|
||||
|
||||
curObj = gGdObjectList;
|
||||
while (curObj != NULL) {
|
||||
curObjType = curObj->type;
|
||||
if (curObjType == type) {
|
||||
format_object_id(idStrBuf, curObj);
|
||||
switch (curObjType) {
|
||||
case OBJ_TYPE_GROUPS:
|
||||
gd_printf("Group %s: ", idStrBuf);
|
||||
curGroupTypes = ((struct ObjGroup *) curObj)->memberTypes;
|
||||
|
||||
if (curGroupTypes & OBJ_TYPE_GROUPS) {
|
||||
gd_printf("groups ");
|
||||
}
|
||||
if (curGroupTypes & OBJ_TYPE_BONES) {
|
||||
gd_printf("bones ");
|
||||
}
|
||||
if (curGroupTypes & OBJ_TYPE_JOINTS) {
|
||||
gd_printf("joints ");
|
||||
}
|
||||
if (curGroupTypes & OBJ_TYPE_PARTICLES) {
|
||||
gd_printf("particles ");
|
||||
}
|
||||
if (curGroupTypes & OBJ_TYPE_CAMERAS) {
|
||||
gd_printf("cameras ");
|
||||
}
|
||||
if (curGroupTypes & OBJ_TYPE_NETS) {
|
||||
gd_printf("nets ");
|
||||
}
|
||||
if (curGroupTypes & OBJ_TYPE_GADGETS) {
|
||||
gd_printf("gadgets ");
|
||||
}
|
||||
if (curGroupTypes & OBJ_TYPE_LABELS) {
|
||||
gd_printf("labels ");
|
||||
}
|
||||
if (curGroupTypes & OBJ_TYPE_FACES) {
|
||||
gd_printf("face ");
|
||||
}
|
||||
if (curGroupTypes & OBJ_TYPE_VERTICES) {
|
||||
gd_printf("vertex ");
|
||||
}
|
||||
|
||||
curGroupLink = ((struct ObjGroup *) curObj)->firstMember;
|
||||
while (curGroupLink != NULL) {
|
||||
format_object_id(idStrBuf, curGroupLink->obj);
|
||||
gd_printf("%s", idStrBuf);
|
||||
curGroupLink = curGroupLink->next;
|
||||
}
|
||||
gd_printf("\n");
|
||||
break;
|
||||
case OBJ_TYPE_BONES:
|
||||
gd_printf("Bone %s: ", idStrBuf);
|
||||
curSubGroup = ((struct ObjBone *) curObj)->unk10C;
|
||||
curGroupLink = curSubGroup->firstMember;
|
||||
while (curGroupLink != NULL) {
|
||||
format_object_id(idStrBuf, curGroupLink->obj);
|
||||
gd_printf("%s", idStrBuf);
|
||||
curGroupLink = curGroupLink->next;
|
||||
}
|
||||
gd_printf("\n");
|
||||
break;
|
||||
case OBJ_TYPE_JOINTS:
|
||||
gd_printf("Joint %s: ", idStrBuf);
|
||||
curSubGroup = ((struct ObjJoint *) curObj)->unk1C4;
|
||||
curGroupLink = curSubGroup->firstMember;
|
||||
while (curGroupLink != NULL) {
|
||||
format_object_id(idStrBuf, curGroupLink->obj);
|
||||
gd_printf("%s", idStrBuf);
|
||||
curGroupLink = curGroupLink->next;
|
||||
}
|
||||
gd_printf("\n");
|
||||
break;
|
||||
default:;
|
||||
}
|
||||
}
|
||||
curObj = curObj->next;
|
||||
}
|
||||
}
|
||||
|
||||
/* @ 22C9B8 for 0x24 */
|
||||
s32 stub_objects_2(void) {
|
||||
s32 sp4 = 0;
|
||||
return sp4;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unused - called by __main__
|
||||
*/
|
||||
s32 make_scene(void) {
|
||||
s32 sp4 = 0;
|
||||
return sp4;
|
||||
}
|
||||
|
||||
/* @ 22CA00 for 0x88 */
|
||||
static void reset_joint_or_net(struct GdObj *obj) {
|
||||
struct GdObj *localObjPtr = obj;
|
||||
@@ -1027,39 +911,6 @@ void menu_cb_reset_positions(void) {
|
||||
apply_to_obj_types_in_group(OBJ_TYPE_NETS, (applyproc_t) reset_joint_or_net, sCurrentMoveGrp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unused (not called) - does nothing useful
|
||||
*/
|
||||
struct GdObj *func_8017E2F0(struct GdObj *obj, enum ObjTypeFlag type) {
|
||||
UNUSED u32 sp2C;
|
||||
enum ObjTypeFlag curObjType;
|
||||
struct ListNode *node;
|
||||
|
||||
curObjType = obj->type;
|
||||
|
||||
switch (curObjType) {
|
||||
case OBJ_TYPE_GROUPS:
|
||||
node = ((struct ObjGroup *) obj)->firstMember;
|
||||
while (node != NULL) {
|
||||
func_8017E2F0(node->obj, type);
|
||||
node = node->next;
|
||||
}
|
||||
break;
|
||||
case OBJ_TYPE_BONES:
|
||||
break;
|
||||
default:;
|
||||
}
|
||||
|
||||
if (curObjType == type) {
|
||||
return obj;
|
||||
}
|
||||
|
||||
//! @bug Nothing is returned if a GdObj of `type` is not found
|
||||
#ifdef AVOID_UB
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursively calls `func` on all members of `group` whose type is in the
|
||||
* `types` bitmask.
|
||||
@@ -1224,152 +1075,6 @@ void func_8017E9EC(struct ObjNet *net) {
|
||||
gd_mult_mat4f(&D_801B9DC8, &sp1C, &D_801B9DC8);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unused (not called)
|
||||
*/
|
||||
s32 func_8017EA94(struct GdVec3f *vec, Mat4f matrix) {
|
||||
if (vec->x >= matrix[2][2] && vec->x <= matrix[3][1] && vec->z >= matrix[3][0]
|
||||
&& vec->z <= matrix[3][3]) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unused (not called)
|
||||
*/
|
||||
s32 func_8017EB24(struct GdObj *obj1, struct GdObj *obj2) {
|
||||
struct GdVec3f pos1;
|
||||
struct GdVec3f pos2;
|
||||
struct GdBoundingBox *bbox1;
|
||||
struct GdBoundingBox *bbox2;
|
||||
struct GdBoundingBox sp18;
|
||||
|
||||
set_cur_dynobj(obj1);
|
||||
d_get_world_pos(&pos1);
|
||||
bbox1 = d_get_bounding_box();
|
||||
|
||||
set_cur_dynobj(obj2);
|
||||
d_get_world_pos(&pos2);
|
||||
bbox2 = d_get_bounding_box();
|
||||
|
||||
// bbox2 is an offset for bbox1?
|
||||
sp18.minX = bbox1->minX + bbox2->minX;
|
||||
sp18.minY = bbox1->minY + bbox2->minY;
|
||||
sp18.minZ = bbox1->minZ + bbox2->minZ;
|
||||
sp18.maxX = bbox1->maxX + bbox2->maxX;
|
||||
sp18.maxY = bbox1->maxY + bbox2->maxY;
|
||||
sp18.maxZ = bbox1->maxZ + bbox2->maxZ;
|
||||
|
||||
D_801B9E08.x = pos2.x - pos1.x;
|
||||
D_801B9E08.y = pos2.y - pos1.y;
|
||||
D_801B9E08.z = pos2.z - pos1.z;
|
||||
|
||||
if (D_801B9E08.x >= sp18.minX) {
|
||||
if (D_801B9E08.x <= sp18.maxX) {
|
||||
if (D_801B9E08.z >= sp18.minZ) {
|
||||
if (D_801B9E08.z <= sp18.maxZ) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unused (not called)
|
||||
*/
|
||||
s32 is_obj_xz_in_bounding_box(struct GdObj *obj, struct GdBoundingBox *bbox) {
|
||||
struct GdVec3f pos;
|
||||
|
||||
set_cur_dynobj(obj);
|
||||
d_get_world_pos(&pos);
|
||||
|
||||
if (pos.x >= bbox->minX) {
|
||||
if (pos.x <= bbox->maxX) {
|
||||
if (pos.z >= bbox->minZ) {
|
||||
if (pos.z <= bbox->maxZ) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unused (not called)
|
||||
*/
|
||||
s32 is_point_xz_in_bounding_box(struct GdVec3f *point, struct GdBoundingBox *bbox) {
|
||||
if (point->x >= bbox->minX) {
|
||||
if (point->x <= bbox->maxX) {
|
||||
if (point->z >= bbox->minZ) {
|
||||
if (point->z <= bbox->maxZ) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unused (called by func_801A71CC) - returns TRUE if any of the four corners of
|
||||
* box1's X-Z plane lie within box2's X-Z plane
|
||||
*/
|
||||
s32 gd_plane_point_within(struct GdBoundingBox *box1, struct GdBoundingBox *box2) {
|
||||
// test if min x and min z of box1 are within box2
|
||||
if (box1->minX >= box2->minX) {
|
||||
if (box1->minX <= box2->maxX) {
|
||||
if (box1->minZ >= box2->minZ) {
|
||||
if (box1->minZ <= box2->maxZ) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// test if max x and min z of box1 are within box2
|
||||
if (box1->maxX >= box2->minX) {
|
||||
if (box1->maxX <= box2->maxX) {
|
||||
if (box1->minZ >= box2->minZ) {
|
||||
if (box1->minZ <= box2->maxZ) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// test if max x and max z of box1 are within box2
|
||||
if (box1->maxX >= box2->minX) {
|
||||
if (box1->maxX <= box2->maxX) {
|
||||
if (box1->maxZ >= box2->minZ) {
|
||||
if (box1->maxZ <= box2->maxZ) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// test if min x and max z of box1 are within box2
|
||||
if (box1->minX >= box2->minX) {
|
||||
if (box1->minX <= box2->maxX) {
|
||||
if (box1->maxZ >= box2->minZ) {
|
||||
if (box1->maxZ <= box2->maxZ) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* @ 22D824 for 0x1BC */
|
||||
s32 transform_child_objects_recursive(struct GdObj *obj, struct GdObj *parentObj) {
|
||||
struct ListNode *curLink;
|
||||
|
||||
Reference in new issue
Block a user