socket connection direction wip

This commit is contained in:
Asuro
2025-05-16 01:50:19 +02:00
parent 79fe91981b
commit 5cdc7d720e
4 changed files with 31 additions and 10 deletions

View File

@@ -1281,6 +1281,7 @@ namespace Gen
for (uint32_t i = 0; i < count; ++i)
{
isOk = Save(&obj[i].Model, 1, serializer) && isOk;
isOk = Save(&obj[i].ConnectionDirection, 1, serializer) && isOk;
}
return isOk;
}
@@ -1298,6 +1299,7 @@ namespace Gen
for (uint32_t i = 0; i < count; ++i)
{
isOk = Load(&obj[i].Model, 1, serializer) && isOk;
isOk = Load(&obj[i].ConnectionDirection, 1, serializer) && isOk;
}
// if we're not ok here, something went really wrong
assert(isOk);
@@ -1329,6 +1331,10 @@ namespace Gen
{
WriteDestinations[i] = offsetof(CardSocket, Model);
}
if (bx::strCmp(memberName, "ConnectionDirection") == 0 && bx::strCmp(memberTypeName, "uint8_t") == 0)
{
WriteDestinations[i] = offsetof(CardSocket, ConnectionDirection);
}
}
// Start reading in file order, skipping things that we don't know by name and type
@@ -1355,6 +1361,12 @@ namespace Gen
isOk = Load(fieldPtr, 1, serializer) && isOk;
continue;
}
if (bx::strCmp(memberName, "ConnectionDirection") == 0)
{
auto* fieldPtr = reinterpret_cast<uint8_t*>(objBasePtr + WriteDestinations[j]);
isOk = Load(fieldPtr, 1, serializer) && isOk;
continue;
}
assert(false);
}
}