mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-14 22:10:43 +00:00
extended_thumbnail section in xml format can be in between sections
This commit is contained in:
@@ -609,36 +609,37 @@ static ReplayStatus XML2Structured(const char *xml, const ThumbTypeAndData &thum
|
||||
rdc->SetData(driver, driverName.c_str(), machineIdent, rdcthumb);
|
||||
}
|
||||
|
||||
// push in other sections
|
||||
pugi::xml_node xSection = xHeader.next_sibling();
|
||||
|
||||
if(!strcmp(xSection.name(), "extended_thumbnail"))
|
||||
{
|
||||
SectionProperties props = {};
|
||||
props.type = SectionType::ExtendedThumbnail;
|
||||
props.version = 1;
|
||||
StreamWriter *w = rdc->WriteSection(props);
|
||||
|
||||
ExtThumbnailHeader header;
|
||||
header.width = (uint16_t)xSection.attribute("width").as_uint();
|
||||
header.height = (uint16_t)xSection.attribute("height").as_uint();
|
||||
header.len = (uint32_t)extThumb.data.size();
|
||||
header.format = extThumb.format;
|
||||
w->Write(header);
|
||||
w->Write(extThumb.data.data(), extThumb.data.size());
|
||||
|
||||
w->Finish();
|
||||
|
||||
delete w;
|
||||
|
||||
xSection = xSection.next_sibling();
|
||||
}
|
||||
|
||||
if(progress)
|
||||
progress(StructuredProgress(0.1f));
|
||||
|
||||
while(!strcmp(xSection.name(), "section"))
|
||||
// push in other sections
|
||||
pugi::xml_node xSection = xHeader.next_sibling();
|
||||
|
||||
while(!strcmp(xSection.name(), "section") || !strcmp(xSection.name(), "extended_thumbnail"))
|
||||
{
|
||||
if(!strcmp(xSection.name(), "extended_thumbnail"))
|
||||
{
|
||||
SectionProperties props = {};
|
||||
props.type = SectionType::ExtendedThumbnail;
|
||||
props.version = 1;
|
||||
StreamWriter *w = rdc->WriteSection(props);
|
||||
|
||||
ExtThumbnailHeader header;
|
||||
header.width = (uint16_t)xSection.attribute("width").as_uint();
|
||||
header.height = (uint16_t)xSection.attribute("height").as_uint();
|
||||
header.len = (uint32_t)extThumb.data.size();
|
||||
header.format = extThumb.format;
|
||||
w->Write(header);
|
||||
w->Write(extThumb.data.data(), extThumb.data.size());
|
||||
|
||||
w->Finish();
|
||||
|
||||
delete w;
|
||||
|
||||
xSection = xSection.next_sibling();
|
||||
continue;
|
||||
}
|
||||
|
||||
SectionProperties props;
|
||||
|
||||
if(xSection.attribute("ascii"))
|
||||
|
||||
Reference in New Issue
Block a user