使用接口S3MB::ImageOperator::GetMipMapData()会崩溃 使用S3MB::ImageOperator::Decode()得到的纹理颜色内存块不对 S3MBReader S3MBReaderRo; wstring S3MBFileSrc = L"C:\\Users\\\liangqinlong\\Desktop\\s3mb\\data\\Tile_+023_+007\\Tile_+023_+007.s3mb"; S3MBReaderRo.SetFilePath(S3MBFileSrc); S3MBReaderRo.ReadS3MBAsROGroup(); RenderOperationGroup* Group = S3MBReaderRo.GetRenderOperationGroup(); int num = Group->GetNumChildren(); for (int i = 0; i < num; i++) { RenderOperationNode* pChild = Group; std::map& mats = pChild->GetMaterials(); for (auto it = mats.begin(); it != mats.end(); ++it) { S3MB::Material* curmat = (it)->second; for (auto ittech = curmat->mTechniques.begin(); ittech != curmat->mTechniques.end(); ++ittech) { S3MB::Technique* temp = (*ittech); for (auto itpass = temp->mPasses.begin(); itpass != temp->mPasses.end(); ++itpass) { S3MB::Pass* pPass = *itpass; for (auto ittexu = pPass->m_pTextureUnitStates.begin(); ittexu != pPass->m_pTextureUnitStates.end(); ++ittexu) { S3MB::TextureDataInfo* ptexdatainfo = pChild->GetTextureData((*ittexu)->m_strTextureName); if (ptexdatainfo) { S3MB::TextureData* texdata = ptexdatainfo->m_pTextureData; unsigned char* ppBufferOut = nullptr; std::vector vecs; int sss = S3MB::ImageOperator::GetMipMapData(texdata->m_nWidth, texdata->m_nHeight, texdata->m_pBuffer, &ppBufferOut, vecs); int size = S3MB::ImageOperator::Decode(texdata->m_nSize, texdata->m_nWidth, texdata->m_nHeight,&ppBufferOut, texdata->m_pBuffer, texdata->m_CompressType); } } } } } }