From b7cd8bccd38e949df0dfcd2e47c1d6d9bd60a6b9 Mon Sep 17 00:00:00 2001 From: scawful Date: Sun, 14 Apr 2024 10:18:25 -0500 Subject: [PATCH] document gfx and lc_lz2 namespace --- src/app/gfx/bitmap.h | 5 +++++ src/app/gfx/compression.h | 27 ++++++++++++++++++--------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/app/gfx/bitmap.h b/src/app/gfx/bitmap.h index 844350bc..5e3ed075 100644 --- a/src/app/gfx/bitmap.h +++ b/src/app/gfx/bitmap.h @@ -15,6 +15,11 @@ namespace yaze { namespace app { + +/** + * @namespace yaze::app::gfx + * @brief Contains classes for handling graphical data. + */ namespace gfx { /** diff --git a/src/app/gfx/compression.h b/src/app/gfx/compression.h index 28e20d61..acca1572 100644 --- a/src/app/gfx/compression.h +++ b/src/app/gfx/compression.h @@ -15,6 +15,12 @@ namespace yaze { namespace app { namespace gfx { +/** + * @namespace yaze::app::gfx::lc_lz2 + * @brief Contains the LC_LZ2 compression algorithm. + */ +namespace lc_lz2 { + const int D_NINTENDO_C_MODE1 = 0; const int D_NINTENDO_C_MODE2 = 1; @@ -29,15 +35,6 @@ const int D_MAX_LENGTH = 1024; const int INITIAL_ALLOC_SIZE = 1024; -namespace lc_lz2 { - -absl::StatusOr ZS_Compress(const std::vector& data, - const int start, const int length, - int mode = 1, bool check = false); - -absl::StatusOr ZS_CompressOverworld(const std::vector data, - const int pos, const int length); - constexpr int kCommandDirectCopy = 0; constexpr int kCommandByteFill = 1; constexpr int kCommandWordFill = 2; @@ -141,6 +138,10 @@ void CompressionCommandAlternativeV2(const uchar* data, uint& src_pos, uint& comp_accumulator, uint& cmd_with_max, uint& max_win); +/** + * @brief Compresses a buffer of data using the LC_LZ2 algorithm. + * \deprecated Use Compress and Uncompress instead. + */ absl::StatusOr CompressV2(const uchar* data, const int start, const int length, int mode = 1, bool check = false); @@ -208,6 +209,10 @@ absl::StatusOr SplitCompressionPieceV3( CompressionPiece& piece, int mode); void FinalizeCompression(CompressionContext& context); +/** + * @brief Compresses a buffer of data using the LC_LZ2 algorithm. + * \deprecated Use Compress and Uncompress instead. + */ absl::StatusOr CompressV3(const std::vector& data, const int start, const int length, int mode = 1, bool check = false); @@ -227,6 +232,10 @@ std::string SetBuffer(const uchar* data, int src_pos, int comp_accumulator); void memfill(const uchar* data, Bytes& buffer, int buffer_pos, int offset, int length); +/** + * @brief Decompresses a buffer of data using the LC_LZ2 algorithm. + * \deprecated Use Compress and Uncompress instead. + */ absl::StatusOr DecompressV2(const uchar* data, int offset, int size = 0x800, int mode = 1); absl::StatusOr DecompressGraphics(const uchar* data, int pos, int size);