mirror of
https://github.com/SMGCommunity/Petari.git
synced 2025-03-02 02:58:40 +00:00
more ActorStateUtil decompilation
This commit is contained in:
parent
5e494907da
commit
61410f7fbe
@ -3,11 +3,16 @@
|
||||
|
||||
#include <revolution.h>
|
||||
#include "Actor/Nerve/NerveExecutor.h"
|
||||
#include "Actor/State/ActorStateKeeper.h"
|
||||
|
||||
class LiveActor;
|
||||
|
||||
namespace MR
|
||||
{
|
||||
void initActorStateKeeper(NerveExecutor *, s32);
|
||||
|
||||
void initActorState(NerveExecutor *, ActorStateBaseInterface *, const Nerve *, const char *);
|
||||
bool updateActorState(LiveActor *, ActorStateBaseInterface *);
|
||||
bool updateActorStateAndNextNerve(LiveActor *, ActorStateBaseInterface *, const Nerve *);
|
||||
bool updateActorState(NerveExecutor *);
|
||||
};
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
#define LIVEACTORUTIL_H
|
||||
|
||||
#include <revolution.h>
|
||||
#include "JGeometry/TVec3.h"
|
||||
#include "JMap/JMapInfoIter.h"
|
||||
#include "System/Resource/ResourceHolder.h"
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "MR/actor/ActorStateUtil.h"
|
||||
#include "Actor/State/ActorStateKeeper.h"
|
||||
#include "MR/actor/LiveActorUtil.h"
|
||||
#include "Actor/LiveActor/LiveActor.h"
|
||||
|
||||
namespace MR
|
||||
{
|
||||
@ -8,6 +9,58 @@ namespace MR
|
||||
pExecutor->mSpine->initStateKeeper(stateCount);
|
||||
}
|
||||
|
||||
void initActorState(NerveExecutor *pExecutor, ActorStateBaseInterface *pStateBase, const Nerve *pNerve, const char *pStateName)
|
||||
{
|
||||
pStateBase->init();
|
||||
pExecutor->mSpine->mStateKeeper->addState(pStateBase, pNerve, pStateName);
|
||||
}
|
||||
|
||||
bool updateActorState(LiveActor *pActor, ActorStateBaseInterface *pStateBase)
|
||||
{
|
||||
bool ret;
|
||||
|
||||
if (MR::isFirstStep(pActor))
|
||||
{
|
||||
pStateBase->appear();
|
||||
}
|
||||
|
||||
bool res = pStateBase->update();
|
||||
|
||||
if (res)
|
||||
{
|
||||
if (!pStateBase->mIsDead)
|
||||
{
|
||||
pStateBase->kill();
|
||||
}
|
||||
|
||||
ret = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = false;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool updateActorStateAndNextNerve(LiveActor *pActor, ActorStateBaseInterface *pStateBase, const Nerve *pNerve)
|
||||
{
|
||||
bool ret;
|
||||
bool needsNerveUpdate = updateActorState(pActor, pStateBase);
|
||||
|
||||
if (needsNerveUpdate)
|
||||
{
|
||||
pActor->setNerve(pNerve);
|
||||
ret = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = false;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool updateActorState(NerveExecutor *pExecutor)
|
||||
{
|
||||
return pExecutor->mSpine->mStateKeeper->updateCurrentState();
|
||||
|
Loading…
x
Reference in New Issue
Block a user