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

Merge branch 'dawn' into new-cmodel

# Conflicts:
#	Runtime/Streams/ContainerReaders.hpp
This commit is contained in:
2022-03-01 01:37:08 -05:00
28 changed files with 473 additions and 250 deletions

View File

@@ -1,7 +1,8 @@
#pragma once
#include "Runtime/Streams/CInputStream.hpp"
#include "Runtime/rstl.hpp"
#include <vector>
namespace metaforce {
template <class T, size_t N>
void read_reserved_vector(rstl::reserved_vector<T, N>& v, CInputStream& in) {
@@ -11,4 +12,13 @@ void read_reserved_vector(rstl::reserved_vector<T, N>& v, CInputStream& in) {
v[i] = in.Get<T>();
}
}
template <class T>
void read_vector(std::vector<T>& v, CInputStream& in) {
u32 count = in.ReadLong();
v.reserve(count);
for (u32 i = 0; i < count; ++i) {
v.emplace_back(in.Get<T>());
}
}
} // namespace metaforce