mirror of
https://github.com/zeldaret/botw
synced 2026-08-19 13:33:23 -04:00
ksys/res: Add GameData
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
target_sources(uking PRIVATE
|
||||
gdtFlag.cpp
|
||||
gdtFlag.h
|
||||
gdtManager.cpp
|
||||
gdtManager.h
|
||||
)
|
||||
|
||||
@@ -186,6 +186,7 @@ public:
|
||||
virtual bool setValue(T value);
|
||||
|
||||
virtual FlagDebugData* getDebugData() const;
|
||||
void setDebugData(FlagDebugData* data);
|
||||
|
||||
private:
|
||||
sead::SizedEnum<typename FlagType::ValueType, u8> mType = FlagType::Invalid;
|
||||
@@ -381,4 +382,9 @@ inline FlagDebugData* Flag<T>::getDebugData() const {
|
||||
return mDebugData;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void Flag<T>::setDebugData(FlagDebugData* data) {
|
||||
mDebugData = data;
|
||||
}
|
||||
|
||||
} // namespace ksys::gdt
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
#include "KingSystem/GameData/gdtManager.h"
|
||||
|
||||
namespace ksys::gdt {
|
||||
|
||||
SEAD_SINGLETON_DISPOSER_IMPL(Manager)
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
#pragma once
|
||||
|
||||
#include <container/seadSafeArray.h>
|
||||
#include <heap/seadDisposer.h>
|
||||
#include "KingSystem/Resource/resHandle.h"
|
||||
#include "KingSystem/Utils/Types.h"
|
||||
|
||||
namespace ksys::gdt {
|
||||
|
||||
class IManager {
|
||||
public:
|
||||
virtual ~IManager() = 0;
|
||||
};
|
||||
|
||||
inline IManager::~IManager() = default;
|
||||
|
||||
/// GameDataMgr communication.
|
||||
class ManagerCom {
|
||||
public:
|
||||
virtual const char* getName() const { return "GameData"; }
|
||||
virtual void syncData();
|
||||
|
||||
void* _8 = nullptr;
|
||||
void* _10 = nullptr;
|
||||
};
|
||||
KSYS_CHECK_SIZE_NX150(ManagerCom, 0x18);
|
||||
|
||||
// FIXME: very incomplete. This is only here because res::GameData needs to use the Manager's heaps
|
||||
class Manager : public IManager, public ManagerCom {
|
||||
SEAD_SINGLETON_DISPOSER(Manager)
|
||||
Manager();
|
||||
virtual ~Manager();
|
||||
|
||||
public:
|
||||
sead::Heap* getGameDataHeap() const { return mGameDataHeap; }
|
||||
sead::Heap* getSaveAreaHeap() const { return mSaveAreaHeap; }
|
||||
sead::Heap* getGameDataComHeap() const { return mGameDataComHeap; }
|
||||
|
||||
private:
|
||||
sead::Heap* mGameDataHeap = nullptr;
|
||||
sead::Heap* mSaveAreaHeap = nullptr;
|
||||
sead::Heap* mGameDataComHeap = nullptr;
|
||||
res::Handle mGameDataArcHandle;
|
||||
sead::SafeArray<res::Handle, 31> mBgdataHandles;
|
||||
};
|
||||
// FIXME: the size should be 0xDC8
|
||||
KSYS_CHECK_SIZE_NX150(Manager, 0xa58);
|
||||
|
||||
} // namespace ksys::gdt
|
||||
Reference in New Issue
Block a user