summaryrefslogtreecommitdiff
path: root/src/KingSystem
diff options
context:
space:
mode:
Diffstat (limited to 'src/KingSystem')
-rw-r--r--src/KingSystem/ActorSystem/CMakeLists.txt6
-rw-r--r--src/KingSystem/ActorSystem/Profiles/actPlayerBase.cpp1
-rw-r--r--src/KingSystem/ActorSystem/Profiles/actPlayerBase.h19
-rw-r--r--src/KingSystem/ActorSystem/actPlayerInfo.cpp134
-rw-r--r--src/KingSystem/ActorSystem/actPlayerInfo.h120
-rw-r--r--src/KingSystem/ActorSystem/actPlayerInfoBase.cpp6
-rw-r--r--src/KingSystem/ActorSystem/actPlayerInfoStub.cpp19
-rw-r--r--src/KingSystem/System/CMakeLists.txt1
-rw-r--r--src/KingSystem/System/GameConfig.h (renamed from src/KingSystem/Framework/GameConfig.h)4
-rw-r--r--src/KingSystem/System/Patrol.cpp2
-rw-r--r--src/KingSystem/System/StarterPackMgr.h2
11 files changed, 7 insertions, 307 deletions
diff --git a/src/KingSystem/ActorSystem/CMakeLists.txt b/src/KingSystem/ActorSystem/CMakeLists.txt
index 5a5dd758..dab97a14 100644
--- a/src/KingSystem/ActorSystem/CMakeLists.txt
+++ b/src/KingSystem/ActorSystem/CMakeLists.txt
@@ -16,8 +16,6 @@ target_sources(uking PRIVATE
LOD/actLodState.cpp
LOD/actLodState.h
- Profiles/actPlayerBase.cpp
- Profiles/actPlayerBase.h
Profiles/actRopeBase.cpp
Profiles/actRopeBase.h
Profiles/actWeaponBase.cpp
@@ -116,10 +114,6 @@ target_sources(uking PRIVATE
actPhysicsConstraints.h
actPhysicsUserTag.cpp
actPhysicsUserTag.h
- actPlayerInfo.cpp
- actPlayerInfo.h
- actPlayerInfoBase.cpp
- actPlayerInfoStub.cpp
actTag.h
actionDummyAction.cpp
diff --git a/src/KingSystem/ActorSystem/Profiles/actPlayerBase.cpp b/src/KingSystem/ActorSystem/Profiles/actPlayerBase.cpp
deleted file mode 100644
index abc059cd..00000000
--- a/src/KingSystem/ActorSystem/Profiles/actPlayerBase.cpp
+++ /dev/null
@@ -1 +0,0 @@
-#include "KingSystem/ActorSystem/Profiles/actPlayerBase.h"
diff --git a/src/KingSystem/ActorSystem/Profiles/actPlayerBase.h b/src/KingSystem/ActorSystem/Profiles/actPlayerBase.h
deleted file mode 100644
index 4b6e6ec7..00000000
--- a/src/KingSystem/ActorSystem/Profiles/actPlayerBase.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#pragma once
-
-#include <prim/seadSafeString.h>
-#include "KingSystem/ActorSystem/actActor.h"
-
-namespace ksys::act {
-
-// TODO
-class PlayerBase : public Actor {
-public:
- // FIXME: name for x and name+type for y
- void switchEquipment(const sead::SafeString& slot, int frames, int x = -1,
- const uintptr_t& y = {});
-
- // FIXME: name for x
- void setExtraLife(s32 extra_life, f32 x);
-};
-
-} // namespace ksys::act
diff --git a/src/KingSystem/ActorSystem/actPlayerInfo.cpp b/src/KingSystem/ActorSystem/actPlayerInfo.cpp
deleted file mode 100644
index 5b5b9ca1..00000000
--- a/src/KingSystem/ActorSystem/actPlayerInfo.cpp
+++ /dev/null
@@ -1,134 +0,0 @@
-#include "KingSystem/ActorSystem/actPlayerInfo.h"
-#include "KingSystem/ActorSystem/Profiles/actPlayerBase.h"
-#include "KingSystem/ActorSystem/actActorConstDataAccess.h"
-#include "KingSystem/ActorSystem/actActorLinkConstDataAccess.h"
-#include "KingSystem/ActorSystem/actBaseProc.h"
-#include "KingSystem/ActorSystem/actBaseProcMgr.h"
-#include "KingSystem/GameData/gdtCommonFlagsUtils.h"
-#include "KingSystem/ksys.h"
-
-namespace ksys::act {
-
-SEAD_SINGLETON_DISPOSER_IMPL(PlayerInfo)
-
-PlayerInfo::PlayerInfo() = default;
-PlayerInfo::~PlayerInfo() = default;
-
-bool PlayerInfo::init() {
- return true;
-}
-
-void PlayerInfo::resetPlayer(PlayerBase* player) {
- if (mPlayerActor == player) {
- mPlayerActor = nullptr;
- ksys::setPlayerLink(nullptr);
- }
-}
-
-bool PlayerInfo::acquireHorse(BaseProc* horse) {
- return mHorseLink.acquire(horse, false);
-}
-
-void PlayerInfo::setHorseLink(const BaseProcLink& horse_link) {
- mHorseLink = horse_link;
-}
-
-PlayerBase* PlayerInfo::getPlayer() const {
- if (!mPlayerActor) {
- return nullptr;
- }
- BaseProcMgr::instance()->isAccessingProcSafe(mPlayerActor, nullptr);
- return mPlayerActor;
-}
-
-PlayerBase* PlayerInfo::getPlayer_() const {
- if (!mPlayerActor) {
- return nullptr;
- }
- BaseProcMgr::instance()->isAccessingProcSafe(mPlayerActor, nullptr);
- return mPlayerActor;
-}
-
-s32 PlayerInfo::getMaxLifeFromPlayerActor() const {
- return mPlayerActor ? mPlayerActor->getMaxLife() : 0;
-}
-
-void PlayerInfo::setMaxHeartValue(s32 quarter_hearts) {
- gdt::setFlag_MaxHartValue(quarter_hearts);
- mMaxHeartValue = static_cast<f32>(quarter_hearts);
-}
-
-u32 PlayerInfo::getMaxHeartValue() const {
- // Return type is unsigned, but the conversion is signed
- return static_cast<s32>(mMaxHeartValue);
-}
-
-void PlayerInfo::updateMaxHeartValueFromGameData() {
- mMaxHeartValue = static_cast<f32>(gdt::getFlag_MaxHartValue());
-}
-
-void PlayerInfo::setLifeForPlayerActor(s32 life) {
- if (mPlayerActor) {
- *mPlayerActor->getLife() = life;
- }
-}
-
-s32 PlayerInfo::getLifeFromPlayerActor() const {
- if (!mPlayerActor) {
- return 0;
- }
- auto* life = mPlayerActor->getLife();
- return life ? *life : 1;
-}
-
-void PlayerInfo::recoverLife() {
- setLifeForPlayerActor(getMaxLifeFromPlayerActor());
-}
-
-void PlayerInfo::setStaminaCurrentMax(f32 max_stamina) {
- gdt::setFlag_StaminaCurrentMax(max_stamina);
- mStaminaCurrentMax = max_stamina;
-}
-
-f32 PlayerInfo::getStaminaCurrentMax() const {
- return mStaminaCurrentMax;
-}
-
-void PlayerInfo::updateStaminaCurrentMaxFromGameData() {
- mStaminaCurrentMax = gdt::getFlag_StaminaCurrentMax();
-}
-
-void PlayerInfo::setStaminaMax(f32 max_stamina) {
- gdt::setFlag_StaminaMax(max_stamina);
- mStaminaMax = max_stamina;
-}
-
-f32 PlayerInfo::getStaminaMax() const {
- return mStaminaMax;
-}
-
-void PlayerInfo::updateStaminaMaxFromGameData() {
- mStaminaMax = gdt::getFlag_StaminaMax();
-}
-
-PlayerBase* PlayerInfo::getPlayerUnchecked() {
- return mPlayerActor;
-}
-
-sead::Vector3f& PlayerInfo::getPlayerPos() {
- ActorConstDataAccess accessor;
-
- acquireActor(&mPlayerLink, &accessor);
- accessor.debugLog(1, "getPlayerPos");
- return mPlayerPos;
-}
-
-sead::Vector3f& PlayerInfo::getPlayerPosForPostCalc() {
- ActorConstDataAccess accessor;
-
- acquireActor(&mPlayerLink, &accessor);
- accessor.debugLog(0, "getPlayerPosForPostCalc");
- return mPlayerPosForPostCalc;
-}
-
-} // namespace ksys::act
diff --git a/src/KingSystem/ActorSystem/actPlayerInfo.h b/src/KingSystem/ActorSystem/actPlayerInfo.h
deleted file mode 100644
index a47475c9..00000000
--- a/src/KingSystem/ActorSystem/actPlayerInfo.h
+++ /dev/null
@@ -1,120 +0,0 @@
-#pragma once
-
-#include <heap/seadDisposer.h>
-#include <math/seadVector.h>
-#include "KingSystem/ActorSystem/actBaseProcLink.h"
-#include "container/seadRingBuffer.h"
-
-namespace ksys::act {
-
-class Actor;
-class PlayerBase;
-
-class PlayerInfoBase {
-public:
- PlayerInfoBase();
- virtual ~PlayerInfoBase();
-};
-
-class PlayerInfo : public PlayerInfoBase {
- SEAD_SINGLETON_DISPOSER(PlayerInfo)
- PlayerInfo();
- ~PlayerInfo() override;
-
-public:
- BaseProcLink& getPlayerLink() { return mPlayerLink; }
- bool init();
- void setAndAcquirePlayer(PlayerBase* player); // requires PlayerOrEnemy and PlayerBase
- void resetPlayer(PlayerBase* player);
- bool acquireHorse(BaseProc* horse);
- void setHorseLink(const BaseProcLink& horse_link);
- PlayerBase* getPlayer() const;
- PlayerBase* getPlayer_() const; // possibly duped by compiler?
- Actor* getRiddenHorse() const; // requires PlayerBase vtable
- void setMaxLifeForPlayerActor(s32 max_heart); // requires PlayerBase
- s32 getMaxLifeFromPlayerActor() const;
- void setMaxHeartValue(s32 quarter_hearts);
- u32 getMaxHeartValue() const;
- void updateMaxHeartValueFromGameData();
- void setLifeForPlayerActor(s32 life);
- s32 getLifeFromPlayerActor() const;
- void updateCurrentHartFlagFromPlayerActor(); // TODO
- void updateLifeAfterGameOver(); // requires a global flag
- void
- resetLifeToBeforeSwordPull(); // requires HeartDisplayMgr (0x25D6578) and PlayerBase vtable
- void saveLifeInfoForSwordPull(); // requires PlayerBase vtable
- void recoverLife();
- void setStaminaCurrentMax(f32 max_stamina);
- f32 getStaminaCurrentMax() const;
- void updateStaminaCurrentMaxFromGameData();
- void setStaminaMax(f32 max_stamina);
- f32 getStaminaMax() const;
- void updateStaminaMaxFromGameData();
- void setMaxStaminaForPlayerActor(f32 max_stamina); // requires PlayerBase
- f32 getMaxStaminaFromPlayerActor() const; // requires PlayerBase
- void recoverStamina(); // requires PlayerBase
- void recoverCondition(); // requires PlayerBase
-
- PlayerBase* getPlayerUnchecked();
-
- sead::Vector3f& getPlayerPos();
- sead::Vector3f& getPlayerPosForPostCalc();
-
- // TODO: name and PlayerBase vtable
- sead::Vector3f& getPlayerM265();
-
-private:
- // These are probably debug stuff that were removed
- class Info1 : public PlayerInfoBase {
- public:
- Info1();
- ~Info1() override;
- } mInfo1;
- class Info2 : public PlayerInfoBase {
- public:
- Info2();
- ~Info2() override;
- } mInfo2;
- class Info3 : public PlayerInfoBase {
- public:
- Info3();
- ~Info3() override;
- } mInfo3;
- class Info4 : public PlayerInfoBase {
- public:
- Info4();
- ~Info4() override;
- } mInfo4;
- class Info5 : public PlayerInfoBase {
- public:
- Info5();
- ~Info5() override;
- } mInfo5;
- class Info6 : public PlayerInfoBase {
- public:
- Info6();
- ~Info6() override;
- } mInfo6;
- class Info7 : public PlayerInfoBase {
- public:
- Info7();
- ~Info7() override;
- } mInfo7;
- PlayerBase* mPlayerActor = nullptr;
- BaseProcLink mPlayerLink;
- BaseProcLink mHorseLink;
- sead::Vector3f mPlayerPos{0, 0, 0};
- sead::Vector3f mPlayerPosForPostCalc{0, 0, 0};
- f32 mMaxHeartValue = 0;
- f32 mStaminaCurrentMax = 1000; // 1000 = 1 wheel
- f32 mStaminaMax = 1000;
- f32 mLifeBeforeSwordPull = 0;
- f32 mExtraLifeBeforeSwordPull = 0;
- sead::FixedRingBuffer<sead::Vector3f, 60> mPreviousPositions;
- f32 _3a0 = 65535;
- f32 _3a4 = 65535;
- f32 _3a8 = -1;
-};
-KSYS_CHECK_SIZE_NX150(PlayerInfo, 0x3B0);
-
-} // namespace ksys::act
diff --git a/src/KingSystem/ActorSystem/actPlayerInfoBase.cpp b/src/KingSystem/ActorSystem/actPlayerInfoBase.cpp
deleted file mode 100644
index dbca9baa..00000000
--- a/src/KingSystem/ActorSystem/actPlayerInfoBase.cpp
+++ /dev/null
@@ -1,6 +0,0 @@
-#include "KingSystem/ActorSystem/actPlayerInfo.h"
-namespace ksys::act {
-// these are separate from actPlayerInfo.cpp so clang doesn't inline/dedupe them
-[[gnu::noinline]] PlayerInfoBase::PlayerInfoBase() = default;
-[[gnu::noinline]] PlayerInfoBase::~PlayerInfoBase() = default;
-} // namespace ksys::act
diff --git a/src/KingSystem/ActorSystem/actPlayerInfoStub.cpp b/src/KingSystem/ActorSystem/actPlayerInfoStub.cpp
deleted file mode 100644
index 2f9dc100..00000000
--- a/src/KingSystem/ActorSystem/actPlayerInfoStub.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-#include "KingSystem/ActorSystem/actPlayerInfo.h"
-namespace ksys::act {
-// these are separate from actPlayerInfo.cpp so clang doesn't inline/dedupe them
-PlayerInfo::Info1::Info1() = default;
-PlayerInfo::Info1::~Info1() = default;
-PlayerInfo::Info2::Info2() = default;
-PlayerInfo::Info2::~Info2() = default;
-PlayerInfo::Info3::Info3() = default;
-PlayerInfo::Info3::~Info3() = default;
-PlayerInfo::Info4::Info4() = default;
-PlayerInfo::Info4::~Info4() = default;
-PlayerInfo::Info5::Info5() = default;
-PlayerInfo::Info5::~Info5() = default;
-PlayerInfo::Info6::Info6() = default;
-PlayerInfo::Info6::~Info6() = default;
-PlayerInfo::Info7::Info7() = default;
-PlayerInfo::Info7::~Info7() = default;
-
-} // namespace ksys::act
diff --git a/src/KingSystem/System/CMakeLists.txt b/src/KingSystem/System/CMakeLists.txt
index 933fd546..340ab774 100644
--- a/src/KingSystem/System/CMakeLists.txt
+++ b/src/KingSystem/System/CMakeLists.txt
@@ -16,6 +16,7 @@ target_sources(uking PRIVATE
DebugFinder.cpp
DebugFinder.h
DebugMessage.h
+ GameConfig.h
HavokWorkerMgr.cpp
HavokWorkerMgr.h
Hio.cpp
diff --git a/src/KingSystem/Framework/GameConfig.h b/src/KingSystem/System/GameConfig.h
index 1ab9f19a..0c57bbda 100644
--- a/src/KingSystem/Framework/GameConfig.h
+++ b/src/KingSystem/System/GameConfig.h
@@ -2,6 +2,8 @@
#include <prim/seadSafeString.h>
+namespace ksys {
+
class GameConfig {
public:
static GameConfig* getInstance() { return sInstancePtr; }
@@ -15,3 +17,5 @@ public:
private:
static GameConfig* sInstancePtr;
};
+
+} // namespace ksys
diff --git a/src/KingSystem/System/Patrol.cpp b/src/KingSystem/System/Patrol.cpp
index c7fc3be4..19afdecb 100644
--- a/src/KingSystem/System/Patrol.cpp
+++ b/src/KingSystem/System/Patrol.cpp
@@ -1,6 +1,6 @@
#include "KingSystem/System/Patrol.h"
#include <devenv/seadEnvUtil.h>
-#include "KingSystem/Framework/GameConfig.h"
+#include "KingSystem/System/GameConfig.h"
namespace ksys {
diff --git a/src/KingSystem/System/StarterPackMgr.h b/src/KingSystem/System/StarterPackMgr.h
index a0d1214d..a579ac6d 100644
--- a/src/KingSystem/System/StarterPackMgr.h
+++ b/src/KingSystem/System/StarterPackMgr.h
@@ -4,13 +4,13 @@
#include <heap/seadExpHeap.h>
#include <prim/seadSafeString.h>
#include "Game/DLC/aocManager.h"
-#include "KingSystem/Framework/GameConfig.h"
#include "KingSystem/Resource/resEntryFactory.h"
#include "KingSystem/Resource/resHandle.h"
#include "KingSystem/Resource/resLoadRequest.h"
#include "KingSystem/Resource/resResourceArchive.h"
#include "KingSystem/Resource/resResourceMgrTask.h"
#include "KingSystem/Resource/resSystem.h"
+#include "KingSystem/System/GameConfig.h"
#include "KingSystem/System/OverlayArena.h"
#include "KingSystem/Utils/Types.h"