summaryrefslogtreecommitdiff
path: root/src/objectUtils.c
diff options
context:
space:
mode:
authornotyourav <65437533+notyourav@users.noreply.github.com>2022-08-12 13:18:46 -0700
committerGitHub <noreply@github.com>2022-08-12 13:18:46 -0700
commit8ff6eb437d67cca0772e371c3867259076482374 (patch)
tree2a636a67ef4d9d1a7629bdac55f207819651d198 /src/objectUtils.c
parent8cdf7d8778fc2d18a8212c5508012d9bf1958107 (diff)
parentb7f6761101179850db1999296c584c4f410d461e (diff)
Merge pull request #556 from hatal175/sub_0802CF8C
Diffstat (limited to 'src/objectUtils.c')
-rw-r--r--src/objectUtils.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/objectUtils.c b/src/objectUtils.c
index a3dc0132..dd78655a 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;