1
0
mirror of https://github.com/blawar/ooot.git synced 2024-06-30 16:29:55 +00:00

adjusted PosRot

This commit is contained in:
Blake Warner 2022-04-07 19:02:20 -04:00
parent 6d0b976f32
commit 29a9879c8d
21 changed files with 133 additions and 63 deletions

View File

@ -197,7 +197,8 @@ void func_8003555C(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f*
void func_800355B8(GlobalContext* globalCtx, Vec3f* pos); void func_800355B8(GlobalContext* globalCtx, Vec3f* pos);
u8 func_800355E4(GlobalContext* globalCtx, Collider* collider); u8 func_800355E4(GlobalContext* globalCtx, Collider* collider);
void func_80035844(Vec3f* arg0, Vec3f* arg1, Vec3s* arg2, s32 arg3); void func_80035844(Vec3f* arg0, Vec3f* arg1, Vec3s* arg2, s32 arg3);
Actor* func_800358DC(Actor* actor, Vec3f* spawnPos, Vec3s* spawnRot, f32* arg3, s32 timer, s16* unused, GlobalContext* globalCtx, s16 params, s32 arg8); void func_80035844(Vec3f* arg0, Vec3f* arg1, VecRot* arg2, s32 arg3);
Actor* func_800358DC(Actor* actor, Vec3f* spawnPos, VecRot* spawnRot, f32* arg3, s32 timer, s16* unused, GlobalContext* globalCtx, s16 params, s32 arg8);
void func_800359B8(Actor* actor, s16 arg1, VecRot* arg2); void func_800359B8(Actor* actor, s16 arg1, VecRot* arg2);
u16 func_80037C30(GlobalContext* globalCtx, s16 arg1); u16 func_80037C30(GlobalContext* globalCtx, s16 arg1);
s32 func_80037D98(GlobalContext* globalCtx, Actor* actor, s16 arg2, s32* arg3); s32 func_80037D98(GlobalContext* globalCtx, Actor* actor, s16 arg2, s32* arg3);

View File

@ -24,6 +24,7 @@ f32 Math_SmoothStepToF(f32* pValue, f32 target, f32 fraction, const Step& step,
s16 Math_SmoothStepToS(s16* pValue, s16 target, s16 scale, const Step& step, const Step& minStep); s16 Math_SmoothStepToS(s16* pValue, s16 target, s16 scale, const Step& step, const Step& minStep);
s16 Math_SmoothStepToS(Rotation* pValue, s16 target, s16 scale, const Step& step, const Step& minStep); s16 Math_SmoothStepToS(Rotation* pValue, s16 target, s16 scale, const Step& step, const Step& minStep);
s32 Math_StepToAngleS(s16* pValue, s16 target, const Step& step); s32 Math_StepToAngleS(s16* pValue, s16 target, const Step& step);
s32 Math_StepToAngleS(Rotation* pValue, s16 target, const Step& step);
s32 Math_StepToF(f32* pValue, f32 target, const Step& step); s32 Math_StepToF(f32* pValue, f32 target, const Step& step);
s32 Math_StepRotationToF(f32* pValue, f32 target, const Step& step); s32 Math_StepRotationToF(f32* pValue, f32 target, const Step& step);
f32 Math_AngleDiffF(f32 a, f32 b); f32 Math_AngleDiffF(f32 a, f32 b);

View File

@ -108,6 +108,8 @@ class Timer
return m_counter; return m_counter;
} }
float abs() const;
s16 toS16() const s16 toS16() const
{ {
return (s16)m_counter; return (s16)m_counter;
@ -126,17 +128,21 @@ class Timer
s64 m_counterInt; s64 m_counterInt;
}; };
typedef Timer Counter;
typedef Timer Rotation;
class Step class Step
{ {
public: public:
Step(); Step();
Step(const Step& t); Step(const Step& t);
Step(float n); Step(float n);
Step(const Rotation& r);
float value() const; float value() const;
protected: protected:
float m_value; float m_value;
}; };
typedef Timer Counter;
typedef Timer Rotation;

View File

