1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
#pragma once
#include <basis/seadTypes.h>
#include <container/seadBuffer.h>
#include <container/seadPtrArray.h>
#include <container/seadSafeArray.h>
#include <heap/seadHeap.h>
#include <math/seadMatrix.h>
#include <prim/seadSafeString.h>
#include "KingSystem/Map/mapPlacementActors.h"
#include "KingSystem/Map/mapPlacementMapMgr.h"
#include "KingSystem/Resource/resHandle.h"
#include "KingSystem/Resource/resResource.h"
#include "KingSystem/System/Patrol.h"
#include "KingSystem/Utils/Types.h"
namespace ksys::phys {
class StaticCompound;
class StaticCompoundRigidBodyGroup;
} // namespace ksys::phys
namespace ksys::map {
class Object;
class PlacementMapMgr;
class PlacementActors;
class PlacementMap {
struct HkscRes {
public:
enum class Status : int {
_0 = 0,
_1 = 1,
_2 = 2, // Call cleanupHkscMaybe(), if ok, set to 3
_3 = 3,
_4 = 4, // Call staticCompoundStuff, if ok, set to 5
_5 = 5,
};
HkscRes() = default;
~HkscRes() = default;
void cleanup();
res::Handle mRes;
Status mStatus;
};
KSYS_CHECK_SIZE_NX150(HkscRes, 0x58);
enum class InitStatus : int {
None = 0,
StaticLoaded = 1,
DynamicLoadStarted = 2,
DynamicLoaded = 3,
_4 = 4,
_5 = 5, // x_9 takes initStatus from 4 to 5 in pmm->updateHkscLoadStatuesMaybe()
};
KSYS_CHECK_SIZE_NX150(InitStatus, 4);
// Rename when better information is available
enum class MapObjStatus : int {
Loading = 0,
Ready = 1,
NotReady = 2,
};
public:
PlacementMap();
~PlacementMap();
private:
bool loadStaticMap_(bool load);
void doLoadStaticMap_(bool load);
bool parseStaticMap_(sead::Heap* heap, u8* data);
void parseMap_(sead::Heap* heap, u8* data, int group, u32 idx);
bool loadDynamicMap();
MapObjStatus parseDynamicMap();
void resetDynamic();
void unload();
void unloadStaticMubin();
bool x_6();
void x_5();
int traverseStuff(sead::Vector3f* vec, PlacementActors* pa, int id);
phys::StaticCompoundRigidBodyGroup* getFieldBodyGroup(int field_group_idx);
void cleanupPhysics();
bool loadStaticCompound(int hksc_idx, bool is_auto_gen_mu, bool req_arg_8);
MapObjStatus x_2(int hksc_idx);
void updateObjectCollisionAndId(int id, Object* obj);
void unloadHksc(int hksc_idx);
bool clearStaticCompoundActorId(int id);
int x_1(int id);
bool staticCompoundStuff(int sc_id, bool cleanup);
int doSomethingStaticCompound(int hksc_idx);
bool isDynamicLoaded(const sead::Vector3f& pos);
void setStaticCompoundInstanceEnabled(Object* obj, bool enabled);
void x_9();
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);
int getStaticCompoundIdFromPosition(const sead::Vector3f& pos) const;
int getStaticCompoundIdFromPosition(float x, float z) const;
int getStaticCompoundIdFromPosition(const Object& object) const;
u8 _0;
u8 mSkipLoadStaticMap;
bool mStaticMapLoaded;
bool mStaticMapParsed;
u16 _04;
s16 _06;
sead::FixedSafeString<128> mMubinPath;
sead::FixedSafeString<128> mFolderAndFile;
u32 mIdx;
sead::SafeArray<HkscRes, 4> mRes;
res::Handle mStaticMubinRes;
res::Handle mDynamicMubinRes;
int mDynamicGroupIdx;
int mParsedNumStaticObjs;
int mNumStaticObjs;
InitStatus mInitStatus;
s8 mCol;
s8 mRow;
u16 _352;
sead::Matrix34f mMat;
int mDistanceToCurrentMapUnit;
u32 _388; // 388 check x_7() called ....
u32 _38c; // 38c ... from MapMgr::ctor (a8)
PlacementActors* mPa;
PlacementMapMgr* mMgr;
void* mP18;
sead::Buffer<void*> mRoutes;
int mNumRoutes;
int gap_38c;
sead::CriticalSection mCs;
};
KSYS_CHECK_SIZE_NX150(PlacementMap, 0x400);
} // namespace ksys::map
|