Added support for <duration>float</duration> to the slideshow3D .xml format

to allow the time for autostepping between layers/slides.

Moved the tiles accross to the left hands side by default.
This commit is contained in:
Robert Osfield
2003-10-30 16:22:21 +00:00
parent bb97900fe1
commit 1991aa597c
5 changed files with 119 additions and 4 deletions

View File

@@ -189,6 +189,12 @@ void ReaderWriterSS3D::parseLayer(SlideShowConstructor& constructor, xmlDocPtr d
{
parseModel(constructor, doc,cur);
}
else if ((!xmlStrcmp(cur->name, (const xmlChar *)"duration")))
{
key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
if (key) constructor.setLayerDuration(atof((const char*)key));
xmlFree(key);
}
cur = cur->next;
}
}
@@ -221,6 +227,12 @@ void ReaderWriterSS3D::parseSlide (SlideShowConstructor& constructor, xmlDocPtr
{
parseLayer (constructor, doc, cur);
}
else if ((!xmlStrcmp(cur->name, (const xmlChar *)"duration")))
{
key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
if (key) constructor.setSlideDuration(atof((const char*)key));
xmlFree(key);
}
cur = cur->next;
}
return;
@@ -290,6 +302,12 @@ osgDB::ReaderWriter::ReadResult ReaderWriterSS3D::readNode(const std::string& fi
if (key) constructor.setTextColor(mapStringToColor((const char*)key));
xmlFree(key);
}
else if ((!xmlStrcmp(cur->name, (const xmlChar *)"duration")))
{
key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
if (key) constructor.setPresentationDuration(atof((const char*)key));
xmlFree(key);
}
else if ((!xmlStrcmp(cur->name, (const xmlChar *)"slide")))
{
parseSlide (constructor, doc, cur);