mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
Replace MPQ runtime with loose file asset system
Extract assets from MPQ archives into organized loose files indexed by manifest.json, enabling fully parallel reads without StormLib serialization. Add asset_extract and blp_convert tools, PNG texture override support.
This commit is contained in:
parent
5fda1a3157
commit
aa16a687c2
16 changed files with 1427 additions and 101 deletions
40
include/pipeline/loose_file_reader.hpp
Normal file
40
include/pipeline/loose_file_reader.hpp
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <cstdint>
|
||||
|
||||
namespace wowee {
|
||||
namespace pipeline {
|
||||
|
||||
/**
|
||||
* LooseFileReader - Thread-safe filesystem file reader
|
||||
*
|
||||
* Each read opens its own file descriptor, so no mutex is needed.
|
||||
* This replaces the serialized MPQ read path.
|
||||
*/
|
||||
class LooseFileReader {
|
||||
public:
|
||||
LooseFileReader() = default;
|
||||
|
||||
/**
|
||||
* Read entire file into memory
|
||||
* @param filesystemPath Full path to file on disk
|
||||
* @return File contents (empty if not found or error)
|
||||
*/
|
||||
static std::vector<uint8_t> readFile(const std::string& filesystemPath);
|
||||
|
||||
/**
|
||||
* Check if a file exists on disk
|
||||
*/
|
||||
static bool fileExists(const std::string& filesystemPath);
|
||||
|
||||
/**
|
||||
* Get file size without reading
|
||||
* @return Size in bytes, or 0 if not found
|
||||
*/
|
||||
static uint64_t getFileSize(const std::string& filesystemPath);
|
||||
};
|
||||
|
||||
} // namespace pipeline
|
||||
} // namespace wowee
|
||||
Loading…
Add table
Add a link
Reference in a new issue