diff --git a/include/zenkit/Model.hh b/include/zenkit/Model.hh index 72ccd6ec..b4dea768 100644 --- a/include/zenkit/Model.hh +++ b/include/zenkit/Model.hh @@ -36,6 +36,7 @@ namespace zenkit { [[nodiscard]] ZKREM("use ::load()") ZKAPI static Model parse(phoenix::buffer&& buf); ZKAPI void load(Read* r); + ZKAPI void save(Write* w, GameVersion version) const; public: /// \brief The zenkit::ModelHierarchy associated with this model. diff --git a/src/Model.cc b/src/Model.cc index 14ac47ec..83b0e169 100644 --- a/src/Model.cc +++ b/src/Model.cc @@ -18,7 +18,12 @@ namespace zenkit { this->mesh.load(r); } + void Model::save(Write* w, GameVersion version) const { + this->hierarchy.save(w); + this->mesh.save(w, version); + } + Model Model::parse(phoenix::buffer&& buf) { - return Model::parse(buf); + return parse(buf); } } // namespace zenkit