diff --git a/src/melee/gr/grizumi.c b/src/melee/gr/grizumi.c index 892f3f0a1a..1dda6f4194 100644 --- a/src/melee/gr/grizumi.c +++ b/src/melee/gr/grizumi.c @@ -20,6 +20,7 @@ #include #include #include +#include #include // context stuff @@ -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) { @@ -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) { @@ -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; @@ -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 }; @@ -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)); diff --git a/src/sysdolphin/baselib/displayfunc.h b/src/sysdolphin/baselib/displayfunc.h index fe187319d4..c443e71f6b 100644 --- a/src/sysdolphin/baselib/displayfunc.h +++ b/src/sysdolphin/baselib/displayfunc.h @@ -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 diff --git a/src/sysdolphin/baselib/gobj.h b/src/sysdolphin/baselib/gobj.h index 4b691a93a1..999f7c1341 100644 --- a/src/sysdolphin/baselib/gobj.h +++ b/src/sysdolphin/baselib/gobj.h @@ -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