Add FixMapParts

Use MapObj instead of MapParts for folder name

Add newline at end of FixMapParts.h

Fix include in FixMapParts.cpp

Add missing overrides to FixMapParts
This commit is contained in:
Sanae 2022-10-18 12:09:20 -06:00
parent 38b6c8510f
commit d8043eb7e5
9 changed files with 109 additions and 16 deletions

View File

@ -58253,13 +58253,13 @@ Address,Quality,Size,Name
0x0000007100913990,U,000008,
0x0000007100913998,U,000012,
0x00000071009139a4,U,000164,
0x0000007100913a48,U,000124,_ZN2al11FixMapPartsC2EPKc
0x0000007100913ac4,U,000136,_ZN2al11FixMapPartsC1EPKc
0x0000007100913b4c,U,000136,_ZN2al11FixMapParts4initERKNS_13ActorInitInfoE
0x0000007100913bd4,U,000068,_ZN2al11FixMapParts6appearEv
0x0000007100913c18,U,000016,_ZN2al11FixMapParts8movementEv
0x0000007100913c28,U,000016,_ZN2al11FixMapParts8calcAnimEv
0x0000007100913c38,U,000136,_ZN2al11FixMapParts10receiveMsgEPKNS_9SensorMsgEPNS_9HitSensorES5_
0x0000007100913a48,O,000124,_ZN2al11FixMapPartsC2EPKc
0x0000007100913ac4,O,000136,_ZN2al11FixMapPartsC1EPKc
0x0000007100913b4c,O,000136,_ZN2al11FixMapParts4initERKNS_13ActorInitInfoE
0x0000007100913bd4,O,000068,_ZN2al11FixMapParts6appearEv
0x0000007100913c18,O,000016,_ZN2al11FixMapParts8movementEv
0x0000007100913c28,O,000016,_ZN2al11FixMapParts8calcAnimEv
0x0000007100913c38,O,000136,_ZN2al11FixMapParts10receiveMsgEPKNS_9SensorMsgEPNS_9HitSensorES5_
0x0000007100913cc0,U,000168,_ZN2al15FloaterMapPartsC2EPKc
0x0000007100913d68,U,000180,_ZN2al15FloaterMapPartsC1EPKc
0x0000007100913e1c,U,000300,_ZN2al15FloaterMapParts4initERKNS_13ActorInitInfoE

Can't render this file because it is too large.

View File

@ -0,0 +1,17 @@
#pragma once
#include "al/LiveActor/LiveActor.h"
namespace al {
class FixMapParts : public LiveActor {
public:
FixMapParts(const char* name);
void init(const ActorInitInfo& info) override;
void appear() override;
void movement() override;
void calcAnim() override;
bool receiveMsg(const SensorMsg* message, HitSensor* source, HitSensor* target) override;
private:
bool mStatic = false;
};
} // namespace al

View File

@ -7,6 +7,9 @@ class SensorMsg;
void sendMsgPlayerReleaseEquipment(HitSensor* source, HitSensor* target);
bool isMsgPlayerDisregard(al::SensorMsg const* message);
bool isMsgPlayerDisregard(const al::SensorMsg* message);
bool isMsgHideModel(const al::SensorMsg* message);
bool isMsgShowModel(const al::SensorMsg* message);
bool isMsgAskSafetyPoint(const al::SensorMsg* message);
} // namespace al

View File

