From 23b4dc61893f90abd49957a9b377312012fa0161 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 29 Sep 2010 18:10:27 -0500 Subject: Fix for serialization deprecation problems. --- indra/newview/llmeshrepository.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 5347b7313e..17b101e410 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -897,15 +897,24 @@ bool LLMeshRepoThread::headerReceived(const LLVolumeParams& mesh_params, U8* dat { std::string res_str((char*) data, data_size); + std::string deprecated_header(""); + + if (res_str.substr(0, deprecated_header.size()) == deprecated_header) + { + res_str = res_str.substr(deprecated_header.size()+1, data_size); + header_size = deprecated_header.size()+1; + } + data_size = res_str.size(); + std::istringstream stream(res_str); - if (!LLSDSerialize::deserialize(header, stream, data_size)) + if (!LLSDSerialize::fromBinary(header, stream, data_size)) { llwarns << "Mesh header parse error. Not a valid mesh asset!" << llendl; return false; } - header_size = stream.tellg(); + header_size += stream.tellg(); } else { -- cgit v1.2.3