mirror of
https://github.com/SMGCommunity/Petari.git
synced 2025-03-02 02:58:40 +00:00
some work on actor states
This commit is contained in:
parent
7238093e45
commit
94ed2cecd8
18
include/Actor/State/ActorStateBase.h
Normal file
18
include/Actor/State/ActorStateBase.h
Normal 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
|
@ -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
|
@ -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;
|
||||
|
14
include/MR/actor/ActorStateUtil.h
Normal file
14
include/MR/actor/ActorStateUtil.h
Normal 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
|
14
source/Actor/State/ActorStateBase.cpp
Normal file
14
source/Actor/State/ActorStateBase.cpp
Normal file
@ -0,0 +1,14 @@
|
||||
#include "Actor/State/ActorStateBase.h"
|
||||
|
||||
bool ActorStateBaseInterface::update()
|
||||
{
|
||||
updateNerve();
|
||||
|
||||
if (_8)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
control();
|
||||
return 0;
|
||||
}
|
15
source/MR/Actor/ActorStateUtil.cpp
Normal file
15
source/MR/Actor/ActorStateUtil.cpp
Normal 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();
|
||||
}
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user