@ -43,8 +43,8 @@ void offUpdateMovementEffectAudioCollisionSensor(const LiveActor*);
bool isDead(const LiveActor*);
bool isAlive(const LiveActor*);
bool isHideModel(const LiveActor*);
void hideModelIfShow(const LiveActor*);
void showModelIfHide(const LiveActor*);
void hideModelIfShow(al::LiveActor*);
void showModelIfHide(al::LiveActor*);
void setModelAlphaMask(const LiveActor*, float);
void resetPosition(const LiveActor*);
const LiveActor* getSubActor(const LiveActor*, const char*); // NOTE: unknown return type
@ -54,7 +54,12 @@ void onSyncHideSubActor(LiveActor*, const LiveActor*);
void onSyncAlphaMaskSubActor(LiveActor*, const LiveActor*);
void setMaterialProgrammable(al::LiveActor*);
void startAction(al::LiveActor*, char const*);
void tryStartAction(al::LiveActor*, char const*);
bool isActionEnd(const al::LiveActor*);
bool isExistAction(const al::LiveActor*);
bool isExistModel(const al::LiveActor*);
bool isViewDependentModel(const al::LiveActor*);
void calcViewModel(const al::LiveActor*);
void calcQuat(sead::Quatf*, const al::LiveActor*);
void calcJointFrontDir(sead::Vector3f*, const al::LiveActor*, const char*);
@ -62,13 +67,20 @@ float* findActorParamF32(const al::LiveActor*, const char*);
int* findActorParamS32(const al::LiveActor*, const char*);
void setNerveAtActionEnd(al::LiveActor*, const al::Nerve*);
void initActorWithArchiveName(al::LiveActor*, const al::ActorInitInfo&, const sead::SafeString&,
const char*);
void initActorWithArchiveName(al::LiveActor* actor, const al::ActorInitInfo& info, const sead::SafeString&,
const char* suffix);
void initMapPartsActor(al::LiveActor* actor, const al::ActorInitInfo& info, const char* suffix);
void initJointControllerKeeper(const al::LiveActor*, int);
void initJointGlobalQuatController(const al::LiveActor*, const sead::Quatf*, const char*);
bool isEffectEmitting(const IUseEffectKeeper*, const char*);
void trySyncStageSwitchAppear(al::LiveActor* actor);
void trySyncStageSwitchAppearAndKill(al::LiveActor* actor);
void registActorToDemoInfo(al::LiveActor* actor, const al::ActorInitInfo& info);
} // namespace al
namespace rs {

View File

@ -130,7 +130,7 @@ bool tryGetArg(int*, const al::PlacementInfo&, const char*);
bool tryGetArg(float*, const al::PlacementInfo&, const char*);
bool tryGetArg(bool*, const al::PlacementInfo&, const char*);
bool tryGetStringArg(const char**, al::ActorInitInfo const*, const char*);
bool tryGetStringArg(const char**, al::ActorInitInfo const&, const char*);
bool isEqualString(const char* stringA, const char* stringB);
@ -157,9 +157,6 @@ bool isObjectName(al::PlacementInfo const&, char const*);
void invalidateHitSensors(al::LiveActor*);
void hideModelIfShow(al::LiveActor*);
void showModelIfHide(al::LiveActor*);
void hideModel(al::LiveActor*);
void showModel(al::LiveActor*);

View File

@ -0,0 +1,8 @@
#pragma once
namespace al {
class IUseStageSwitch;
bool isValidSwitchAppear(const IUseStageSwitch* user);
bool isValidSwitchKill(const IUseStageSwitch* user);
} // namespace al

View File

@ -7,6 +7,7 @@ add_subdirectory(hack)
add_subdirectory(input)
add_subdirectory(iuse)
add_subdirectory(LiveActor)
add_subdirectory(MapObj)
add_subdirectory(nerve)
add_subdirectory(player)
add_subdirectory(rail)

View File

@ -0,0 +1,3 @@
target_sources(odyssey PRIVATE
FixMapParts.cpp
)

View File

@ -0,0 +1,52 @@
#include "al/MapObj/FixMapParts.h"
#include "al/sensor/SensorMsg.h"
#include "al/util/LiveActorUtil.h"
#include "al/util/OtherUtil.h"
#include "al/util/StageSwitchUtil.h"
namespace al {
FixMapParts::FixMapParts(const char* name) : LiveActor(name) {}
void FixMapParts::init(const ActorInitInfo& info) {
const char* suffix = nullptr;
tryGetStringArg(&suffix, info, "Suffix");
initMapPartsActor(this, info, suffix);
trySyncStageSwitchAppearAndKill(this);
registActorToDemoInfo(this, info);
if (mModelKeeper != nullptr && !isExistAction(this) && !isViewDependentModel(this)) {
mStatic = true;
}
}
void FixMapParts::appear() {
LiveActor::appear();
if (isExistModel(this))
tryStartAction(this, "Appear");
}
void FixMapParts::movement() {
if (!mStatic)
LiveActor::movement();
}
void FixMapParts::calcAnim() {
if (!mStatic)
LiveActor::calcAnim();
else
calcViewModel(this);
}
bool FixMapParts::receiveMsg(const SensorMsg* message, HitSensor* source, HitSensor* target) {
if (isMsgAskSafetyPoint(message))
return !isValidSwitchAppear(this) && !isValidSwitchKill(this);
if (isMsgShowModel(message)) {
showModelIfHide(this);
return true;
}
if (isMsgHideModel(message)) {
hideModelIfShow(this);
return true;
}
return false;
}
} // namespace al