Skip to content

SH2 particle/effect similarities #489

@emoose

Description

@emoose

SH2 has a src/Effect/ folder that handles some effects, looks like it has same kind of things as our particle_*.c code, smoke/glass/water...

Init code for some of those SH2 effects is also vaguely similar, eg:

void EFCTSetGunSmoke(undefined4 param_1)
{
    [...]
    lVar2 = EFCTEntryEffectTask(5);
    if (lVar2 != 0) {
      lVar3 = InitEffectObjectGunSmoke(*(undefined4 *)((int)lVar2 + 0x14),iVar4,param_1);
      [...]
    }
}

While our particle_*.c files have things like:

void sharedFunc_800CB0A4_4_s03(VECTOR3* arg0, VECTOR3* arg1)
{
    s32 idx;

    idx = func_8005E7E0(33);
    if (idx != NO_VALUE)
    {
        sharedData_800DFB7C_0_s00[idx].field_0.vx_0         = arg0->vx;
        sharedData_800DFB7C_0_s00[idx].vy_8            = arg0->vy;
        sharedData_800DFB7C_0_s00[idx].field_4.vz_4         = arg0->vz;
        sharedData_800DFB7C_0_s00[idx].field_C.s_0.field_0 = ratan2(arg1->vx - arg0->vx, arg1->vz - arg0->vz);
        sharedData_800DFB7C_0_s00[idx].field_C.s_0.field_2 = ratan2(arg1->vy - arg0->vy, Math_Vector2MagCalc(arg1->vx - arg0->vx, arg1->vz - arg0->vz));
        sharedData_800DFB7C_0_s00[idx].field_10.s_0.field_0 = D_800C4418.field_8;
        sharedData_800DFB7C_0_s00[idx].field_B              = 0;
        sharedData_800DFB7C_0_s00[idx].field_10.s_0.field_2 = Q12(1.0f);
    }
}

Doesn't really seem to match up directly though, looks almost like someone was tasked with adding effects to SH2 and took a look at how SH1 effects worked first (or maybe worked on those previously), but written as new code instead of copying directly like the VC stuff.

Also SH2 has a src/Effect2/ folder where some newer effects use a completely different system to work, so seems the src/Effect/ stuff might have been code they were moving away from, hm..

Not too sure how useful they'll be to look into, might just be superficial, maybe can give some ideas what the funcs are meant to be doing though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions