diff --git a/include/macros.h b/include/macros.h index 43f526f24..d2b98dec5 100644 --- a/include/macros.h +++ b/include/macros.h @@ -94,9 +94,6 @@ #define CLAMP_MAX(x, max) ((x) > (max) ? (max) : (x)) #define CLAMP_MIN(x, min) ((x) < (min) ? (min) : (x)) -#define RAND_BITS(n) ((s32)Rand_Next() >> (0x20 - n)) -#define RANDU_BITS(n) (Rand_Next() >> (0x20 - n)) - #define RGBA16_GET_R(pixel) (((pixel) >> 11) & 0x1F) #define RGBA16_GET_G(pixel) (((pixel) >> 6) & 0x1F) #define RGBA16_GET_B(pixel) (((pixel) >> 1) & 0x1F) diff --git a/src/overlays/actors/ovl_Obj_Mine/z_obj_mine.c b/src/overlays/actors/ovl_Obj_Mine/z_obj_mine.c index 072371f53..35df2c5a3 100644 --- a/src/overlays/actors/ovl_Obj_Mine/z_obj_mine.c +++ b/src/overlays/actors/ovl_Obj_Mine/z_obj_mine.c @@ -374,7 +374,7 @@ void ObjMine_Water_InitChain(ObjMine* this, s32 linkCount) { waterChain->drag = 0.9f; waterChain->swayMax = 0.003f; - waterChain->swayPhaseVel = RANDU_BITS(13); + waterChain->swayPhaseVel = Rand_Next() >> (0x20 - 13); waterChain->restoreXZ = -0.0002f; waterChain->restoreY = -0.0002f; @@ -895,9 +895,9 @@ void ObjMine_Air_Chained(ObjMine* this, PlayState* play) { } // Applies chain sway, choosing a new sway randomly about every 32 frames - if (RANDU_BITS(5) == 0) { + if ((Rand_Next() >> (0x20 - 5)) == 0) { airChain->swaySize = Rand_ZeroOne() * airChain->swayMax; - airChain->swayPhase = RANDU_BITS(16); + airChain->swayPhase = Rand_Next() >> (0x20 - 16); } xAccel = Math_SinS(airChain->swayPhase) * airChain->swaySize; zAccel = Math_CosS(airChain->swayPhase) * airChain->swaySize; @@ -1032,12 +1032,12 @@ void ObjMine_Water_Chained(ObjMine* this, PlayState* play) { waterChain->swayMax = 0.003f; // Chooses a new sway randomly about every 32 frames. - if (RANDU_BITS(5) == 0) { - s16 randAngle = RANDU_BITS(16); + if (Rand_Next() >> (0x20 - 5) == 0) { + s16 randAngle = Rand_Next() >> (0x20 - 16); waterChain->swayXZ = Math_SinS(randAngle) * 1.8f * waterChain->swayMax; waterChain->swayY = Math_CosS(randAngle) * 0.2f * waterChain->swayMax; - waterChain->swayPhaseVel = RANDU_BITS(13); + waterChain->swayPhaseVel = Rand_Next() >> (0x20 - 13); } ObjMine_Water_UpdateChain(this, play);