Fix rawfile stuff (TODO: Implement correct compression!)

This commit is contained in:
momo5502 2016-01-27 03:02:42 +01:00
parent f9c087e012
commit 13bf9d2b79

View File

@ -10,16 +10,19 @@ namespace Assets
{ {
Game::RawFile* asset = builder->GetAllocator()->AllocateArray<Game::RawFile>(); Game::RawFile* asset = builder->GetAllocator()->AllocateArray<Game::RawFile>();
std::string data = Utils::Compression::ZLib::Compress(rawFile.GetBuffer()); if (asset)
{
//std::string data = Utils::Compression::ZLib::Compress(rawFile.GetBuffer());
asset->name = builder->GetAllocator()->DuplicateString(name); asset->name = builder->GetAllocator()->DuplicateString(name);
asset->compressedData = builder->GetAllocator()->DuplicateString(data); asset->compressedData = builder->GetAllocator()->DuplicateString(rawFile.GetBuffer());
asset->sizeCompressed = data.size() + 1; asset->sizeCompressed = 0;//data.size();
asset->sizeUnCompressed = 0; asset->sizeUnCompressed = rawFile.GetBuffer().size();
header->rawfile = asset; header->rawfile = asset;
} }
} }
}
void IRawFile::Save(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder) void IRawFile::Save(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder)
{ {