Skip to content

Commit

Permalink
2 functions to go
Browse files Browse the repository at this point in the history
  • Loading branch information
BR- committed Oct 11, 2023
1 parent a2c48bf commit 21a0385
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 18 deletions.
45 changes: 28 additions & 17 deletions src/melee/gr/grizumi.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <baselib/gobj.h>
#include <baselib/gobjgxlink.h>
#include <baselib/gobjobject.h>
#include <baselib/mtx.h>
#include <baselib/state.h>

// context stuff
Expand Down Expand Up @@ -354,12 +355,11 @@ bool grIzumi_801CC0CC(HSD_GObj* gobj)

void grIzumi_801CC0D4(HSD_GObj* gobj)
{
int space[2];
Ground* gp = GET_GROUND(gobj);
if (gp->gv.izumi.xCC != NULL) {
Ground* gp2 = GET_GROUND(gp->gv.izumi.xCC);
Vec3 vec;
if (gp->gv.izumi.xD0 != NULL) {
Vec3 vec;
HSD_JObjGetTranslation(gp->gv.izumi.xD0, &vec);
HSD_JObjSetTranslate(gp2->gv.izumi2.xC4, &vec);
if (vec.y < 0.0f) {
Expand All @@ -375,7 +375,6 @@ void grIzumi_801CC0D4(HSD_GObj* gobj)
}
}
if (gp->gv.izumi.xD4 != NULL) {
Vec3 vec;
HSD_JObjGetTranslation(gp->gv.izumi.xD4, &vec);
HSD_JObjSetTranslate(gp2->gv.izumi2.xC8, &vec);
if (vec.y < 0.0f) {
Expand Down Expand Up @@ -558,12 +557,16 @@ void grIzumi_801CCB90(HSD_GObj* gobj, s32 renderpass)

HSD_GObj* grIzumi_801CCBDC(float height, Vec3* a, int b, HSD_JObj* jobj)
{
HSD_GObj* gobj = grIzumi_801CBCE8(4);
HSD_GObj* gobj;
gobj = grIzumi_801CBCE8(4);
if (gobj != NULL) {
Ground* gp = GET_GROUND(gobj);
if (gobj && gobj) {
} // permuter
if (gp != NULL) {
HSD_JObj* jobj2 = HSD_GObjGetHSDObj(gobj);
if (jobj2 != NULL) {
HSD_JObj* jobj2;
jobj2 = HSD_GObjGetHSDObj(gobj);
if (jobj2 != (0, NULL)) { // permuter
Vec3 aa = *a;
HSD_JObjSetTranslate(jobj2, &aa);
gp->gv.izumi3.xD4 = height;
Expand All @@ -580,18 +583,23 @@ HSD_GObj* grIzumi_801CCBDC(float height, Vec3* a, int b, HSD_JObj* jobj)
if (jobj2 != NULL) {
Vec3 vec;
lb_8000B1CC(jobj2, NULL, &vec);
gp->gv.izumi3.xD8 = (vec.y - a->y) / Ground_801C0498();
gp->gv.izumi3.xD8 = (vec.y - aa.y) / Ground_801C0498();
} else {
gp->gv.izumi3.xD8 = 45.0f;
}
grIzumi_801CC358(gobj);
goto ret; // return has to be after the loop, but idk how to
// controlflow it any better
}
return gobj;
}
}

OSReport("%s:%d:oioi...\n", "grizumi.c", 892);
while (true) {
}

ret:
return gobj;
}

HSD_WObjDesc EyeDesc = { NULL, { 0.0f, 0.0f, 1.0f }, NULL };
Expand Down Expand Up @@ -650,22 +658,25 @@ HSD_GObj* grIzumi_801CCD98(void)

void grIzumi_801CCEA0(HSD_GObj* gobj, s32 renderpass)
{
int space[4];
Mtx mtx;
IzumiReflection* refl = HSD_GObjGetUserData(gobj);
Vec3 vec;
int stack[2]; // fake
HSD_CObj* src;
HSD_CObj* dst;
IzumiReflection* refl = (IzumiReflection*) HSD_GObjGetUserData(gobj);
HSD_GObj* src_gobj;
HSD_CObj* cobj;

if (refl->image != NULL) {
HSD_CObj* cobj = HSD_GObjGetHSDObj(gobj);
HSD_GObj* src_gobj;
HSD_CObj *src, *dst;
cobj = GET_COBJ(gobj);
ftDrawCommon_80081140();
Camera_8002A4AC(Camera_80030A50());

dst = HSD_GObjGetHSDObj(gobj);
dst = GET_COBJ(gobj);
src_gobj = Camera_80030A50();
if (src_gobj != NULL) {
HSD_CObj* src = HSD_GObjGetHSDObj(src_gobj);
if (src != NULL) {
Vec3 vec;
// uses r0 if put on two lines:
if ((src = GET_COBJ(src_gobj)) != NULL) {
HSD_CObjSetNear(dst, HSD_CObjGetNear(src));
HSD_CObjSetFar(dst, HSD_CObjGetFar(src));
HSD_CObjSetFov(dst, HSD_CObjGetFov(src));
Expand Down
2 changes: 1 addition & 1 deletion src/sysdolphin/baselib/displayfunc.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ void _HSD_ZListSort(void);
void _HSD_ZListDisp(void);
void _HSD_ZListClear(void);

void HSD_SetEraseColor(char, char, char, char);
void HSD_SetEraseColor(int, int, int, int);

#endif
1 change: 1 addition & 0 deletions src/sysdolphin/baselib/gobj.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ static inline HSD_GObj* HSD_GObjGetNext(HSD_GObj* gobj)
}

#define GET_JOBJ(gobj) ((HSD_JObj*) HSD_GObjGetHSDObj(gobj))
#define GET_COBJ(gobj) ((HSD_CObj*) HSD_GObjGetHSDObj(gobj))
#define GET_LOBJ(gobj) ((HSD_LObj*) HSD_GObjGetHSDObj(gobj))

#endif

0 comments on commit 21a0385

Please sign in to comment.