Zippers are now stored as their own node, and not as

attributes only. Track version number was increased to
4, but old version 3 tracks can still be read.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7542 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk
2011-01-25 09:29:27 +00:00
parent 5067fb46b0
commit b7bf16a5f8
2 changed files with 13 additions and 1 deletions

View File

@@ -7,7 +7,7 @@
<!-- Minimum and maxium track versions that be be read by this binary.
Older versions will be ignored. -->
<track-version min="3" max="3"/>
<track-version min="3" max="4"/>
<!-- Maximum number of karts to be used at the same time. This limit
can easily be increased, but some tracks might not have valid start

View File

@@ -87,6 +87,9 @@ Material::Material(const XMLNode *node, int index)
else if (s != "none") fprintf(stderr, "[Material] WARNING: Unknown compositing mode '%s'\n", s.c_str());
}
// Compatibility to track version 3, which stored zipper data
// as attributes. Can be removed if track version 3 is not
// supported anymore
node->get("zipper", &m_zipper );
node->get("zipper-duration", &m_zipper_duration );
node->get("zipper-fade-out-time", &m_zipper_fade_out_time );
@@ -108,6 +111,15 @@ Material::Material(const XMLNode *node, int index)
{
initParticlesEffect(child_node);
}
else if (child_node->getName() == "zipper")
{
// Track version 4 uses a separate node:
m_zipper = true;
child_node->get("duration", &m_zipper_duration );
child_node->get("fade-out-time", &m_zipper_fade_out_time );
child_node->get("max-speed-increase",&m_zipper_max_speed_increase);
child_node->get("speed-gain", &m_zipper_speed_gain );
}
else
{
fprintf(stderr, "[Material] WARNING: unknown node type '%s' for texture '%s' - ignored.\n",