Make LiveActor::isNerve() 1:1

This commit is contained in:
shibbo 2020-01-09 22:37:17 -05:00
parent e06aa64d64
commit d1ec5f3780
2 changed files with 12 additions and 11 deletions

View File

@ -54,7 +54,7 @@ public:
void calcAnmMtx();
void setNerve(const Nerve *);
bool isNerve(const Nerve *) const;
u8 isNerve(const Nerve *) const;
u32 getNerveStep() const;
HitSensor* getSensor(const char *) const;
void initModelManagerWithAnm(const char *, const char *, bool);

View File

@ -255,14 +255,18 @@ void LiveActor::calcAnmMtx()
// todo -- figure out why
void LiveActor::calcViewAndEntry()
{
if (mFlags.mIsNoCalcView)
u8 cond = mFlags.mIsNoCalcView != 0;
if (cond)
{
return;
}
if (mModelManager != 0)
{
mModelManager->calcView();
}
}
}
s32 LiveActor::receiveMessage(u32 msg, HitSensor *pTaking, HitSensor *pTaken)
{
@ -358,13 +362,10 @@ void LiveActor::setNerve(const Nerve *pNerve)
mSpine->setNerve(pNerve);
}
bool LiveActor::isNerve(const Nerve *pNerve) const
u8 LiveActor::isNerve(const Nerve *pNerve) const
{
// this adds some weird instructions
const Nerve* curNerve = mSpine->getCurrentNerve();
s32 what = curNerve - pNerve;
s32 blah = __cntlzw(what);
return blah >> 5;
return __cntlzw((u32)pNerve - (u32)curNerve) >> 5;
}
u32 LiveActor::getNerveStep() const