mirror of
https://github.com/zeldaret/botw
synced 2026-08-07 18:22:13 -04:00
ksys/world: Add Job class stubs
This commit is contained in:
@@ -1,4 +1,26 @@
|
||||
target_sources(uking PRIVATE
|
||||
worldChemicalMgr.cpp
|
||||
worldChemicalMgr.h
|
||||
worldCloudMgr.cpp
|
||||
worldCloudMgr.h
|
||||
worldDofMgr.cpp
|
||||
worldDofMgr.h
|
||||
worldJob.cpp
|
||||
worldJob.h
|
||||
worldManager.cpp
|
||||
worldManager.h
|
||||
worldShootingStarMgr.cpp
|
||||
worldShootingStarMgr.h
|
||||
worldShootingStarMgrEx.cpp
|
||||
worldShootingStarMgrEx.h
|
||||
worldSkyMgr.cpp
|
||||
worldSkyMgr.h
|
||||
worldTempMgr.cpp
|
||||
worldTempMgr.h
|
||||
worldTimeMgr.cpp
|
||||
worldTimeMgr.h
|
||||
worldWeatherMgr.cpp
|
||||
worldWeatherMgr.h
|
||||
worldWindMgr.cpp
|
||||
worldWindMgr.h
|
||||
)
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
#include "KingSystem/World/worldChemicalMgr.h"
|
||||
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include "KingSystem/Utils/Types.h"
|
||||
#include "KingSystem/World/worldJob.h"
|
||||
|
||||
namespace ksys::world {
|
||||
|
||||
// TODO
|
||||
class ChemicalMgr : public Job {
|
||||
public:
|
||||
ChemicalMgr();
|
||||
|
||||
JobType getType() const override { return JobType::Chemical; }
|
||||
|
||||
u8 _20[0xdc0 - 0x20];
|
||||
};
|
||||
KSYS_CHECK_SIZE_NX150(ChemicalMgr, 0xdc0);
|
||||
|
||||
} // namespace ksys::world
|
||||
@@ -0,0 +1 @@
|
||||
#include "KingSystem/World/worldCloudMgr.h"
|
||||
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include "KingSystem/Utils/Types.h"
|
||||
#include "KingSystem/World/worldJob.h"
|
||||
|
||||
namespace ksys::world {
|
||||
|
||||
// TODO
|
||||
class CloudMgr : public Job {
|
||||
public:
|
||||
CloudMgr();
|
||||
|
||||
JobType getType() const override { return JobType::Cloud; }
|
||||
|
||||
u8 _20[0x3fb8 - 0x20];
|
||||
};
|
||||
KSYS_CHECK_SIZE_NX150(CloudMgr, 0x3fb8);
|
||||
|
||||
} // namespace ksys::world
|
||||
@@ -0,0 +1 @@
|
||||
#include "KingSystem/World/worldDofMgr.h"
|
||||
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include "KingSystem/Utils/Types.h"
|
||||
#include "KingSystem/World/worldJob.h"
|
||||
|
||||
namespace ksys::world {
|
||||
|
||||
// TODO
|
||||
class DofMgr : public Job {
|
||||
public:
|
||||
DofMgr();
|
||||
|
||||
JobType getType() const override { return JobType::Dof; }
|
||||
|
||||
u8 _20[0x1c0 - 0x20];
|
||||
};
|
||||
KSYS_CHECK_SIZE_NX150(DofMgr, 0x1c0);
|
||||
|
||||
} // namespace ksys::world
|
||||
@@ -0,0 +1,30 @@
|
||||
#include "KingSystem/World/worldJob.h"
|
||||
#include "KingSystem/World/worldManager.h"
|
||||
|
||||
namespace ksys::world {
|
||||
|
||||
Job::Job() = default;
|
||||
|
||||
Job::~Job() = default;
|
||||
|
||||
void Job::init(sead::Heap* heap) {
|
||||
init_(heap);
|
||||
}
|
||||
|
||||
void Job::invoke() {
|
||||
switch (Manager::instance()->getCalcType()) {
|
||||
case CalcType::_0:
|
||||
calc_();
|
||||
break;
|
||||
case CalcType::_1:
|
||||
calcType1_();
|
||||
break;
|
||||
case CalcType::_2:
|
||||
calcType2_();
|
||||
break;
|
||||
case CalcType::Invalid:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace ksys::world
|
||||
@@ -0,0 +1,44 @@
|
||||
#pragma once
|
||||
|
||||
#include <hostio/seadHostIONode.h>
|
||||
#include <mc/seadJob.h>
|
||||
#include <prim/seadRuntimeTypeInfo.h>
|
||||
#include "KingSystem/Utils/Types.h"
|
||||
|
||||
namespace ksys::world {
|
||||
|
||||
enum class JobType {
|
||||
Time,
|
||||
Cloud,
|
||||
ShootingStar,
|
||||
Weather,
|
||||
Temp,
|
||||
Wind,
|
||||
Sky,
|
||||
Dof,
|
||||
Chemical,
|
||||
};
|
||||
constexpr int NumJobTypes = 9;
|
||||
|
||||
class Job : public sead::Job, public sead::hostio::Node {
|
||||
SEAD_RTTI_BASE(Job)
|
||||
public:
|
||||
Job();
|
||||
~Job() override;
|
||||
void invoke() override;
|
||||
void init(sead::Heap* heap);
|
||||
|
||||
protected:
|
||||
virtual void init_(sead::Heap* heap) {}
|
||||
virtual void calc_() {}
|
||||
virtual void calcType1_() {}
|
||||
virtual void calcType2_() {}
|
||||
virtual void m9() {}
|
||||
virtual void m10() {}
|
||||
virtual void m11() {}
|
||||
|
||||
virtual JobType getType() const = 0;
|
||||
};
|
||||
KSYS_CHECK_SIZE_NX150(Job, 0x20);
|
||||
|
||||
} // namespace ksys::world
|
||||
@@ -307,4 +307,58 @@ bool Manager::isForbidComeback(Climate climate) const {
|
||||
// NON_MATCHING: stores in a different order (handwritten assignments?) but should be equivalent
|
||||
Manager::Manager() = default;
|
||||
|
||||
static Job* makeJob(JobType type, sead::Heap* heap) {
|
||||
switch (type) {
|
||||
case JobType::Time:
|
||||
return new (heap) TimeMgr;
|
||||
case JobType::Cloud:
|
||||
return new (heap) CloudMgr;
|
||||
case JobType::ShootingStar:
|
||||
return new (heap) ShootingStarMgrEx;
|
||||
case JobType::Weather:
|
||||
return new (heap) WeatherMgr;
|
||||
case JobType::Temp:
|
||||
return new (heap) TempMgr;
|
||||
case JobType::Wind:
|
||||
return new (heap) WindMgr;
|
||||
case JobType::Sky:
|
||||
return new (heap) SkyMgr;
|
||||
case JobType::Dof:
|
||||
return new (heap) DofMgr;
|
||||
case JobType::Chemical:
|
||||
return new (heap) ChemicalMgr;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void Manager::init(sead::Heap* heap) {
|
||||
mMgrs.allocBuffer(NumJobTypes, heap);
|
||||
mAtomicPtrArray.allocBuffer(0x1000, heap);
|
||||
mAtomicPtrArray.clear();
|
||||
|
||||
mJobQueue.initialize(NumJobTypes, heap);
|
||||
mJobQueue.clear();
|
||||
|
||||
mWorldInfo.mClimates.allocBufferAssert(NumClimates, heap);
|
||||
|
||||
for (int i = 0; i < NumJobTypes; ++i) {
|
||||
auto* job = makeJob(JobType(i), heap);
|
||||
if (job) {
|
||||
job->init(heap);
|
||||
mMgrs.pushBack(job);
|
||||
}
|
||||
}
|
||||
|
||||
mWorldInfoLoadStatus = WorldInfoLoadStatus::NotLoaded;
|
||||
}
|
||||
|
||||
Manager::~Manager() {
|
||||
for (auto& mgr : mMgrs)
|
||||
delete &mgr;
|
||||
|
||||
mMgrs.freeBuffer();
|
||||
mAtomicPtrArray.freeBuffer();
|
||||
mWorldInfo.mClimates.freeBuffer();
|
||||
}
|
||||
|
||||
} // namespace ksys::world
|
||||
|
||||
@@ -12,11 +12,23 @@
|
||||
#include <prim/seadSizedEnum.h>
|
||||
#include "KingSystem/Resource/resHandle.h"
|
||||
#include "KingSystem/Utils/Types.h"
|
||||
#include "KingSystem/World/worldChemicalMgr.h"
|
||||
#include "KingSystem/World/worldCloudMgr.h"
|
||||
#include "KingSystem/World/worldDofMgr.h"
|
||||
#include "KingSystem/World/worldShootingStarMgrEx.h"
|
||||
#include "KingSystem/World/worldSkyMgr.h"
|
||||
#include "KingSystem/World/worldTempMgr.h"
|
||||
#include "KingSystem/World/worldTimeMgr.h"
|
||||
#include "KingSystem/World/worldWeatherMgr.h"
|
||||
#include "KingSystem/World/worldWindMgr.h"
|
||||
|
||||
namespace ksys::world {
|
||||
|
||||
enum class CalcType {
|
||||
_3 = 3,
|
||||
_0 = 0,
|
||||
_1 = 1,
|
||||
_2 = 2,
|
||||
Invalid = 3,
|
||||
};
|
||||
|
||||
enum class StageType {
|
||||
@@ -139,15 +151,6 @@ public:
|
||||
};
|
||||
KSYS_CHECK_SIZE_NX150(DungeonEnv, 0x338);
|
||||
|
||||
class TimeMgr;
|
||||
class CloudMgr;
|
||||
class ShootingStarMgr;
|
||||
class WeatherMgr;
|
||||
class TempMgr;
|
||||
class SkyMgr;
|
||||
class DofMgr;
|
||||
class ChemicalMgr;
|
||||
|
||||
// FIXME: incomplete
|
||||
class Manager : public sead::hostio::Node {
|
||||
SEAD_SINGLETON_DISPOSER(Manager)
|
||||
@@ -203,11 +206,14 @@ public:
|
||||
mScalingMode == ScalingMode::Disabled;
|
||||
}
|
||||
|
||||
CalcType getCalcType() const { return mCalcType; }
|
||||
|
||||
TimeMgr* getTimeMgr() const { return static_cast<TimeMgr*>(mMgrs[0]); }
|
||||
CloudMgr* getCloudMgr() const { return static_cast<CloudMgr*>(mMgrs[1]); }
|
||||
ShootingStarMgr* getShootingStarMgr() const { return static_cast<ShootingStarMgr*>(mMgrs[2]); }
|
||||
WeatherMgr* getWeatherMgr() const { return static_cast<WeatherMgr*>(mMgrs[3]); }
|
||||
TempMgr* getTempMgr() const { return static_cast<TempMgr*>(mMgrs[4]); }
|
||||
WindMgr* getWindMgr() const { return static_cast<WindMgr*>(mMgrs[5]); }
|
||||
SkyMgr* getSkyMgr() const { return static_cast<SkyMgr*>(mMgrs[6]); }
|
||||
DofMgr* getDofMgr() const { return static_cast<DofMgr*>(mMgrs[7]); }
|
||||
ChemicalMgr* getChemicalMgr() const { return static_cast<ChemicalMgr*>(mMgrs[8]); }
|
||||
@@ -227,10 +233,10 @@ private:
|
||||
DungeonEnv mDungeonEnv;
|
||||
sead::DirectResource* mInfoRes{};
|
||||
|
||||
sead::PtrArray<void> mMgrs;
|
||||
sead::PtrArray<Job> mMgrs;
|
||||
agl::utl::AtomicPtrArray<void*> mAtomicPtrArray;
|
||||
sead::BitFlag32 _5e0 = 1;
|
||||
CalcType mCalcType = CalcType::_3;
|
||||
CalcType mCalcType = CalcType::Invalid;
|
||||
sead::FixedSizeJQ mJobQueue;
|
||||
|
||||
sead::Vector3f mCameraPos{0, 0, 0};
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
#include "KingSystem/World/worldShootingStarMgr.h"
|
||||
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include "KingSystem/Utils/Types.h"
|
||||
#include "KingSystem/World/worldJob.h"
|
||||
|
||||
namespace ksys::world {
|
||||
|
||||
// TODO
|
||||
class ShootingStarMgr : public Job {
|
||||
public:
|
||||
ShootingStarMgr();
|
||||
|
||||
JobType getType() const override { return JobType::ShootingStar; }
|
||||
|
||||
u8 _20[0x30 - 0x20];
|
||||
};
|
||||
KSYS_CHECK_SIZE_NX150(ShootingStarMgr, 0x30);
|
||||
|
||||
} // namespace ksys::world
|
||||
@@ -0,0 +1 @@
|
||||
#include "KingSystem/World/worldShootingStarMgrEx.h"
|
||||
@@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include "KingSystem/Utils/Types.h"
|
||||
#include "KingSystem/World/worldShootingStarMgr.h"
|
||||
|
||||
namespace ksys::world {
|
||||
|
||||
// TODO
|
||||
class ShootingStarMgrEx : public ShootingStarMgr {
|
||||
public:
|
||||
ShootingStarMgrEx();
|
||||
|
||||
u8 _30[0x88 - 0x30];
|
||||
};
|
||||
KSYS_CHECK_SIZE_NX150(ShootingStarMgrEx, 0x88);
|
||||
|
||||
} // namespace ksys::world
|
||||
@@ -0,0 +1 @@
|
||||
#include "KingSystem/World/worldSkyMgr.h"
|
||||
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include "KingSystem/Utils/Types.h"
|
||||
#include "KingSystem/World/worldJob.h"
|
||||
|
||||
namespace ksys::world {
|
||||
|
||||
// TODO
|
||||
class SkyMgr : public Job {
|
||||
public:
|
||||
SkyMgr();
|
||||
|
||||
JobType getType() const override { return JobType::Sky; }
|
||||
|
||||
u8 _20[0x6b618 - 0x20];
|
||||
};
|
||||
KSYS_CHECK_SIZE_NX150(SkyMgr, 0x6b618);
|
||||
|
||||
} // namespace ksys::world
|
||||
@@ -0,0 +1 @@
|
||||
#include "KingSystem/World/worldTempMgr.h"
|
||||
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include "KingSystem/Utils/Types.h"
|
||||
#include "KingSystem/World/worldJob.h"
|
||||
|
||||
namespace ksys::world {
|
||||
|
||||
// TODO
|
||||
class TempMgr : public Job {
|
||||
public:
|
||||
TempMgr();
|
||||
|
||||
JobType getType() const override { return JobType::Temp; }
|
||||
|
||||
u8 _20[0x90 - 0x20];
|
||||
};
|
||||
KSYS_CHECK_SIZE_NX150(TempMgr, 0x90);
|
||||
|
||||
} // namespace ksys::world
|
||||
@@ -0,0 +1 @@
|
||||
#include "KingSystem/World/worldTimeMgr.h"
|
||||
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include "KingSystem/Utils/Types.h"
|
||||
#include "KingSystem/World/worldJob.h"
|
||||
|
||||
namespace ksys::world {
|
||||
|
||||
// TODO
|
||||
class TimeMgr : public Job {
|
||||
public:
|
||||
TimeMgr();
|
||||
|
||||
JobType getType() const override { return JobType::Time; }
|
||||
|
||||
u8 _20[0x158 - 0x20];
|
||||
};
|
||||
KSYS_CHECK_SIZE_NX150(TimeMgr, 0x158);
|
||||
|
||||
} // namespace ksys::world
|
||||
@@ -0,0 +1 @@
|
||||
#include "KingSystem/World/worldWeatherMgr.h"
|
||||
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include "KingSystem/Utils/Types.h"
|
||||
#include "KingSystem/World/worldJob.h"
|
||||
|
||||
namespace ksys::world {
|
||||
|
||||
// TODO
|
||||
class WeatherMgr : public Job {
|
||||
public:
|
||||
WeatherMgr();
|
||||
|
||||
JobType getType() const override { return JobType::Weather; }
|
||||
|
||||
u8 _20[0x398 - 0x20];
|
||||
};
|
||||
KSYS_CHECK_SIZE_NX150(WeatherMgr, 0x398);
|
||||
|
||||
} // namespace ksys::world
|
||||
@@ -0,0 +1 @@
|
||||
#include "KingSystem/World/worldWindMgr.h"
|
||||
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include "KingSystem/Utils/Types.h"
|
||||
#include "KingSystem/World/worldJob.h"
|
||||
|
||||
namespace ksys::world {
|
||||
|
||||
// TODO
|
||||
class WindMgr : public Job {
|
||||
public:
|
||||
WindMgr();
|
||||
|
||||
JobType getType() const override { return JobType::Wind; }
|
||||
|
||||
u8 _20[0x138 - 0x20];
|
||||
};
|
||||
KSYS_CHECK_SIZE_NX150(WindMgr, 0x138);
|
||||
|
||||
} // namespace ksys::world
|
||||
Reference in New Issue
Block a user