mirror of https://github.com/zeldaret/botw.git
Add initial PlacementMap functions
This commit is contained in:
parent
532e83a2fa
commit
7a3c0b261a
|
|
@ -73757,17 +73757,17 @@ Address,Quality,Size,Name
|
|||
0x0000007100d41f2c,U,001608,PlacementMap::loadDynamicMap
|
||||
0x0000007100d42574,U,000312,PlacementMap::parseDynamicMap
|
||||
0x0000007100d426ac,U,000096,PlacementMap::resetDynamic
|
||||
0x0000007100d4270c,U,000096,PlacementMap::unload
|
||||
0x0000007100d4270c,O,000096,_ZN4ksys3map12PlacementMap6unloadEv
|
||||
0x0000007100d4276c,U,000048,PlacementMap::unloadStaticMubin
|
||||
0x0000007100d4279c,U,000176,PlacementMap::x_6
|
||||
0x0000007100d4284c,U,000112,PlacementMap::x_5
|
||||
0x0000007100d428bc,U,002288,PlacementMap::traverseStuff
|
||||
0x0000007100d431ac,U,000212,PlacementMap::getFieldBodyGroup
|
||||
0x0000007100d431ac,O,000212,_ZN4ksys3map12PlacementMap17getFieldBodyGroupEi
|
||||
0x0000007100d43280,U,000588,PlacementMap::cleanupPhysics
|
||||
0x0000007100d434cc,U,000424,PlacementMap::loadStaticCompound
|
||||
0x0000007100d43674,U,000400,PlacementMap::x_2
|
||||
0x0000007100d43804,U,000552,PlacementMap::x
|
||||
0x0000007100d43a2c,U,000028,PlacementMap::unloadHksc
|
||||
0x0000007100d43a2c,O,000028,_ZN4ksys3map12PlacementMap10unloadHkscEi
|
||||
0x0000007100d43a48,U,000620,PlacementMap::x_4
|
||||
0x0000007100d43cb4,U,000172,PlacementMap::x_1
|
||||
0x0000007100d43d60,U,000248,PlacementMap::staticCompoundStuff
|
||||
|
|
@ -73777,7 +73777,7 @@ Address,Quality,Size,Name
|
|||
0x0000007100d44128,U,000560,PlacementMap::x_9
|
||||
0x0000007100d44358,U,003208,PlacementMapMgr::ctor
|
||||
0x0000007100d44fe0,U,000320,placement::getMubinPath
|
||||
0x0000007100d45120,U,000472,PlacementMap::x_7
|
||||
0x0000007100d45120,O,000472,_ZN4ksys3map12PlacementMap3x_7EiiaaRKN4sead14SafeStringBaseIcEES6_ib
|
||||
0x0000007100d452f8,U,000268,PlacementMapMgr::dtor
|
||||
0x0000007100d45404,U,000144,PlacementMapMgr::removeInnerData
|
||||
0x0000007100d45494,U,003388,PlacementMapMgr::initForestRendererFiles
|
||||
|
|
|
|||
|
Can't render this file because it is too large.
|
|
|
@ -5,6 +5,7 @@
|
|||
#include <prim/seadTypedBitFlag.h>
|
||||
#include <prim/seadTypedLongBitFlag.h>
|
||||
#include <thread/seadAtomic.h>
|
||||
#include <thread/seadReadWriteLock.h>
|
||||
#include "KingSystem/Utils/Types.h"
|
||||
|
||||
namespace ksys::map {
|
||||
|
|
@ -110,11 +111,13 @@ public:
|
|||
class PlacementActors {
|
||||
public:
|
||||
u32 getNumStaticObjs() const;
|
||||
map::Object* getStaticObj_2(s32 idx) const;
|
||||
Object* getStaticObj_2(s32 idx) const;
|
||||
bool sub_7100D524B4() const;
|
||||
void x_9();
|
||||
Object* resetGroup(int groupIdx);
|
||||
|
||||
u8 _0[0xe0 - 0x0];
|
||||
u8 _0[0x28 - 0x0];
|
||||
sead::ReadWriteLock mLock;
|
||||
PlacementStruct1* mStruct1;
|
||||
u8 _e8[0x538 - 0xe8];
|
||||
sead::SafeArray<ActorData, 6000> mActorData;
|
||||
|
|
|
|||
|
|
@ -1,14 +1,19 @@
|
|||
|
||||
#include "KingSystem/Map/mapPlacementMap.h"
|
||||
#include <prim/seadScopedLock.h>
|
||||
#include <thread/seadReadWriteLock.h>
|
||||
|
||||
namespace ksys::map {
|
||||
|
||||
PlacementMap::PlacementMap() {
|
||||
mInitStatus = InitStatus::None;
|
||||
mParsedNumStaticObjs = 0xFFFFFFFF;
|
||||
mStaticMapLoaded = StaticMap::None;
|
||||
mStaticMapLoaded = false;
|
||||
mStaticMapParsed = false;
|
||||
mNumStaticObjs = 0xFFFFFFFF;
|
||||
mMat = sead::Matrix34f::ident;
|
||||
mDistanceToCurrentMapUnit = 0;
|
||||
_0 = 0;
|
||||
mSkipLoadStaticMap = 0;
|
||||
_38c = 0xFFFFFFFF;
|
||||
mIdx = 0;
|
||||
|
|
@ -33,4 +38,45 @@ PlacementMap::~PlacementMap() {
|
|||
}
|
||||
}
|
||||
|
||||
void PlacementMap::unload() {
|
||||
sead::ReadWriteLock* lock = &mPa->mLock;
|
||||
lock->writeLock();
|
||||
mPa->resetGroup(mDynamicGroupIdx);
|
||||
mDynamicGroupIdx = 0xFFFFFFFF;
|
||||
lock->writeUnlock();
|
||||
|
||||
mCs.lock();
|
||||
mDynamicMubinRes.requestUnload();
|
||||
mCs.unlock();
|
||||
}
|
||||
|
||||
phys::BodyGroup* PlacementMap::getFieldBodyGroup(int field_group_idx) {
|
||||
const auto lock = sead::makeScopedLock(mCs);
|
||||
|
||||
auto* r = mRes[0].mRes.getResource();
|
||||
if (auto* sc = sead::DynamicCast<phys::StaticCompound>(r)) {
|
||||
if (field_group_idx < sc->getNumFieldBodyGroups()) {
|
||||
return sc->getFieldBodyGroup(field_group_idx);
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void PlacementMap::x_7(int idx, int unknown, s8 column, s8 row, const sead::SafeString& mubin_path,
|
||||
const sead::SafeString& folder_and_file, int map_id_maybe,
|
||||
bool skip_load_static_map) {
|
||||
_388 = unknown;
|
||||
mIdx = idx;
|
||||
mCol = column;
|
||||
mRow = row;
|
||||
mMubinPath.copy(mubin_path);
|
||||
mFolderAndFile.copy(folder_and_file);
|
||||
_38c = map_id_maybe; // Index in open world map
|
||||
mSkipLoadStaticMap = skip_load_static_map;
|
||||
}
|
||||
|
||||
void PlacementMap::unloadHksc(int hksc_idx) {
|
||||
mRes[hksc_idx].mRes.requestUnload();
|
||||
}
|
||||
|
||||
} // namespace ksys::map
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ class PlacementMap {
|
|||
};
|
||||
KSYS_CHECK_SIZE_NX150(HkscRes, 0x58);
|
||||
|
||||
enum class StaticMap : u16 { None = 0, Loaded = 1 << 0, Parsed = 1 << 8 };
|
||||
enum class InitStatus : int {
|
||||
None = 0,
|
||||
StaticLoaded = 1,
|
||||
|
|
@ -79,12 +78,12 @@ private:
|
|||
void x_5();
|
||||
int traverseStuff(sead::Vector3f* vec, PlacementActors* pa, int id);
|
||||
|
||||
phys::BodyGroup* getFieldBodyGroup(u32 field_body_group_index);
|
||||
phys::BodyGroup* getFieldBodyGroup(int field_body_group_index);
|
||||
void cleanupPhysics();
|
||||
bool loadStaticCompound(int index, bool is_auto_gen_mu, bool load_maybe);
|
||||
int x_2(int id);
|
||||
void x(int id, Object* obj);
|
||||
void unloadHksc(int id);
|
||||
void unloadHksc(int hksc_idx);
|
||||
int x_4(int id);
|
||||
int x_1(int id);
|
||||
bool staticCompoundStuff(int sc_id, bool cleanup);
|
||||
|
|
@ -93,11 +92,13 @@ private:
|
|||
void doDisableObjStaticCompound(Object* obj, bool disable);
|
||||
void x_9();
|
||||
|
||||
void x_7(int idx, int unknown, char column, char row, const sead::SafeString& mubinPath,
|
||||
const sead::SafeString& folderAndFile, int map_id_maybe, bool skip_load_static_map);
|
||||
void x_7(int idx, int unknown, s8 column, s8 row, const sead::SafeString& mubin_path,
|
||||
const sead::SafeString& folder_and_file, int map_id_maybe, bool skip_load_static_map);
|
||||
|
||||
u16 mSkipLoadStaticMap;
|
||||
StaticMap mStaticMapLoaded;
|
||||
u8 _0;
|
||||
u8 mSkipLoadStaticMap;
|
||||
bool mStaticMapLoaded;
|
||||
bool mStaticMapParsed;
|
||||
u16 _04;
|
||||
s16 _06;
|
||||
sead::FixedSafeString<128> mMubinPath;
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ public:
|
|||
|
||||
void cleanUp();
|
||||
bool calledFromMapDtor();
|
||||
int getNumFieldBodyGroups() const { return mFieldBodyGroups.size(); }
|
||||
|
||||
private:
|
||||
enum class Flag {
|
||||
|
|
|
|||
Loading…
Reference in New Issue