mirror of
https://github.com/MonsterDruide1/OdysseyDecomp
synced 2026-04-23 09:04:21 +00:00
MapObj: Implement FastenerObjSpace (#995)
This commit is contained in:
parent
3528e9e104
commit
b6f947c559
|
|
@ -69085,40 +69085,40 @@ MapObj/FastenerObjSpace.o:
|
|||
- offset: 0x27e1bc
|
||||
size: 124
|
||||
label: _ZN16FastenerObjSpaceC2EPKc
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x27e238
|
||||
size: 136
|
||||
label: _ZN16FastenerObjSpaceC1EPKc
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x27e2c0
|
||||
size: 112
|
||||
label: _ZN16FastenerObjSpace4initERKN2al13ActorInitInfoE
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x27e330
|
||||
size: 56
|
||||
label: _ZN16FastenerObjSpace6appearEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x27e368
|
||||
size: 44
|
||||
label: _ZN16FastenerObjSpace9disappearEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x27e394
|
||||
size: 4
|
||||
label: _ZN16FastenerObjSpace7exeWaitEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x27e398
|
||||
size: 92
|
||||
label: _ZN16FastenerObjSpace12exeDisappearEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x27e3f4
|
||||
size: 8
|
||||
label: _ZNK12_GLOBAL__N_123FastenerObjSpaceNrvWait7executeEPN2al11NerveKeeperE
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
guess: true
|
||||
- offset: 0x27e3fc
|
||||
size: 96
|
||||
label: _ZNK12_GLOBAL__N_128FastenerObjSpaceNrvDisappear7executeEPN2al11NerveKeeperE
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
guess: true
|
||||
MapObj/FastenerRailKeeper.o:
|
||||
'.text':
|
||||
|
|
|
|||
44
src/MapObj/FastenerObjSpace.cpp
Normal file
44
src/MapObj/FastenerObjSpace.cpp
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
#include "MapObj/FastenerObjSpace.h"
|
||||
|
||||
#include "Library/LiveActor/ActorClippingFunction.h"
|
||||
#include "Library/LiveActor/ActorInitUtil.h"
|
||||
#include "Library/LiveActor/ActorModelFunction.h"
|
||||
#include "Library/Nerve/NerveSetupUtil.h"
|
||||
#include "Library/Nerve/NerveUtil.h"
|
||||
|
||||
namespace {
|
||||
NERVE_IMPL(FastenerObjSpace, Wait);
|
||||
NERVE_IMPL(FastenerObjSpace, Disappear);
|
||||
NERVES_MAKE_NOSTRUCT(FastenerObjSpace, Wait, Disappear);
|
||||
} // namespace
|
||||
|
||||
FastenerObjSpace::FastenerObjSpace(const char* name) : al::LiveActor(name) {}
|
||||
|
||||
void FastenerObjSpace::init(const al::ActorInitInfo& info) {
|
||||
al::initActorWithArchiveName(this, info, "FastenerSpace", nullptr);
|
||||
al::initNerve(this, &Wait, 0);
|
||||
makeActorAlive();
|
||||
}
|
||||
|
||||
void FastenerObjSpace::appear() {
|
||||
al::LiveActor::appear();
|
||||
al::setModelAlphaMask(this, 1.0f);
|
||||
al::setNerve(this, &Wait);
|
||||
}
|
||||
|
||||
void FastenerObjSpace::disappear() {
|
||||
al::invalidateClipping(this);
|
||||
al::setNerve(this, &Disappear);
|
||||
}
|
||||
|
||||
void FastenerObjSpace::exeWait() {
|
||||
if (al::isFirstStep(this)) {
|
||||
}
|
||||
}
|
||||
|
||||
void FastenerObjSpace::exeDisappear() {
|
||||
f32 rate = al::calcNerveRate(this, 60);
|
||||
al::setModelAlphaMask(this, 1.0f - rate);
|
||||
if (al::isGreaterStep(this, 60))
|
||||
kill();
|
||||
}
|
||||
18
src/MapObj/FastenerObjSpace.h
Normal file
18
src/MapObj/FastenerObjSpace.h
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#pragma once
|
||||
|
||||
#include "Library/LiveActor/LiveActor.h"
|
||||
|
||||
class FastenerObjSpace : public al::LiveActor {
|
||||
public:
|
||||
FastenerObjSpace(const char* name);
|
||||
void init(const al::ActorInitInfo& info) override;
|
||||
void appear() override;
|
||||
void disappear();
|
||||
void exeWait();
|
||||
void exeDisappear();
|
||||
|
||||
private:
|
||||
al::LiveActor* mLinkActor = nullptr;
|
||||
};
|
||||
|
||||
static_assert(sizeof(FastenerObjSpace) == 0x110);
|
||||
Loading…
Reference in a new issue