This commit is contained in:
parent
ce1eea817d
commit
b97d7d9956
6
deps/ox/src/ox/preloader/preloader.hpp
vendored
6
deps/ox/src/ox/preloader/preloader.hpp
vendored
@ -174,26 +174,20 @@ constexpr ox::Error Preloader<PlatSpec>::field(CRStringView name, const T *val)
|
||||
}
|
||||
oxReturnError(pad(val));
|
||||
if constexpr(ox::is_integral_v<T>) {
|
||||
//oxDebug(" integral");
|
||||
//oxDebugf("Preloader::field(name, val): {}", name);
|
||||
return ox::serialize(&m_writer, PlatSpec::correctEndianness(*val));
|
||||
} else if constexpr(ox::is_pointer_v<T>) {
|
||||
//oxDebug(" pointer");
|
||||
const PtrType a = startAlloc(sizeOf<PlatSpec>(val), alignOf<PlatSpec>(*val), m_writer.tellp()) + PlatSpec::RomStart;
|
||||
oxReturnError(field(name, *val));
|
||||
oxReturnError(endAlloc());
|
||||
return ox::serialize(&m_writer, PlatSpec::correctEndianness(a));
|
||||
} else if constexpr(ox::isVector_v<T>) {
|
||||
//oxDebug(" vector");
|
||||
return fieldVector(name, val);
|
||||
} else if constexpr(ox::is_same_v<T, ox::ModelValueVector>) {
|
||||
val->types();
|
||||
//oxDebug(" vector");
|
||||
return fieldVector(name, val);
|
||||
} else if constexpr(ox::is_same_v<T, ox::ModelValueArray>) {
|
||||
return fieldArray(name, val);
|
||||
} else {
|
||||
//oxDebug(" object");
|
||||
m_unionIdx.emplace_back(-1);
|
||||
const auto out = preload<PlatSpec, T>(this, val);
|
||||
m_unionIdx.pop_back();
|
||||
|
Loading…
Reference in New Issue
Block a user