From b6f947c559ba14a9876898b0a95bbb67e0880dc7 Mon Sep 17 00:00:00 2001 From: guymakinggames <66076221+guymakinggames@users.noreply.github.com> Date: Tue, 14 Apr 2026 21:14:11 +0100 Subject: [PATCH] MapObj: Implement `FastenerObjSpace` (#995) --- data/file_list.yml | 18 +++++++------- src/MapObj/FastenerObjSpace.cpp | 44 +++++++++++++++++++++++++++++++++ src/MapObj/FastenerObjSpace.h | 18 ++++++++++++++ 3 files changed, 71 insertions(+), 9 deletions(-) create mode 100644 src/MapObj/FastenerObjSpace.cpp create mode 100644 src/MapObj/FastenerObjSpace.h diff --git a/data/file_list.yml b/data/file_list.yml index 9b0b43b5..64c53263 100644 --- a/data/file_list.yml +++ b/data/file_list.yml @@ -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': diff --git a/src/MapObj/FastenerObjSpace.cpp b/src/MapObj/FastenerObjSpace.cpp new file mode 100644 index 00000000..0c34a383 --- /dev/null +++ b/src/MapObj/FastenerObjSpace.cpp @@ -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(); +} diff --git a/src/MapObj/FastenerObjSpace.h b/src/MapObj/FastenerObjSpace.h new file mode 100644 index 00000000..4e49f8f3 --- /dev/null +++ b/src/MapObj/FastenerObjSpace.h @@ -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);