mirror of
https://github.com/zeldaret/tp
synced 2026-05-22 22:44:28 -04:00
convert daPasserMng_c::mGroupTbl underlying data from bytes to daPasserMng_c::Group (#3129)
* daPasserMng_c::mGroupTbl underlying data to daPasserMng_c::Group * move over to const groups * templated solution that works on modern compilers + mwcc --------- Co-authored-by: roeming <roeming@users.noreply.github.com>
This commit is contained in:
@@ -251,12 +251,13 @@ public:
|
||||
return paramLow << 8;
|
||||
}
|
||||
|
||||
// SizedGroup in d_a_passer_mng.cpp relies on this layout, any changes here should also be changed there
|
||||
struct Group {
|
||||
u8 field_0x00;
|
||||
int field_0x04[0];
|
||||
};
|
||||
|
||||
static Group* mGroupTbl[4];
|
||||
static const Group* mGroupTbl[4];
|
||||
|
||||
private:
|
||||
/* 0x568 */ fpc_ProcID* childProcIds;
|
||||
|
||||
@@ -38,33 +38,40 @@ int daPasserMng_c::execute() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
static u8 const groupA[32] = {
|
||||
0x07, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x04, 0x50, 0x00, 0x00, 0x06, 0x01, 0x00, 0x00, 0x07,
|
||||
0x01, 0x00, 0x00, 0x05, 0x01, 0x00, 0x00, 0x1B, 0x01, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x1D,
|
||||
// this is based off of daPasserMng_c::Group, any changes here should also be changed there
|
||||
template <int N>
|
||||
struct SizedGroup {
|
||||
u8 field_0x00;
|
||||
int field_0x04[N];
|
||||
};
|
||||
|
||||
static u8 const groupB[36] = {
|
||||
0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x11,
|
||||
0x11, 0x00, 0x00, 0x12, 0x10, 0x00, 0x00, 0x13, 0x40, 0x00, 0x00, 0x09,
|
||||
0x40, 0x00, 0x00, 0x08, 0x50, 0x00, 0x00, 0x0A, 0x01, 0x00, 0x00, 0x0B,
|
||||
static SizedGroup<7> const groupA = {
|
||||
7,
|
||||
{0x11000004, 0x50000006, 0x01000007, 0x01000005, 0x0100001B, 0x0100001C, 0x0000001D},
|
||||
};
|
||||
|
||||
static u8 const groupC[36] = {
|
||||
0x08, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x01,
|
||||
0x50, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x03, 0x21, 0x00, 0x00, 0x17,
|
||||
0x10, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x19, 0x10, 0x00, 0x00, 0x1A,
|
||||
static SizedGroup<8> const groupB = {
|
||||
8,
|
||||
{0x01000010, 0x10000011, 0x11000012, 0x10000013, 0x40000009, 0x40000008, 0x5000000A,
|
||||
0x0100000B},
|
||||
};
|
||||
|
||||
static u8 const groupD[32] = {
|
||||
0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x14, 0x21, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x16,
|
||||
0x11, 0x00, 0x00, 0x0C, 0x50, 0x00, 0x00, 0x0E, 0x40, 0x00, 0x00, 0x0F, 0x01, 0x00, 0x00, 0x0D,
|
||||
static SizedGroup<8> const groupC = {
|
||||
8,
|
||||
{0x11000000, 0x11000001, 0x50000002, 0x01000003, 0x21000017, 0x10000018, 0x01000019,
|
||||
0x1000001A},
|
||||
};
|
||||
|
||||
daPasserMng_c::Group* daPasserMng_c::mGroupTbl[4] = {
|
||||
(Group*)groupA,
|
||||
(Group*)groupB,
|
||||
(Group*)groupC,
|
||||
(Group*)groupD,
|
||||
static SizedGroup<7> const groupD = {
|
||||
7,
|
||||
{0x01000014, 0x21000015, 0x00000016, 0x1100000C, 0x5000000E, 0x4000000F, 0x0100000D},
|
||||
};
|
||||
|
||||
const daPasserMng_c::Group* daPasserMng_c::mGroupTbl[4] = {
|
||||
(const Group*)&groupA,
|
||||
(const Group*)&groupB,
|
||||
(const Group*)&groupC,
|
||||
(const Group*)&groupD,
|
||||
};
|
||||
|
||||
int daPasserMng_c::getPasserParam() {
|
||||
@@ -84,7 +91,7 @@ int daPasserMng_c::getPasserParam() {
|
||||
} else {
|
||||
groupInd = 0;
|
||||
}
|
||||
Group* pGroup = mGroupTbl[groupInd];
|
||||
const Group* pGroup = mGroupTbl[groupInd];
|
||||
int iVar5;
|
||||
do {
|
||||
iVar5 = cLib_getRndValue(0, (int)pGroup->field_0x00);
|
||||
|
||||
Reference in New Issue
Block a user