This commit is contained in:
@@ -189,8 +189,4 @@ ox::Error setRomFs(Context &ctx, ox::UPtr<ox::FileSystem> &&fs) noexcept;
|
|||||||
|
|
||||||
ox::Result<ox::UPtr<ox::FileSystem>> loadRomFs(ox::StringViewCR path) noexcept;
|
ox::Result<ox::UPtr<ox::FileSystem>> loadRomFs(ox::StringViewCR path) noexcept;
|
||||||
|
|
||||||
ox::Result<char*> loadRom(ox::StringViewCR path = "") noexcept;
|
|
||||||
|
|
||||||
void unloadRom(char*) noexcept;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,9 +37,9 @@ class Module {
|
|||||||
virtual ox::Vector<PackTransform> packTransforms() const noexcept;
|
virtual ox::Vector<PackTransform> packTransforms() const noexcept;
|
||||||
};
|
};
|
||||||
|
|
||||||
void registerModule(Module const*mod) noexcept;
|
void registerModule(Module const *mod) noexcept;
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
ox::Vector<keel::Module const*> const &modules() noexcept;
|
ox::Vector<Module const*> const &modules() noexcept;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class Wrap {
|
|||||||
public:
|
public:
|
||||||
virtual ~Wrap() = default;
|
virtual ~Wrap() = default;
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
virtual ox::CStringView typeName() const noexcept = 0;
|
virtual ox::StringLiteral typeName() const noexcept = 0;
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
virtual int typeVersion() const noexcept = 0;
|
virtual int typeVersion() const noexcept = 0;
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
@@ -48,7 +48,7 @@ class WrapRef final: public WrapT<T> {
|
|||||||
constexpr explicit WrapRef(T &obj): m_obj{obj} {}
|
constexpr explicit WrapRef(T &obj): m_obj{obj} {}
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
ox::CStringView typeName() const noexcept override {
|
ox::StringLiteral typeName() const noexcept override {
|
||||||
return ox::ModelTypeName_v<T>;
|
return ox::ModelTypeName_v<T>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ class WrapInline final: public WrapT<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
ox::CStringView typeName() const noexcept override {
|
ox::StringLiteral typeName() const noexcept override {
|
||||||
return ox::ModelTypeName_v<T>;
|
return ox::ModelTypeName_v<T>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@ class BaseConverter {
|
|||||||
constexpr virtual ~BaseConverter() noexcept = default;
|
constexpr virtual ~BaseConverter() noexcept = default;
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
constexpr virtual ox::StringView srcTypeName() const noexcept = 0;
|
constexpr virtual ox::StringLiteral srcTypeName() const noexcept = 0;
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
constexpr virtual int srcTypeVersion() const noexcept = 0;
|
constexpr virtual int srcTypeVersion() const noexcept = 0;
|
||||||
@@ -154,7 +154,7 @@ class ConverterFunc final: public BaseConverter {
|
|||||||
using DstType = typename decltype(extractParams(Func))::Dst;
|
using DstType = typename decltype(extractParams(Func))::Dst;
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
constexpr ox::StringView srcTypeName() const noexcept override {
|
constexpr ox::StringLiteral srcTypeName() const noexcept override {
|
||||||
return ox::ModelTypeName_v<SrcType>;
|
return ox::ModelTypeName_v<SrcType>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,19 +253,22 @@ template<typename DstType>
|
|||||||
ox::Result<DstType> convertObjToObj(
|
ox::Result<DstType> convertObjToObj(
|
||||||
Context &ctx,
|
Context &ctx,
|
||||||
auto &src) noexcept {
|
auto &src) noexcept {
|
||||||
OX_REQUIRE_M(out, convert(ctx, WrapRef{src}, ox::ModelTypeName_v<DstType>, ox::ModelTypeVersion_v<DstType>));
|
OX_REQUIRE_M(out,
|
||||||
|
convert(ctx, WrapRef{src}, ox::ModelTypeName_v<DstType>, ox::ModelTypeVersion_v<DstType>));
|
||||||
return std::move(wrapCast(*out));
|
return std::move(wrapCast(*out));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename DstType>
|
template<typename DstType>
|
||||||
ox::Result<DstType> convert(Context &ctx, ox::BufferView const &src) noexcept {
|
ox::Result<DstType> convert(Context &ctx, ox::BufferView const &src) noexcept {
|
||||||
OX_REQUIRE(out, convert(ctx, src, ox::ModelTypeName_v<DstType>, ox::ModelTypeVersion_v<DstType>));
|
OX_REQUIRE(out,
|
||||||
|
convert(ctx, src, ox::ModelTypeName_v<DstType>, ox::ModelTypeVersion_v<DstType>));
|
||||||
return std::move(wrapCast<DstType>(*out));
|
return std::move(wrapCast<DstType>(*out));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename DstType>
|
template<typename DstType>
|
||||||
ox::Error convert(Context &ctx, ox::BufferView const &buff, DstType &outObj) noexcept {
|
ox::Error convert(Context &ctx, ox::BufferView const &buff, DstType &outObj) noexcept {
|
||||||
OX_REQUIRE(out, convert(ctx, buff, ox::ModelTypeName_v<DstType>, ox::ModelTypeVersion_v<DstType>));
|
OX_REQUIRE(out,
|
||||||
|
convert(ctx, buff, ox::ModelTypeName_v<DstType>, ox::ModelTypeVersion_v<DstType>));
|
||||||
outObj = std::move(wrapCast<DstType>(*out));
|
outObj = std::move(wrapCast<DstType>(*out));
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
@@ -280,7 +283,8 @@ ox::Error convertObjToObj(Context &ctx, auto &src, DstType &outObj) noexcept {
|
|||||||
template<typename DstType>
|
template<typename DstType>
|
||||||
ox::Result<ox::Buffer> convertBuffToBuff(
|
ox::Result<ox::Buffer> convertBuffToBuff(
|
||||||
Context &ctx, ox::BufferView const &src, ox::ClawFormat const fmt) noexcept {
|
Context &ctx, ox::BufferView const &src, ox::ClawFormat const fmt) noexcept {
|
||||||
OX_REQUIRE(out, convert(ctx, src, ox::ModelTypeName_v<DstType>, ox::ModelTypeVersion_v<DstType>));
|
OX_REQUIRE(out,
|
||||||
|
convert(ctx, src, ox::ModelTypeName_v<DstType>, ox::ModelTypeVersion_v<DstType>));
|
||||||
return ox::writeClaw<DstType>(wrapCast<DstType>(*out), fmt);
|
return ox::writeClaw<DstType>(wrapCast<DstType>(*out), fmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user