[ox] GBA fixes
This commit is contained in:
parent
535480ef26
commit
b1b2780eb9
2
deps/ox/src/ox/claw/test/tests.cpp
vendored
2
deps/ox/src/ox/claw/test/tests.cpp
vendored
@ -8,7 +8,7 @@
|
||||
|
||||
#undef NDEBUG
|
||||
|
||||
#include <assert.h>
|
||||
#include <cassert>
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
|
7
deps/ox/src/ox/claw/write.hpp
vendored
7
deps/ox/src/ox/claw/write.hpp
vendored
@ -93,7 +93,14 @@ Result<String> writeClawHeader(T *t, ClawFormat fmt) noexcept {
|
||||
|
||||
Result<Buffer> writeClaw(auto *t, ClawFormat fmt = ClawFormat::Metal) {
|
||||
oxRequire(header, detail::writeClawHeader(t, fmt));
|
||||
#ifdef OX_USE_STDLIB
|
||||
oxRequire(data, fmt == ClawFormat::Metal ? writeMC(t) : writeOC(t));
|
||||
#else
|
||||
if (fmt != ClawFormat::Metal) {
|
||||
return OxError(1, "OC is not supported in this build");
|
||||
}
|
||||
oxRequire(data, writeMC(t));
|
||||
#endif
|
||||
Buffer out(header.len() + data.size());
|
||||
memcpy(out.data(), header.data(), header.len());
|
||||
memcpy(out.data() + header.len(), data.data(), data.size());
|
||||
|
2
deps/ox/src/ox/mc/write.hpp
vendored
2
deps/ox/src/ox/mc/write.hpp
vendored
@ -342,7 +342,7 @@ constexpr Error MetalClawWriter::field(const char*, T *val, std::size_t len) noe
|
||||
|
||||
MetalClawWriter writer(m_buff + m_buffIt, m_buffLen - m_buffIt);
|
||||
ModelHandlerInterface handler{&writer};
|
||||
handler.setTypeInfo<T>("List", 0, {}, len);
|
||||
handler.setTypeInfo<T>("List", 0, {}, static_cast<int>(len));
|
||||
|
||||
// write the array
|
||||
for (std::size_t i = 0; i < len; i++) {
|
||||
|
8
deps/ox/src/ox/model/desctypes.hpp
vendored
8
deps/ox/src/ox/model/desctypes.hpp
vendored
@ -19,6 +19,7 @@
|
||||
|
||||
#include "optype.hpp"
|
||||
#include "types.hpp"
|
||||
#include "typenamecatcher.hpp"
|
||||
|
||||
namespace ox {
|
||||
|
||||
@ -26,6 +27,13 @@ using FieldName = String;
|
||||
|
||||
using TypeParamPack = Vector<String>;
|
||||
|
||||
template<typename T>
|
||||
constexpr auto buildTypeId() noexcept {
|
||||
constexpr auto name = requireModelTypeName<T>();
|
||||
constexpr auto version = requireModelTypeVersion<T>();
|
||||
return ox::sfmt("{};{}", name, version);
|
||||
}
|
||||
|
||||
static constexpr auto buildTypeId(CRStringView name, int version,
|
||||
const TypeParamPack &typeParams = {}) noexcept {
|
||||
String tp;
|
||||
|
Loading…
Reference in New Issue
Block a user