mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-06 00:53:52 +00:00
feat(editor): Wowee Content Pack (.wcp) format for zone distribution
- WCP format: simple binary archive with magic header, JSON manifest, and concatenated file data. Not tied to any proprietary format. - ContentPacker::packZone(): bundles all zone files from output dir into a single .wcp file (terrain, objects, creatures, quests, manifest) - ContentPacker::unpackZone(): extracts .wcp to a directory - ContentPacker::readInfo(): reads pack metadata without extracting - Format: "WCP1" magic + fileCount + infoJSON + file table + data - Foundation for distributing custom zones to other wowee users and private servers Note: currently bundles ADT/WDT files as-is. Future: convert terrain to open format (heightmap + JSON) for fully open redistribution.
This commit is contained in:
parent
f5d8dcf75a
commit
79ae91a6d5
3 changed files with 216 additions and 0 deletions
40
tools/editor/content_pack.hpp
Normal file
40
tools/editor/content_pack.hpp
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <cstdint>
|
||||
|
||||
namespace wowee {
|
||||
namespace editor {
|
||||
|
||||
struct ContentPackInfo {
|
||||
std::string name;
|
||||
std::string author;
|
||||
std::string description;
|
||||
std::string version = "1.0";
|
||||
uint32_t mapId = 9000;
|
||||
std::string format = "wcp-1.0";
|
||||
|
||||
struct FileEntry {
|
||||
std::string path; // path inside pack
|
||||
std::string category; // terrain, object, creature, quest, texture, model
|
||||
uint64_t size = 0;
|
||||
};
|
||||
std::vector<FileEntry> files;
|
||||
};
|
||||
|
||||
class ContentPacker {
|
||||
public:
|
||||
// Pack all zone data from output directory into a .wcp file
|
||||
static bool packZone(const std::string& outputDir, const std::string& mapName,
|
||||
const std::string& destPath, const ContentPackInfo& info);
|
||||
|
||||
// Unpack a .wcp file to a directory
|
||||
static bool unpackZone(const std::string& wcpPath, const std::string& destDir);
|
||||
|
||||
// Read pack info without extracting
|
||||
static bool readInfo(const std::string& wcpPath, ContentPackInfo& info);
|
||||
};
|
||||
|
||||
} // namespace editor
|
||||
} // namespace wowee
|
||||
Loading…
Add table
Add a link
Reference in a new issue