Skip to content

Commit

Permalink
chore(*): general code improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
lmichaelis committed Jan 21, 2024
1 parent 0388a4e commit 3c90a21
Show file tree
Hide file tree
Showing 76 changed files with 581 additions and 698 deletions.
21 changes: 9 additions & 12 deletions include/phoenix/model_script.hh
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@

namespace phoenix {
namespace mds {
ZKREM("use zenkit::AnimationFlags::NONE") static constexpr auto const af_none = zenkit::AnimationFlags::NONE;
ZKREM("use zenkit::AnimationFlags::MOVE") static constexpr auto const af_move = zenkit::AnimationFlags::MOVE;
ZKREM("use zenkit::AnimationFlags::ROTATE")
static constexpr auto const af_rotate = zenkit::AnimationFlags::ROTATE;
ZKREM("use zenkit::AnimationFlags::QUEUE") static constexpr auto const af_queue = zenkit::AnimationFlags::QUEUE;
ZKREM("use zenkit::AnimationFlags::FLY") static constexpr auto const af_fly = zenkit::AnimationFlags::FLY;
ZKREM("use zenkit::AnimationFlags::IDLE") static constexpr auto const af_idle = zenkit::AnimationFlags::IDLE;
ZKREM("use zenkit::AnimationFlags::INPLACE")
static constexpr auto const af_inplace = zenkit::AnimationFlags::INPLACE;
ZKREM("use zenkit::AnimationFlags::NONE") static constexpr auto af_none = zenkit::AnimationFlags::NONE;
ZKREM("use zenkit::AnimationFlags::MOVE") static constexpr auto af_move = zenkit::AnimationFlags::MOVE;
ZKREM("use zenkit::AnimationFlags::ROTATE") static constexpr auto af_rotate = zenkit::AnimationFlags::ROTATE;
ZKREM("use zenkit::AnimationFlags::QUEUE") static constexpr auto af_queue = zenkit::AnimationFlags::QUEUE;
ZKREM("use zenkit::AnimationFlags::FLY") static constexpr auto af_fly = zenkit::AnimationFlags::FLY;
ZKREM("use zenkit::AnimationFlags::IDLE") static constexpr auto af_idle = zenkit::AnimationFlags::IDLE;
ZKREM("use zenkit::AnimationFlags::INPLACE") static constexpr auto af_inplace = zenkit::AnimationFlags::INPLACE;

using animation_direction ZKREM("renamed to zenkit::AnimationDirection") = zenkit::AnimationDirection;
using animation_flags ZKREM("use zenkit::AnimationFlags instead") = zenkit::AnimationFlags;
Expand All @@ -35,9 +33,8 @@ namespace phoenix {
using animation_combination ZKREM("renamed to zenkit::MdsAnimationCombine") = zenkit::MdsAnimationCombine;
} // namespace mds

struct script_sytax_error : public zenkit::ParserError {
public:
ZKINT inline script_sytax_error(std::string&&, std::string&&) : zenkit::ParserError("") {}
struct script_sytax_error final : zenkit::ParserError {
ZKINT script_sytax_error(std::string&&, std::string&&) : ParserError("") {}
};

using model_script ZKREM("renamed to zenkit::ModelScript") = zenkit::ModelScript;
Expand Down
5 changes: 2 additions & 3 deletions include/zenkit/Archive.hh
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ namespace zenkit {
/// \brief Skips the next entry in the reader.
virtual void skip_entry() = 0;

protected:
ArchiveHeader header;
Read* read;

Expand All @@ -289,8 +288,8 @@ namespace zenkit {
static std::unique_ptr<WriteArchive> to(Write* w, ArchiveFormat format);
static std::unique_ptr<WriteArchive> to_save(Write* w, ArchiveFormat format);

void write_object(std::shared_ptr<Object> obj, GameVersion version);
void write_object(std::string_view name, std::shared_ptr<Object> obj, GameVersion version);
void write_object(std::shared_ptr<Object> const& obj, GameVersion version);
void write_object(std::string_view name, std::shared_ptr<Object> const& obj, GameVersion version);
void write_object(std::string_view name, Object const* obj, GameVersion version);
virtual std::uint32_t
write_object_begin(std::string_view object_name, std::string_view class_name, std::uint16_t version) = 0;
Expand Down
5 changes: 2 additions & 3 deletions include/zenkit/CutsceneLibrary.hh
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ namespace zenkit {
/// using buffer::duplicate.
/// \throws zenkit::ParserError if parsing fails.
/// \see #parse(buffer&&)
[[nodiscard]] ZKREM("use ::load()") ZKAPI static CutsceneLibrary parse(phoenix::buffer& path);
[[nodiscard]] ZKREM("use ::load()") ZKAPI static CutsceneLibrary parse(phoenix::buffer& buf);

/// \brief Parses a message database from the data in the given buffer.
/// \param[in] buf The buffer to read from (by rvalue-reference).
/// \return The parsed message database object.
/// \throws zenkit::ParserError if parsing fails.
/// \see #parse(buffer&)
[[nodiscard]] ZKREM("use ::load()") ZKAPI static CutsceneLibrary parse(phoenix::buffer&& path);
[[nodiscard]] ZKREM("use ::load()") ZKAPI static CutsceneLibrary parse(phoenix::buffer&& buf);

/// \brief Retrieves a message block by it's name.
/// \param name The name of the block to get
Expand All @@ -78,7 +78,6 @@ namespace zenkit {
ZKAPI void load(Read* r);
ZKAPI void save(Write* r, ArchiveFormat fmt) const;

public:
/// \brief A list of all message blocks in the database.
std::vector<CutsceneBlock> blocks {};
};
Expand Down
Loading

0 comments on commit 3c90a21

Please sign in to comment.