diff options
| author | Tal Hayon <talhayon1@gmail.com> | 2022-08-11 22:45:31 +0300 |
|---|---|---|
| committer | Tal Hayon <talhayon1@gmail.com> | 2022-08-11 22:45:31 +0300 |
| commit | 86ad4b1e005005ffd0bbe096c2777b3e4b7d753a (patch) | |
| tree | d0552e009898fc2e2a26f062ba61e14f33765be4 /src/objectUtils.c | |
| parent | 5b44390e0e668b4386875d47f668399f8470fd2d (diff) | |
Match sub_080A2AF4
Diffstat (limited to 'src/objectUtils.c')
| -rw-r--r-- | src/objectUtils.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/objectUtils.c b/src/objectUtils.c index 7b748c6d..b9cc0c42 100644 --- a/src/objectUtils.c +++ b/src/objectUtils.c @@ -214,28 +214,20 @@ Entity* CreateLargeWaterTrace(Entity* parent) { return ent; } -NONMATCH("asm/non_matching/objectUtils/sub_080A2AF4.inc", void sub_080A2AF4(Entity* parent, s32 param_2, s32 param_3)) { +void sub_080A2AF4(Entity* parent, s32 param_2, s32 param_3) { Entity* entity; - s32 rand; s32 radius; - u32 angle; - s32 tmp; + s32 angle; entity = CreateLargeWaterTrace(parent); if (entity != NULL) { - rand = Random(); - radius = (rand % (param_3 - param_2 + 1)) + param_2; - angle = rand >> 0x10 & 0xff; - radius *= 0x100; - tmp = FixedMul(gSineTable[angle], radius); - tmp = FixedDiv(tmp, 0x100); - entity->x.WORD += ((tmp << 0x10) >> 8); - tmp = FixedMul(gSineTable[angle + 0x40], radius); - tmp = FixedDiv(tmp, 0x100); - entity->y.WORD -= ((tmp << 0x10) >> 8); + angle = Random(); + radius = (angle % (param_3 - param_2 + 1)) + param_2; + angle = angle >> 0x10 & 0xff; + entity->x.WORD += FixedDiv(FixedMul(gSineTable[angle], radius << 8), 0x100) << 8; + entity->y.WORD -= FixedDiv(FixedMul(gSineTable[angle + 0x40], radius << 8), 0x100) << 8; } } -END_NONMATCH void CreateSparkle(Entity* entity) { Entity* sparkle; |
