mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-06 17:13:51 +00:00
New format: WOC (Wowee Open Collision) — binary collision mesh for custom zone walkability. Magic WOC1 (0x31434F57). - WoweeCollisionBuilder::fromTerrain() generates collision triangles from terrain heightmap with slope classification (50 deg threshold) - Per-triangle flags: walkable (0x01), water (0x02), steep (0x04) - Respects terrain holes (skips triangles in hole regions) - Binary save/load with bounds, tile coords, triangle data - Auto-exported on zone save alongside WOT/WHM/WOM/WOB - Added to content pack validation (score now 0-7) - FORMAT_SPEC.md v1.1 updated with WOC binary layout - 19 new test assertions: flat terrain generation (32k tris all walkable), save/load round-trip, hole skipping - 328 total assertions across 84 test cases
51 lines
1.6 KiB
C++
51 lines
1.6 KiB
C++
#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);
|
|
|
|
// Validate that a zone directory has all required open format files
|
|
struct ValidationResult {
|
|
bool hasWot = false, hasWhm = false, hasZoneJson = false;
|
|
bool hasPng = false, hasWom = false, hasWob = false, hasWoc = false;
|
|
bool hasCreatures = false, hasQuests = false, hasObjects = false;
|
|
bool whmValid = false, womValid = false, wobValid = false, wocValid = false;
|
|
int openFormatScore() const;
|
|
std::string summary() const;
|
|
};
|
|
static ValidationResult validateZone(const std::string& zoneDir);
|
|
};
|
|
|
|
} // namespace editor
|
|
} // namespace wowee
|