diff --git a/Crafter.Asset-Asset.cpp b/Crafter.Asset-Asset.cpp index 9c6a7a3..d93badf 100644 --- a/Crafter.Asset-Asset.cpp +++ b/Crafter.Asset-Asset.cpp @@ -60,6 +60,7 @@ AssetLoad::AssetLoad(fs::path path) : f(path, std::ios::binary) { lenghts[i] = header.lenght; entries[i].lenght = header.lenght; entries[i].offset = header.offset; + headerLength+=header.nameLenght + header.typeLenght; } headerLength = sizeof(std::uint32_t)*2 + (sizeof(std::uint32_t)*4*entryCount); } @@ -116,13 +117,13 @@ void AssetLoad::Load(const AssetEntry& entry, void* data, uint32_t lenght) { } std::vector AssetLoad::LoadOffset(uint32_t offset, uint32_t lenght) { - f.seekg(offset); + f.seekg(offset+headerLength); std::vector vector(lenght); f.read(vector.data(), lenght); return vector; } void AssetLoad::LoadOffset(uint32_t offset, uint32_t lenght, void* data) { - f.seekg(offset); + f.seekg(offset+headerLength); f.read(reinterpret_cast(data), lenght); }