2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-14 04:46:09 +00:00

RE COutput/InputStream and friends and migrate over

This branch is probably still horribly broken, but it's a good first step to migrating away from having hecl embedded in the runtime
This commit is contained in:
2022-02-17 23:37:54 -08:00
parent c679c2e0f8
commit dad7249927
172 changed files with 3629 additions and 2780 deletions

View File

@@ -7,16 +7,21 @@
namespace metaforce {
static u32 ReadCount(CInputStream& in) {
u32 result = in.readUint32Big();
u32 result = in.ReadLong();
if (result == UINT32_MAX) {
return in.readUint32Big();
return in.ReadLong();
}
u8 junk[784];
for (u32 i = 0; i < (result * 3); ++i) {
u32 iVar2 = ((result * 3) - i);
iVar2 = 192 < iVar2 ? 192 : iVar2;
in.Get(junk, iVar2 * 4);
}
in.seek(s64(result) * 3);
return result;
}
CSkinRules::CSkinRules(CInputStream& in) {
u32 weightCount = in.readUint32Big();
u32 weightCount = in.ReadLong();
x0_bones.reserve(weightCount);
for (int i = 0; i < weightCount; ++i) {
x0_bones.emplace_back(in);
@@ -51,7 +56,7 @@ CFactoryFnReturn FSkinRulesFactory(const SObjectTag& tag, CInputStream& in, cons
auto StreamInSkinWeighting(CInputStream& in) {
rstl::reserved_vector<SSkinWeighting, 3> weights;
u32 weightCount = in.readUint32Big();
u32 weightCount = in.ReadLong();
for (int i = 0; i < std::min(3u, weightCount); ++i) {
weights.emplace_back(in);
}
@@ -62,5 +67,5 @@ auto StreamInSkinWeighting(CInputStream& in) {
}
CVirtualBone::CVirtualBone(CInputStream& in)
: x0_weights(StreamInSkinWeighting(in)), x1c_vertexCount(in.readUint32Big()) {}
: x0_weights(StreamInSkinWeighting(in)), x1c_vertexCount(in.ReadLong()) {}
} // namespace metaforce