mirror of https://github.com/zeldaret/botw.git
ksys: Add CoreInfo to avoid hardcoding number of cores everywhere
This commit is contained in:
parent
eca99d22f2
commit
f802ee16c9
|
@ -12,6 +12,7 @@
|
|||
#include "KingSystem/GameData/gdtFlagHandle.h"
|
||||
#include "KingSystem/GameData/gdtTriggerParam.h"
|
||||
#include "KingSystem/Resource/resHandle.h"
|
||||
#include "KingSystem/System/CoreInfo.h"
|
||||
#include "KingSystem/System/KingEditor.h"
|
||||
#include "KingSystem/Utils/Byaml/Byaml.h"
|
||||
#include "KingSystem/Utils/Types.h"
|
||||
|
@ -565,7 +566,7 @@ private:
|
|||
void addRecord(s32 value, const sead::SafeString& name, s32 sub_idx, bool debug);
|
||||
|
||||
u64 _0 = 0;
|
||||
sead::SafeArray<sead::FixedRingBuffer<Record, 64>, 3> ring_buffers[2];
|
||||
sead::SafeArray<sead::FixedRingBuffer<Record, 64>, NumCores> ring_buffers[2];
|
||||
sead::SafeArray<Record, 0xc0> arrays[2]{};
|
||||
};
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <prim/seadBitFlag.h>
|
||||
#include <prim/seadTypedBitFlag.h>
|
||||
#include "KingSystem/GameData/gdtFlag.h"
|
||||
#include "KingSystem/System/CoreInfo.h"
|
||||
#include "KingSystem/Utils/Types.h"
|
||||
|
||||
namespace ksys::res {
|
||||
|
@ -503,7 +504,7 @@ private:
|
|||
sead::PtrArray<sead::PtrArray<FlagBase>> mVector3fArrayFlags;
|
||||
sead::PtrArray<sead::PtrArray<FlagBase>> mVector4fArrayFlags;
|
||||
|
||||
sead::SafeArray<sead::Buffer<FlagChangeRecord>, 3> mFlagChangeRecords;
|
||||
sead::SafeArray<sead::Buffer<FlagChangeRecord>, NumCores> mFlagChangeRecords;
|
||||
|
||||
sead::ObjArray<FlagCopyRecord> mCopiedBoolFlags;
|
||||
sead::ObjArray<FlagCopyRecord> mCopiedS32Flags;
|
||||
|
@ -520,10 +521,10 @@ private:
|
|||
|
||||
sead::Heap* mHeap = nullptr;
|
||||
|
||||
std::array<s32, 3> mFlagChangeRecordIndices;
|
||||
std::array<s32, NumCores> mFlagChangeRecordIndices;
|
||||
sead::SafeArray<s32, 15> mNumBoolFlagsPerCategory0;
|
||||
sead::SafeArray<s32, 15> mNumBoolFlagsPerCategory;
|
||||
sead::SafeArray<sead::CriticalSection, 3> mCriticalSections;
|
||||
sead::SafeArray<sead::CriticalSection, NumCores> mCriticalSections;
|
||||
sead::TypedBitFlag<BitFlag> mBitFlags;
|
||||
};
|
||||
KSYS_CHECK_SIZE_NX150(TriggerParam, 0x3f0);
|
||||
|
|
|
@ -9,6 +9,7 @@ target_sources(uking PRIVATE
|
|||
CameraEditor.h
|
||||
CameraMgr.cpp
|
||||
CameraMgr.h
|
||||
CoreInfo.h
|
||||
DebugFinder.cpp
|
||||
DebugFinder.h
|
||||
DebugMessage.h
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
namespace ksys {
|
||||
|
||||
// Must be a compile-time constant because this value is used as an array size in various places.
|
||||
// This limitation is why we cannot just use sead::CoreInfo::getNumCores() everywhere.
|
||||
constexpr int NumCores = 3;
|
||||
|
||||
} // namespace ksys
|
|
@ -8,6 +8,7 @@
|
|||
#include <math/seadMathCalcCommon.h>
|
||||
#include <mc/seadCoreInfo.h>
|
||||
#include <prim/seadBitFlag.h>
|
||||
#include "KingSystem/System/CoreInfo.h"
|
||||
#include "KingSystem/Utils/Types.h"
|
||||
|
||||
namespace ksys {
|
||||
|
@ -149,8 +150,6 @@ private:
|
|||
f32 mIntervalRatioA = 1.0;
|
||||
f32 mIntervalRatioB = 1.0;
|
||||
|
||||
static constexpr int NumCores = 3;
|
||||
|
||||
sead::SafeArray<u32*, NumCores> mIntervals;
|
||||
sead::SafeArray<f32*, NumCores> mIntervalRatios;
|
||||
|
||||
|
|
Loading…
Reference in New Issue