some work on actor states

This commit is contained in:
shibbo 2020-06-27 21:49:14 -04:00
parent 7238093e45
commit 94ed2cecd8
6 changed files with 63 additions and 20 deletions

View File

@ -0,0 +1,18 @@
#ifndef ACTORSTATEBASE_H
#define ACTORSTATEBASE_H
#include "Actor/Nerve/NerveExecutor.h"
class ActorStateBaseInterface : public NerveExecutor
{
public:
virtual void init();
virtual void appear();
virtual void kill();
virtual bool update();
virtual void control();
u8 _8;
};
#endif // ACTORSTATEBASE_H

View File

@ -1,18 +0,0 @@
#ifndef ACTORSTATEBASEINTERFACE_H
#define ACTORSTATEBASEINTERFACE_H
#include "Actor/Nerve/NerveExecutor.h"
class ActorStateBaseInterface : public NerveExecutor
{
public:
void control();
void kill();
void appear();
void init();
bool update();
u8 _8;
};
#endif // ACTORSTATEBASEINTERFACE_H

View File

@ -2,7 +2,7 @@
#define ACTORSTATEKEEPER_H
#include "Actor/Nerve/Nerve.h"
#include "Actor/State/ActorStateBaseInterface.h"
#include "Actor/State/ActorStateBase.h"
class ActorStateKeeper
{
@ -14,7 +14,7 @@ public:
void startState(const Nerve *);
void endState(const Nerve *);
u32 _0;
s32 mStateCount; // _0
u32 _4;
u32 _8;
u32 _C;

View File

@ -0,0 +1,14 @@
#ifndef ACTORSTATEUTIL_H
#define ACTORSTATEUTIL_H
#include <revolution.h>
#include "Actor/Nerve/NerveExecutor.h"
namespace MR
{
void initActorStateKeeper(NerveExecutor *, s32);
bool updateActorState(NerveExecutor *);
};
#endif // ACTORSTATEUTIL_H

View File

@ -0,0 +1,14 @@
#include "Actor/State/ActorStateBase.h"
bool ActorStateBaseInterface::update()
{
updateNerve();
if (_8)
{
return 1;
}
control();
return 0;
}

View File

@ -0,0 +1,15 @@
#include "MR/actor/ActorStateUtil.h"
#include "Actor/State/ActorStateKeeper.h"
namespace MR
{
void initActorStateKeeper(NerveExecutor *pExecutor, s32 stateCount)
{
pExecutor->mSpine->initStateKeeper(stateCount);
}
bool updateActorState(NerveExecutor *pExecutor)
{
return pExecutor->mSpine->mStateKeeper->updateCurrentState();
}
};