Initial Vectorail GC format library

This commit is contained in:
2026-08-02 17:05:27 +02:00
commit 8c4e1bcacb
28 changed files with 3426 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
#pragma once
#include <cstddef>
#include <cstdint>
#include <string>
#include <vector>
namespace gc {
struct MtxTexture {
uint32_t offset = 0;
uint32_t size = 0;
uint32_t width = 0;
uint32_t height = 0;
uint32_t bitsPerPixel = 0;
uint32_t fourCC = 0;
};
struct MtxArchive {
std::vector<MtxTexture> textures;
};
bool ParseMtxArchive(const std::vector<uint8_t>& bytes,
MtxArchive* archive,
std::string* error = nullptr);
// MTX stores a normal DDS surface with its four-byte magic replaced by an
// internal field. This returns the exact embedded surface with "DDS " put
// back, suitable for the existing DDS loader or external inspection tools.
bool ExtractMtxTextureDds(const std::vector<uint8_t>& bytes,
const MtxTexture& texture,
std::vector<uint8_t>* dds,
std::string* error = nullptr);
} // namespace gc