Add LZ11 Decompression

- Add getetrs for bclim
- Correctly load all bclim data
- Fix RGB565ToRGBA converter to support all sizes possible
This commit is contained in:
2026-01-03 01:54:30 +01:00
parent 866acf32e0
commit e4fa2202d2
6 changed files with 69 additions and 12 deletions

View File

@@ -22,7 +22,7 @@ class CTRFF_API _3dsx : public BinFile {
void Write(std::fstream& f) const override;
void Read(std::fstream& f) override;
ctrff::u32 Magic;
ctrff::u32 Magic; // 0x58534433 "3DSX"
ctrff::u16 HeaderSize;
ctrff::u16 RelocHeaderSize;
ctrff::u32 FormatVersion;

View File

@@ -81,6 +81,11 @@ class CTRFF_API BCLIM : public BinFile {
void CreateByImage(const std::vector<u8>& data, int w, int h, Format fmt);
Format GetFmt() const { return (Format)pImag.Format; }
std::vector<u8> GetImage() { return pBuffer; }
int GetWidth() const { return pImag.Width; }
int GetHeight() const { return pImag.Height; }
/** Write not supported btw */
void Write(std::fstream& f) const override;
void Read(std::fstream& f) override;

View File

@@ -5,5 +5,6 @@
namespace ctrff {
namespace LZ11 {
CTRFF_API std::vector<ctrff::u8> Compress(const std::vector<ctrff::u8>& in);
}
CTRFF_API std::vector<ctrff::u8> Decompress(const std::vector<ctrff::u8>& in);
} // namespace LZ11
} // namespace ctrff