MapObj: Implement TestMusaGraph (#900)

This commit is contained in:
Narr the Reg 2026-02-14 12:06:26 -06:00 committed by GitHub
parent 4aaa692559
commit c73ac5d56d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 108 additions and 11 deletions

View file

@ -67780,7 +67780,7 @@ MapObj/ElectricWire.o:
- offset: 0x2670bc
size: 76
label: _ZNK2al5Graph7PosEdge9getWeightEv
status: NotDecompiled
status: Matching
lazy: true
- offset: 0x267108
size: 424
@ -88618,46 +88618,46 @@ MapObj/TestMusaGraph.o:
- offset: 0x336c64
size: 124
label: _ZN13TestMusaGraphC2EPKc
status: NotDecompiled
status: Matching
- offset: 0x336ce0
size: 136
label: _ZN13TestMusaGraphC1EPKc
status: NotDecompiled
status: Matching
- offset: 0x336d68
size: 664
label: _ZN13TestMusaGraph4initERKN2al13ActorInitInfoE
status: NotDecompiled
status: NonMatchingMajor
- offset: 0x337000
size: 516
label: _ZN2al24insertVertexAndSplitEdgeINS_5Graph9PosVertexENS1_7PosEdgeEEEPT0_PS1_PT_S5_
status: NotDecompiled
status: Matching
lazy: true
- offset: 0x337204
size: 4
label: _ZN13TestMusaGraph12attackSensorEPN2al9HitSensorES2_
status: NotDecompiled
status: Matching
- offset: 0x337208
size: 8
label: _ZN13TestMusaGraph10receiveMsgEPKN2al9SensorMsgEPNS0_9HitSensorES5_
status: NotDecompiled
status: Matching
- offset: 0x337210
size: 4
label: _ZN13TestMusaGraph7exeWaitEv
status: NotDecompiled
status: Matching
- offset: 0x337214
size: 4
label: _ZNK12_GLOBAL__N_120TestMusaGraphNrvWait7executeEPN2al11NerveKeeperE
status: NotDecompiled
status: Matching
guess: true
- offset: 0x337218
size: 956
label: _ZN2al19appendGraphFromRailINS_5Graph9PosVertexENS1_7PosEdgeEEEvPS1_PKNS_4RailEbb
status: NotDecompiled
status: Matching
lazy: true
- offset: 0x3375d4
size: 524
label: _ZN2al19createAndAppendEdgeINS_5Graph9PosVertexENS1_7PosEdgeEEEvPS1_PT_S6_b
status: NotDecompiled
status: Matching
lazy: true
MapObj/TestPacketReader.o:
'.text':

View file

@ -0,0 +1,71 @@
#include "MapObj/TestMusaGraph.h"
#include "Library/LiveActor/ActorClippingFunction.h"
#include "Library/LiveActor/ActorInitFunction.h"
#include "Library/LiveActor/ActorInitUtil.h"
#include "Library/Nerve/NerveSetupUtil.h"
#include "Library/Nerve/NerveUtil.h"
#include "Library/Placement/PlacementFunction.h"
#include "Library/Placement/PlacementInfo.h"
#include "Library/Rail/VertexGraph.h"
namespace {
NERVE_IMPL(TestMusaGraph, Wait)
NERVES_MAKE_STRUCT(TestMusaGraph, Wait)
} // namespace
TestMusaGraph::TestMusaGraph(const char* name) : al::LiveActor(name) {}
// NON-MATCHING: Different stack pointer reference https://decomp.me/scratch/IDKIq
void TestMusaGraph::init(const al::ActorInitInfo& info) {
al::initActorSceneInfo(this, info);
al::initActorPoseTRSV(this);
al::initActorSRT(this, info);
al::initActorClipping(this, info);
al::initExecutorUpdate(this, info, "地形オブジェ[Movement]");
al::initStageSwitch(this, info);
al::initNerve(this, &NrvTestMusaGraph.Wait, 0);
al::initGroupClipping(this, info);
makeActorAlive();
al::Graph* graph = new al::Graph(0x40, 0x40);
mGraph = graph;
s32 railNum = al::calcLinkChildNum(info, "RailGraph");
for (s32 i = 0; i < railNum; i++) {
al::PlacementInfo placementInfo;
al::getLinksInfoByIndex(&placementInfo, info, "RailGraph", i);
al::Rail rail;
rail.init(placementInfo);
al::appendGraphFromRail<al::Graph::PosVertex, al::Graph::PosEdge>(graph, &rail, false,
true);
}
al::Graph::PosVertex* vertex =
new al::Graph::PosVertex(mGraph->getVertexCount(), sead::Vector3f::zero, 3);
mGraph->appendVertex(vertex);
mGraph->appendEdge(mGraph->getVertexCount() - 2, mGraph->getVertexCount() - 1, 1500.0f);
mGraph->appendEdge(2, 8, 1000.0f);
al::Graph::PosEdge* edge = reinterpret_cast<al::Graph::PosEdge*>(mGraph->tryFindEdge(0, 1));
if (edge) {
al::Graph::PosVertex* newEdge =
new al::Graph::PosVertex(mGraph->getVertexCount(), {-1000.0f, 0.0f, -1000.0f}, 4);
al::insertVertexAndSplitEdge<al::Graph::PosVertex, al::Graph::PosEdge>(mGraph, newEdge,
edge);
}
sead::FixedObjArray<al::Graph::VertexInfo, 0x40> path{};
al::calcShortestPath(&path, mGraph, 0, 8);
}
void TestMusaGraph::attackSensor(al::HitSensor* self, al::HitSensor* other) {}
bool TestMusaGraph::receiveMsg(const al::SensorMsg* message, al::HitSensor* other,
al::HitSensor* self) {
return false;
}
void TestMusaGraph::exeWait() {}

View file

@ -0,0 +1,26 @@
#pragma once
#include "Library/LiveActor/LiveActor.h"
namespace al {
struct ActorInitInfo;
class HitSensor;
class SensorMsg;
class Graph;
} // namespace al
class TestMusaGraph : public al::LiveActor {
public:
TestMusaGraph(const char* name);
void init(const al::ActorInitInfo& info) override;
void attackSensor(al::HitSensor* self, al::HitSensor* other) override;
bool receiveMsg(const al::SensorMsg* message, al::HitSensor* other,
al::HitSensor* self) override;
void exeWait();
private:
al::Graph* mGraph = nullptr;
};
static_assert(sizeof(TestMusaGraph) == 0x110);