2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-14 02:06: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

21
Runtime/CStringExtras.cpp Normal file
View File

@@ -0,0 +1,21 @@
#include "Runtime/CStringExtras.hpp"
#include "Runtime/CInputStream.hpp"
namespace metaforce {
std::string CStringExtras::ReadString(CInputStream& in) {
u32 strLen = in.ReadLong();
std::string ret;
u32 readLen = 512;
char tmp[512] = {};
for (; strLen > 0; strLen -= readLen) {
readLen = 512;
if (strLen <= 512) {
readLen = strLen;
}
in.ReadBytes(tmp, readLen);
ret.append(tmp, readLen);
}
return ret;
}
}