Kelsidavis-WoWee/tools/editor/texture_exporter.hpp
Kelsi 4b3375ac44 feat(editor): export NPC/M2 model textures as PNG with the zone
TextureExporter::collectUsedTextures only picked up terrain textures, so
exported zones were missing every texture referenced by NPC creature models
and placed M2 doodads. Added collectM2Textures() and unified the export
collection to include terrain + all referenced M2 paths, so the rendered
zone is fully self-contained in the PNG/WOM open formats.
2026-05-06 01:11:47 -07:00

31 lines
1.1 KiB
C++

#pragma once
#include "pipeline/adt_loader.hpp"
#include <string>
#include <vector>
#include <unordered_set>
namespace wowee {
namespace pipeline { class AssetManager; }
namespace editor {
class TextureExporter {
public:
// Collect all texture paths referenced by the terrain
static std::vector<std::string> collectUsedTextures(const pipeline::ADTTerrain& terrain);
// Collect all texture paths referenced by an M2 model (loads the M2 from `am`).
// Returns lowercased game paths (e.g. "creature\\foo\\foo.blp"). Empty if M2 not found.
static std::vector<std::string> collectM2Textures(pipeline::AssetManager* am,
const std::string& m2Path);
// Export all used textures as PNG to an output directory
// Returns count of successfully exported textures
static int exportTexturesAsPng(pipeline::AssetManager* am,
const std::vector<std::string>& texturePaths,
const std::string& outputDir);
};
} // namespace editor
} // namespace wowee