@ -95,7 +95,7 @@ struct VecSph {
struct PosRot { struct PosRot {
Vec3f pos; Vec3f pos;
Vec3s rot; VecRot rot;
}; // size = 0x14 }; // size = 0x14
#define LERP(x, y, scale) (((y) - (x)) * (scale) + (x)) #define LERP(x, y, scale) (((y) - (x)) * (scale) + (x))

View File

@ -10,29 +10,29 @@ static FramerateProfile g_profile = PROFILE_BOOT;
#if FRAME_RATE == 20 #if FRAME_RATE == 20
static Framerate g_profileRates[] = { static Framerate g_profileRates[] = {
FRAMERATE_30FPS, // PROFILE_BOOT FRAMERATE_30FPS, // PROFILE_BOOT
FRAMERATE_60FPS, // PROFILE_PAUSE FRAMERATE_60FPS, // PROFILE_PAUSE
FRAMERATE_20FPS, // PROFILE_GAMEPLAY FRAMERATE_20FPS, // PROFILE_GAMEPLAY
FRAMERATE_60FPS, // PROFILE_UNKNOWN1 FRAMERATE_60FPS, // PROFILE_UNKNOWN1
FRAMERATE_60FPS, // PROFILE_UNKNOWN2 FRAMERATE_60FPS, // PROFILE_UNKNOWN2
FRAMERATE_60FPS, // PROFILE_SAMPLE FRAMERATE_60FPS, // PROFILE_SAMPLE
FRAMERATE_60FPS, // PROFILE_OPENING FRAMERATE_60FPS, // PROFILE_OPENING
FRAMERATE_60FPS, // PROFILE_SELECT FRAMERATE_60FPS, // PROFILE_SELECT
FRAMERATE_60FPS, // PROFILE_TITLE FRAMERATE_60FPS, // PROFILE_TITLE
FRAMERATE_60FPS, // PROFILE_FILE_CHOOSE FRAMERATE_60FPS, // PROFILE_FILE_CHOOSE
}; };
#else #else
static Framerate g_profileRates[] = { static Framerate g_profileRates[] = {
FRAMERATE_30FPS, // PROFILE_BOOT FRAMERATE_30FPS, // PROFILE_BOOT
FRAMERATE_60FPS, // PROFILE_PAUSE FRAMERATE_60FPS, // PROFILE_PAUSE
FRAMERATE_60FPS, // PROFILE_GAMEPLAY FRAMERATE_60FPS, // PROFILE_GAMEPLAY
FRAMERATE_60FPS, // PROFILE_UNKNOWN1 FRAMERATE_60FPS, // PROFILE_UNKNOWN1
FRAMERATE_60FPS, // PROFILE_UNKNOWN2 FRAMERATE_60FPS, // PROFILE_UNKNOWN2
FRAMERATE_60FPS, // PROFILE_SAMPLE FRAMERATE_60FPS, // PROFILE_SAMPLE
FRAMERATE_60FPS, // PROFILE_OPENING FRAMERATE_60FPS, // PROFILE_OPENING
FRAMERATE_60FPS, // PROFILE_SELECT FRAMERATE_60FPS, // PROFILE_SELECT
FRAMERATE_60FPS, // PROFILE_TITLE FRAMERATE_60FPS, // PROFILE_TITLE
FRAMERATE_60FPS, // PROFILE_FILE_CHOOSE FRAMERATE_60FPS, // PROFILE_FILE_CHOOSE
}; };
#endif #endif
@ -122,6 +122,18 @@ void Timer::update()
m_counter = (float)m_counterInt * COUNTER_STEP; m_counter = (float)m_counterInt * COUNTER_STEP;
} }
float Timer::abs() const
{
float v = toFloat();
if(v < 0.0f)
{
return -v;
}
return v;
}
Timer& Timer::operator++() // pre Timer& Timer::operator++() // pre
{ {
m_counterInt++; m_counterInt++;
@ -201,7 +213,7 @@ Timer& Timer::operator+=(const Timer f)
Timer& Timer::operator-=(const Timer f) Timer& Timer::operator-=(const Timer f)
{ {
s64 step = f.m_counterInt * COUNTER_STEP; s64 step = f.m_counterInt * COUNTER_STEP;
if(step == 0) if(step == 0)
{ {
if(f.m_counterInt > 0) if(f.m_counterInt > 0)
@ -288,7 +300,6 @@ s32 Timer::operator>>(long n)
return whole() >> n; return whole() >> n;
} }
Step::Step() : m_value(0) Step::Step() : m_value(0)
{ {
} }
@ -300,7 +311,12 @@ Step::Step(const Step& t)
Step::Step(float n) Step::Step(float n)
{ {
m_value = n;// * FRAMERATE_SCALER; m_value = n; // * FRAMERATE_SCALER;
}
Step::Step(const Rotation& r)
{
m_value = (s16)r;
} }
float Step::value() const float Step::value() const

View File

@ -4141,7 +4141,8 @@ void Actor_SetDropFlagJntSph(Actor* actor, ColliderJntSph* jntSph, s32 freezeFla
} }
} }
void func_80035844(Vec3f* arg0, Vec3f* arg1, Vec3s* arg2, s32 arg3) { template<class T>
static inline void _func_80035844(Vec3f* arg0, Vec3f* arg1, T* arg2, s32 arg3) {
f32 dx = arg1->x - arg0->x; f32 dx = arg1->x - arg0->x;
f32 dz = arg1->z - arg0->z; f32 dz = arg1->z - arg0->z;
f32 dy = arg3 ? (arg1->y - arg0->y) : (arg0->y - arg1->y); f32 dy = arg3 ? (arg1->y - arg0->y) : (arg0->y - arg1->y);
@ -4150,10 +4151,20 @@ void func_80035844(Vec3f* arg0, Vec3f* arg1, Vec3s* arg2, s32 arg3) {
arg2->x = Math_Atan2S(sqrtf(SQ(dx) + SQ(dz)), dy); arg2->x = Math_Atan2S(sqrtf(SQ(dx) + SQ(dz)), dy);
} }
void func_80035844(Vec3f* arg0, Vec3f* arg1, Vec3s* arg2, s32 arg3)
{
_func_80035844(arg0, arg1, arg2, arg3);
}
void func_80035844(Vec3f* arg0, Vec3f* arg1, VecRot* arg2, s32 arg3)
{
_func_80035844(arg0, arg1, arg2, arg3);
}
/** /**
* Spawns En_Part (Dissipating Flames) actor as a child of the given actor. * Spawns En_Part (Dissipating Flames) actor as a child of the given actor.
*/ */
Actor* func_800358DC(Actor* actor, Vec3f* spawnPos, Vec3s* spawnRot, f32* arg3, s32 timer, s16* unused, Actor* func_800358DC(Actor* actor, Vec3f* spawnPos, VecRot* spawnRot, f32* arg3, s32 timer, s16* unused,
GlobalContext* globalCtx, s16 params, s32 arg8) { GlobalContext* globalCtx, s16 params, s32 arg8) {
EnPart* spawnedEnPart; EnPart* spawnedEnPart;

View File

@ -6954,8 +6954,8 @@ s32 Camera_Special9(Camera* camera) {
camera->unk_14C &= ~(0x4 | 0x2); camera->unk_14C &= ~(0x4 | 0x2);
camera->animState++; camera->animState++;
anim->targetYaw = ABS(playerPosRot->rot.y - adjustedPlayerPosRot.rot.y) >= 0x4000 anim->targetYaw = ABS(playerPosRot->rot.y - adjustedPlayerPosRot.rot.y) >= 0x4000
? BINANG_ROT180(adjustedPlayerPosRot.rot.y) ? BINANG_ROT180(adjustedPlayerPosRot.rot.y.whole())
: adjustedPlayerPosRot.rot.y; : adjustedPlayerPosRot.rot.y.whole();
case 1: case 1:
spec9->doorParams.timer1--; spec9->doorParams.timer1--;
if (spec9->doorParams.timer1 <= 0) { if (spec9->doorParams.timer1 <= 0) {

View File

@ -274,7 +274,8 @@ s32 Math_StepUntilS(Rotation* pValue, s16 limit, const Step& step)
* Changes pValue by step towards target angle, setting it equal when the target is reached. * Changes pValue by step towards target angle, setting it equal when the target is reached.
* Returns true when target is reached, false otherwise. * Returns true when target is reached, false otherwise.
*/ */
s32 Math_StepToAngleS(s16* pValue, s16 target, const Step& _step) { template<class T>
static inline s32 _Math_StepToAngleS(T* pValue, s16 target, const Step& _step) {
float step = _step.value(); float step = _step.value();
s32 diff = target - *pValue; s32 diff = target - *pValue;
@ -304,6 +305,16 @@ s32 Math_StepToAngleS(s16* pValue, s16 target, const Step& _step) {
return false; return false;
} }
s32 Math_StepToAngleS(s16* pValue, s16 target, const Step& _step)
{
return _Math_StepToAngleS(pValue, target, _step);
}
s32 Math_StepToAngleS(Rotation* pValue, s16 target, const Step& _step)
{
return _Math_StepToAngleS(pValue, target, _step);
}
/** /**
* Changes pValue by step. If pvalue reaches limit, sets it equal to limit. * Changes pValue by step. If pvalue reaches limit, sets it equal to limit.
* Returns true when limit is reached, false otherwise. * Returns true when limit is reached, false otherwise.

View File

@ -327,7 +327,7 @@ void func_8086C618(BgBdanObjects* pthis, GlobalContext* globalCtx) {
pthis->actionFunc = func_8086C6EC; pthis->actionFunc = func_8086C6EC;
} else { } else {
pthis->dyna.actor.shape.rot.y += pthis->dyna.actor.world.rot.y; pthis->dyna.actor.shape.rot.y += pthis->dyna.actor.world.rot.y;
func_800F436C(&pthis->dyna.actor.projectedPos, 0x2063, ABS(pthis->dyna.actor.world.rot.y) / 512.0f); func_800F436C(&pthis->dyna.actor.projectedPos, 0x2063, pthis->dyna.actor.world.rot.y.abs() / 512.0f);
} }
} }

View File

@ -171,7 +171,7 @@ Actor* BgBreakwall_SpawnFragments(GlobalContext* globalCtx, BgBreakwall* pthis,
} }
for (i = 0; i < count; angle2 += 0x4000, i++) { for (i = 0; i < count; angle2 += 0x4000, i++) {
angle1 = ABS(pthis->dyna.actor.world.rot.y) + angle2; angle1 = pthis->dyna.actor.world.rot.y.abs() + angle2;
Matrix_Translate(pthis->dyna.actor.world.pos.x, pthis->dyna.actor.world.pos.y, pthis->dyna.actor.world.pos.z, Matrix_Translate(pthis->dyna.actor.world.pos.x, pthis->dyna.actor.world.pos.y, pthis->dyna.actor.world.pos.z,
MTXMODE_NEW); MTXMODE_NEW);
Matrix_RotateZYX(pthis->dyna.actor.world.rot.x, pthis->dyna.actor.world.rot.y, pthis->dyna.actor.world.rot.z, Matrix_RotateZYX(pthis->dyna.actor.world.rot.x, pthis->dyna.actor.world.rot.y, pthis->dyna.actor.world.rot.z,

View File

@ -107,7 +107,7 @@ void BgHidanKousi_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void func_80889ACC(BgHidanKousi* pthis) { void func_80889ACC(BgHidanKousi* pthis) {
s32 pad[2]; s32 pad[2];
Vec3s* rot = &pthis->dyna.actor.world.rot; auto rot = &pthis->dyna.actor.world.rot;
f32 temp1 = D_80889E40[pthis->dyna.actor.params & 0xFF] * Math_SinS(rot->y); f32 temp1 = D_80889E40[pthis->dyna.actor.params & 0xFF] * Math_SinS(rot->y);
f32 temp2 = D_80889E40[pthis->dyna.actor.params & 0xFF] * Math_CosS(rot->y); f32 temp2 = D_80889E40[pthis->dyna.actor.params & 0xFF] * Math_CosS(rot->y);

View File

@ -104,7 +104,7 @@ void BgMizuShutter_Destroy(BgMizuShutter* thisx, GlobalContext* globalCtx) {
void BgMizuShutter_WaitForSwitch(BgMizuShutter* pthis, GlobalContext* globalCtx) { void BgMizuShutter_WaitForSwitch(BgMizuShutter* pthis, GlobalContext* globalCtx) {
if (Flags_GetSwitch(globalCtx, (u16)pthis->dyna.actor.params & 0x3F)) { if (Flags_GetSwitch(globalCtx, (u16)pthis->dyna.actor.params & 0x3F)) {
if (ABS(pthis->dyna.actor.world.rot.x) > 0x2C60) { if (pthis->dyna.actor.world.rot.x.abs() > 0x2C60) {
OnePointCutscene_Init(globalCtx, 4510, -99, &pthis->dyna.actor, MAIN_CAM); OnePointCutscene_Init(globalCtx, 4510, -99, &pthis->dyna.actor, MAIN_CAM);
} else { } else {
OnePointCutscene_Attention(globalCtx, &pthis->dyna.actor); OnePointCutscene_Attention(globalCtx, &pthis->dyna.actor);

View File

@ -682,7 +682,7 @@ void EnGoroiwa_SetupWait(EnGoroiwa* pthis) {
pthis->actionFunc = EnGoroiwa_Wait; pthis->actionFunc = EnGoroiwa_Wait;
pthis->actor.speedXZ = 0.0f; pthis->actor.speedXZ = 0.0f;
EnGoroiwa_UpdateFlags(pthis, ENGOROIWA_ENABLE_OC); EnGoroiwa_UpdateFlags(pthis, ENGOROIWA_ENABLE_OC);
pthis->waitTimer = waitDurations_84[pthis->actor.home.rot.z & 1]; pthis->waitTimer = waitDurations_84[pthis->actor.home.rot.z.whole() & 1];
pthis->rollRotSpeed = 0.0f; pthis->rollRotSpeed = 0.0f;
} }

View File

@ -322,8 +322,8 @@ void func_80AD95D8(EnPoSisters* pthis) {
Animation_MorphToPlayOnce(&pthis->skelAnime, &gPoeSistersDamagedAnim, -3.0f); Animation_MorphToPlayOnce(&pthis->skelAnime, &gPoeSistersDamagedAnim, -3.0f);
if (pthis->collider.base.ac != NULL) { if (pthis->collider.base.ac != NULL) {
pthis->actor.world.rot.y = (pthis->collider.info.acHitInfo->toucher.dmgFlags & 0x1F824) pthis->actor.world.rot.y = (pthis->collider.info.acHitInfo->toucher.dmgFlags & 0x1F824)
? pthis->collider.base.ac->world.rot.y ? (float)pthis->collider.base.ac->world.rot.y
: Actor_WorldYawTowardActor(&pthis->actor, pthis->collider.base.ac) + 0x8000; : (float)Actor_WorldYawTowardActor(&pthis->actor, pthis->collider.base.ac) + 0x8000;
} }
if (pthis->unk_194 != 0) { if (pthis->unk_194 != 0) {
pthis->actor.speedXZ = 10.0f; pthis->actor.speedXZ = 10.0f;

View File

@ -322,7 +322,7 @@ void EnTrap_Update(Actor* thisx, GlobalContext* globalCtx) {
// if in initial position: // if in initial position:
} else if ((thisx->world.pos.x == thisx->home.pos.x) && (thisx->world.pos.z == thisx->home.pos.z)) { } else if ((thisx->world.pos.x == thisx->home.pos.x) && (thisx->world.pos.z == thisx->home.pos.z)) {
// of the available 4-way directions, get the one which is closest to the direction of player: // of the available 4-way directions, get the one which is closest to the direction of player:
pthis->vClosestDirection = ((thisx->yawTowardsPlayer - thisx->world.rot.y) + 0x2000) & 0xC000; pthis->vClosestDirection = ((thisx->yawTowardsPlayer - thisx->world.rot.y.whole()) + 0x2000) & 0xC000;
pthis->vMovementMetric = 0.0f; pthis->vMovementMetric = 0.0f;
if (thisx->xzDistToPlayer < 200.0f) { if (thisx->xzDistToPlayer < 200.0f) {
pthis->vMovementMetric = BEGIN_MOVE_OUT; pthis->vMovementMetric = BEGIN_MOVE_OUT;

View File

@ -193,7 +193,7 @@ void func_80B53764(EnZl3* pthis, GlobalContext* globalCtx) {
s32 func_80B537E8(EnZl3* pthis) { s32 func_80B537E8(EnZl3* pthis) {
s16 yawTowardsPlayer = pthis->actor.yawTowardsPlayer; s16 yawTowardsPlayer = pthis->actor.yawTowardsPlayer;
s16* rotY = &pthis->actor.world.rot.y; auto rotY = &pthis->actor.world.rot.y;
s16* unk_3D0 = &pthis->unk_3D0; s16* unk_3D0 = &pthis->unk_3D0;
s16 retVal; s16 retVal;
s16 pad[2]; s16 pad[2];
@ -206,7 +206,7 @@ s32 func_80B537E8(EnZl3* pthis) {
void func_80B538B0(EnZl3* pthis) { void func_80B538B0(EnZl3* pthis) {
s16 yawTowardsPlayer = pthis->actor.yawTowardsPlayer; s16 yawTowardsPlayer = pthis->actor.yawTowardsPlayer;
s16* rotY = &pthis->actor.world.rot.y; auto rotY = &pthis->actor.world.rot.y;
if (ABS((s16)(yawTowardsPlayer - *rotY)) >= 0x1556) { if (ABS((s16)(yawTowardsPlayer - *rotY)) >= 0x1556) {
D_80B5A468 = 1; D_80B5A468 = 1;
@ -1680,14 +1680,14 @@ s32 func_80B571FC(EnZl3* pthis) {
void func_80B57240(EnZl3* pthis) { void func_80B57240(EnZl3* pthis) {
s32 temp_a1 = func_80B571FC(pthis); s32 temp_a1 = func_80B571FC(pthis);
s16* rotY = &pthis->actor.world.rot.y; auto rotY = &pthis->actor.world.rot.y;
Math_SmoothStepToS(rotY, temp_a1, 2, 6400, 1000); Math_SmoothStepToS(rotY, temp_a1, 2, 6400, 1000);
pthis->actor.shape.rot.y = *rotY; pthis->actor.shape.rot.y = *rotY;
} }
void func_80B57298(EnZl3* pthis) { void func_80B57298(EnZl3* pthis) {
s16* rotY = &pthis->actor.world.rot.y; auto rotY = &pthis->actor.world.rot.y;
s16 temp_a1 = func_80B571A8(pthis); s16 temp_a1 = func_80B571A8(pthis);
Math_SmoothStepToS(rotY, temp_a1, 2, 6400, 1000); Math_SmoothStepToS(rotY, temp_a1, 2, 6400, 1000);

View File

@ -389,24 +389,38 @@ f32 Fishing_RandZeroOne(void) {
return fabsf(rand); return fabsf(rand);
} }
s16 Fishing_SmoothStepToS(s16* pValue, s16 target, s16 scale, s16 step) { template<class T>
s16 stepSize; static inline s16 _Fishing_SmoothStepToS(T* pValue, s16 target, s16 scale, s16 step)
s16 diff; {
s16 stepSize;
s16 diff;
diff = target - *pValue; diff = target - *pValue;
stepSize = diff / scale; stepSize = diff / scale;
if (stepSize > step) { if(stepSize > step)
stepSize = step; {
} stepSize = step;
}
if (stepSize < -step) { if(stepSize < -step)
stepSize = -step; {
} stepSize = -step;
}
*pValue += stepSize; *pValue += stepSize;
return stepSize; return stepSize;
}
s16 Fishing_SmoothStepToS(s16* pValue, s16 target, s16 scale, s16 step)
{
return _Fishing_SmoothStepToS(pValue, target, scale, step);
}
s16 Fishing_SmoothStepToS(Rotation* pValue, s16 target, s16 scale, s16 step)
{
return _Fishing_SmoothStepToS(pValue, target, scale, step);
} }
void Fishing_SpawnRipple(Vec3f* projectedPos, FishingEffect* effect, Vec3f* pos, f32 arg3, f32 arg4, s16 arg5, void Fishing_SpawnRipple(Vec3f* projectedPos, FishingEffect* effect, Vec3f* pos, f32 arg3, f32 arg4, s16 arg5,

View File

@ -48,7 +48,7 @@ static u32 sFlags[3][2] = { { 0, 0 }, { 1, 0 }, { 0, 1 } };
static void (*sFlagSwitchFuncs[])(GlobalContext* globalCtx, s32 flag) = { Flags_UnsetSwitch, Flags_SetSwitch }; static void (*sFlagSwitchFuncs[])(GlobalContext* globalCtx, s32 flag) = { Flags_UnsetSwitch, Flags_SetSwitch };
void ObjMakeoshihiki_Init(Actor* thisx, GlobalContext* globalCtx) { void ObjMakeoshihiki_Init(Actor* thisx, GlobalContext* globalCtx) {
BlockConfig* block = &sBlocks[thisx->home.rot.z & 1]; BlockConfig* block = &sBlocks[thisx->home.rot.z.whole() & 1];
s32 typeIdx; s32 typeIdx;
Vec3f* spawnPos; Vec3f* spawnPos;
@ -80,7 +80,7 @@ void ObjMakeoshihiki_Init(Actor* thisx, GlobalContext* globalCtx) {
} }
void ObjMakeoshihiki_Draw(Actor* thisx, GlobalContext* globalCtx) { void ObjMakeoshihiki_Draw(Actor* thisx, GlobalContext* globalCtx) {
BlockConfig* block = &sBlocks[thisx->home.rot.z & 1]; BlockConfig* block = &sBlocks[thisx->home.rot.z.whole() & 1];
s32 i; s32 i;
s32 sfxCond1; s32 sfxCond1;
s32 sfxCond2; s32 sfxCond2;

View File

@ -338,7 +338,7 @@ void ObjTimeblock_Update(Actor* thisx, GlobalContext* globalCtx) {
void ObjTimeblock_Draw(Actor* thisx, GlobalContext* globalCtx) { void ObjTimeblock_Draw(Actor* thisx, GlobalContext* globalCtx) {
if (((ObjTimeblock*)thisx)->isVisible) { if (((ObjTimeblock*)thisx)->isVisible) {
Color_RGB8* primColor = &sPrimColors[thisx->home.rot.z & 7]; Color_RGB8* primColor = &sPrimColors[thisx->home.rot.z.whole() & 7];
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_obj_timeblock.c", 762); OPEN_DISPS(globalCtx->state.gfxCtx, "../z_obj_timeblock.c", 762);

View File

@ -312,7 +312,7 @@ void ObjWarp2block_Update(Actor* thisx, GlobalContext* globalCtx) {
void ObjWarp2block_Draw(Actor* thisx, GlobalContext* globalCtx) { void ObjWarp2block_Draw(Actor* thisx, GlobalContext* globalCtx) {
Color_RGB8* sp44; Color_RGB8* sp44;
sp44 = &sColors[thisx->home.rot.z & 7]; sp44 = &sColors[thisx->home.rot.z.whole() & 7];
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_obj_warp2block.c", 584); OPEN_DISPS(globalCtx->state.gfxCtx, "../z_obj_warp2block.c", 584);
func_80093D18(globalCtx->state.gfxCtx); func_80093D18(globalCtx->state.gfxCtx);

View File

@ -9223,7 +9223,7 @@ void Player_Init(Actor* pthisx, GlobalContext* globalCtx2) {
MREG(64) = 0; MREG(64) = 0;
} }
void func_808471F4(s16* pValue) { static void func_808471F4(s16* pValue) {
s16 step; s16 step;
step = (ABS(*pValue) * 100.0f) / 1000.0f; step = (ABS(*pValue) * 100.0f) / 1000.0f;
@ -9232,6 +9232,16 @@ void func_808471F4(s16* pValue) {
Math_ScaledStepToS(pValue, 0, step); Math_ScaledStepToS(pValue, 0, step);
} }
static void func_808471F4(Rotation* pValue)
{
s16 step;
step = (pValue->abs() * 100.0f) / 1000.0f;
step = CLAMP(step, 400, 4000);
Math_ScaledStepToS(pValue, 0, step);
}
void func_80847298(Player* pthis) { void func_80847298(Player* pthis) {
s16 sp26; s16 sp26;
@ -10589,7 +10599,7 @@ s16 func_8084ABD8(GlobalContext* globalCtx, Player* pthis, s32 arg2, s16 arg3) {
temp3 = ((sControlInput->rel.stick_y >= 0) ? 1 : -1) * temp3 = ((sControlInput->rel.stick_y >= 0) ? 1 : -1) *
(s32)((1.0f - Math_CosS(sControlInput->rel.stick_y * 200)) * 1500.0f); (s32)((1.0f - Math_CosS(sControlInput->rel.stick_y * 200)) * 1500.0f);
pthis->actor.focus.rot.x += temp3; pthis->actor.focus.rot.x += temp3;
pthis->actor.focus.rot.x = CLAMP(pthis->actor.focus.rot.x, -temp1, temp1); pthis->actor.focus.rot.x = CLAMP((float)pthis->actor.focus.rot.x, -temp1, temp1);
temp1 = 19114; temp1 = 19114;
temp2 = pthis->actor.focus.rot.y - pthis->actor.shape.rot.y; temp2 = pthis->actor.focus.rot.y - pthis->actor.shape.rot.y;