Updated component defaults files to match component schema and made schema validation strict.
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
<c:AABB>
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<AABB xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="AABB.xsd">
|
||||||
<Origin X="0" Y="0" Z="0"/>
|
<Origin X="0" Y="0" Z="0"/>
|
||||||
<Size X="1" Y="1" Z="1"/>
|
<Size X="1" Y="1" Z="1"/>
|
||||||
</c:AABB>
|
</AABB>
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
<c:Camera>
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Camera xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Camera.xsd">
|
||||||
<Name>cam</Name>
|
<Name>cam</Name>
|
||||||
<FOV>45</FOV>
|
<FOV>45</FOV>
|
||||||
<NearClip>0.01</NearClip>
|
<NearClip>0.01</NearClip>
|
||||||
<FarClip>5000</FarClip>
|
<FarClip>5000</FarClip>
|
||||||
</c:Camera>
|
</Camera>
|
||||||
@@ -1,2 +1,3 @@
|
|||||||
<c:Collidable>
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
</c:Collidable>
|
<Collidable xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Collidable.xsd">
|
||||||
|
</Collidable>
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
<c:Health>
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Health xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Health.xsd">
|
||||||
<Health>100</Health>
|
<Health>100</Health>
|
||||||
<MaxHealth>100</MaxHealth>
|
<MaxHealth>100</MaxHealth>
|
||||||
</c:Health>
|
</Health>
|
||||||
@@ -1,3 +1,2 @@
|
|||||||
<c:Listener>
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Listener xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Listener.xsd"/>
|
||||||
</c:Listener>
|
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
<c:Model>
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Model.xsd">
|
||||||
<Resource></Resource>
|
<Resource></Resource>
|
||||||
<Color R="1" G="1" B="1" A="1"/>
|
<Color R="1" G="1" B="1" A="1"/>
|
||||||
<Visible>true</Visible>
|
<Visible>true</Visible>
|
||||||
</c:Model>
|
</Model>
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
<c:Physics>
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Physics xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Physics.xsd">
|
||||||
<Velocity X="0" Y="0" Z="0"/>
|
<Velocity X="0" Y="0" Z="0"/>
|
||||||
</c:Physics>
|
</Physics>
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
<c:Player>
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Player xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Player.xsd">
|
||||||
<Velocity X="0" Y="0" Z="0"/>
|
<Velocity X="0" Y="0" Z="0"/>
|
||||||
<Forward>false</Forward>
|
<Forward>false</Forward>
|
||||||
<Left>false</Left>
|
<Left>false</Left>
|
||||||
<Back>false</Back>
|
<Back>false</Back>
|
||||||
<Right>false</Right>
|
<Right>false</Right>
|
||||||
</c:Player>
|
</Player>
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
<c:PlayerSpawn>
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<PlayerSpawn xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PlayerSpawn.xsd">
|
||||||
<TeamID>1</TeamID>
|
<TeamID>1</TeamID>
|
||||||
</c:PlayerSpawn>
|
</PlayerSpawn>
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
<c:PointLight>
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<PointLight xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PointLight.xsd">
|
||||||
<Color R="1" G="1" B="1" A="1"/>
|
<Color R="1" G="1" B="1" A="1"/>
|
||||||
<Radius>1.0</Radius>
|
<Radius>1.0</Radius>
|
||||||
<Intensity>0.8</Intensity>
|
<Intensity>0.8</Intensity>
|
||||||
<Falloff>0.3</Falloff>
|
<Falloff>0.3</Falloff>
|
||||||
<Visible>true</Visible>
|
<Visible>true</Visible>
|
||||||
</c:PointLight>
|
</PointLight>
|
||||||
@@ -12,7 +12,14 @@
|
|||||||
<xs:element name="Color" type="t:Color" minOccurs="0"/>
|
<xs:element name="Color" type="t:Color" minOccurs="0"/>
|
||||||
<xs:element name="Radius" type="t:double" minOccurs="0"/>
|
<xs:element name="Radius" type="t:double" minOccurs="0"/>
|
||||||
<xs:element name="Intensity" type="t:double" minOccurs="0"/>
|
<xs:element name="Intensity" type="t:double" minOccurs="0"/>
|
||||||
<xs:element name="Falloff" type="t:double" minOccurs="0" minInclusive="0" maxInclusive="1"/>
|
<xs:element name="Falloff">
|
||||||
|
<xs:simpleType>
|
||||||
|
<xs:restriction base="t:double">
|
||||||
|
<xs:minInclusive value="0"/>
|
||||||
|
<xs:maxInclusive value="1"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
</xs:element>
|
||||||
<xs:element name="Visible" type="t:bool" minOccurs="0"/>
|
<xs:element name="Visible" type="t:bool" minOccurs="0"/>
|
||||||
</xs:all>
|
</xs:all>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<c:RaptorCopter>
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<RaptorCopter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="RaptorCopter.xsd">
|
||||||
<Speed>0</Speed>
|
<Speed>0</Speed>
|
||||||
<Axis X="0" Y="0" Z="0"/>
|
<Axis X="0" Y="0" Z="0"/>
|
||||||
</c:RaptorCopter>
|
</RaptorCopter>
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
<c:SoundEmitter>
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<SoundEmitter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="SoundEmitter.xsd">
|
||||||
<FilePath></FilePath>
|
<FilePath></FilePath>
|
||||||
<Gain>1.0</Gain>
|
<Gain>1.0</Gain>
|
||||||
<Pitch>1.0</Pitch>
|
<Pitch>1.0</Pitch>
|
||||||
@@ -6,4 +7,4 @@
|
|||||||
<MaxDistance>20.0</MaxDistance>
|
<MaxDistance>20.0</MaxDistance>
|
||||||
<RollOffFactor>1.0</RollOffFactor>
|
<RollOffFactor>1.0</RollOffFactor>
|
||||||
<ReferenceDistance>1.0</ReferenceDistance>
|
<ReferenceDistance>1.0</ReferenceDistance>
|
||||||
</c:SoundEmitter>
|
</SoundEmitter>
|
||||||
@@ -7,18 +7,24 @@
|
|||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:all>
|
<xs:all>
|
||||||
<xs:element name="FilePath" type="t:string" minOccurs="0"/>
|
<xs:element name="FilePath" type="t:string" minOccurs="0"/>
|
||||||
<xs:element name="Gain" type="t:double" minOccurs="0"/>
|
<xs:element name="Gain" type="t:double" minOccurs="0">
|
||||||
<xs:annotation><xs:documentation>The "volume" of the emitter. A value betweeen 0-1</xs:documentation></xs:annotation>
|
<xs:annotation><xs:documentation>The "volume" of the emitter. A value betweeen 0-1</xs:documentation></xs:annotation>
|
||||||
<xs:element name="Pitch" type="t:double" minOccurs="0"/>
|
</xs:element>
|
||||||
<xs:annotation><xs:documentation>The pitch of the emitter. A value betweeen 0-1</xs:documentation></xs:annotation>
|
<xs:element name="Pitch" type="t:double" minOccurs="0">
|
||||||
<xs:element name="Loop" type="t:bool" minOccurs="0"/>
|
<xs:annotation><xs:documentation>The pitch of the emitter. A value betweeen 0-1</xs:documentation></xs:annotation>
|
||||||
<xs:annotation><xs:documentation>If the sound should loop or not.</xs:documentation></xs:annotation>
|
</xs:element>
|
||||||
<xs:element name="MaxDistance" type="t:double" minOccurs="0"/>
|
<xs:element name="Loop" type="t:bool" minOccurs="0">
|
||||||
<xs:annotation><xs:documentation>The distance where there will no longer be any attenuation.</xs:documentation></xs:annotation>
|
<xs:annotation><xs:documentation>If the sound should loop or not.</xs:documentation></xs:annotation>
|
||||||
<xs:element name="RollOffFactor" type="t:double" minOccurs="0"/>
|
</xs:element>
|
||||||
<xs:annotation><xs:documentation>The rolloff rate of the source.</xs:documentation></xs:annotation>
|
<xs:element name="MaxDistance" type="t:double" minOccurs="0">
|
||||||
<xs:element name="ReferenceDistance" type="t:double" minOccurs="0"/>
|
<xs:annotation><xs:documentation>The distance where there will no longer be any attenuation.</xs:documentation></xs:annotation>
|
||||||
<xs:annotation><xs:documentation>The distance that the source will be the loudest.</xs:documentation></xs:annotation>
|
</xs:element>
|
||||||
|
<xs:element name="RollOffFactor" type="t:double" minOccurs="0">
|
||||||
|
<xs:annotation><xs:documentation>The rolloff rate of the source.</xs:documentation></xs:annotation>
|
||||||
|
</xs:element>
|
||||||
|
<xs:element name="ReferenceDistance" type="t:double" minOccurs="0">
|
||||||
|
<xs:annotation><xs:documentation>The distance that the source will be the loudest.</xs:documentation></xs:annotation>
|
||||||
|
</xs:element>
|
||||||
</xs:all>
|
</xs:all>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
<c:SpawnPoint/>
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<SpawnPoint xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="SpawnPoint.xsd"/>
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
<c:Spawner>
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Spawner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Spawner.xsd">
|
||||||
<EntityFile></EntityFile>
|
<EntityFile></EntityFile>
|
||||||
</c:Spawner>
|
</Spawner>
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
<c:Transform>
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Transform xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Transform.xsd">
|
||||||
<Position X="0" Y="0" Z="0"/>
|
<Position X="0" Y="0" Z="0"/>
|
||||||
<Orientation X="0" Y="0" Z="0"/>
|
<Orientation X="0" Y="0" Z="0"/>
|
||||||
<Scale X="1" Y="1" Z="1"/>
|
<Scale X="1" Y="1" Z="1"/>
|
||||||
</c:Transform>
|
</Transform>
|
||||||
@@ -1,2 +1,3 @@
|
|||||||
<c:Trigger>
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
</c:Trigger>
|
<Trigger xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Trigger.xsd">
|
||||||
|
</Trigger>
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
<xs:element ref="c:Test" minOccurs="0"/>
|
<xs:element ref="c:Test" minOccurs="0"/>
|
||||||
<xs:element ref="c:RaptorCopter" minOccurs="0"/>
|
<xs:element ref="c:RaptorCopter" minOccurs="0"/>
|
||||||
<xs:element ref="c:Player" minOccurs="0"/>
|
<xs:element ref="c:Player" minOccurs="0"/>
|
||||||
|
<xs:element ref="c:Camera" minOccurs="0"/>
|
||||||
<xs:element ref="c:AABB" minOccurs="0"/>
|
<xs:element ref="c:AABB" minOccurs="0"/>
|
||||||
<xs:element ref="c:Trigger" minOccurs="0"/>
|
<xs:element ref="c:Trigger" minOccurs="0"/>
|
||||||
<xs:element ref="c:Health" minOccurs="0"/>
|
<xs:element ref="c:Health" minOccurs="0"/>
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ void EntityFile::Parse(const EntityFileHandler* handler) const
|
|||||||
EntityFileSAXHandler saxHandler(handler, nullptr);
|
EntityFileSAXHandler saxHandler(handler, nullptr);
|
||||||
m_SAX2XMLReader->setFeature(XMLUni::fgXercesCacheGrammarFromParse, true);
|
m_SAX2XMLReader->setFeature(XMLUni::fgXercesCacheGrammarFromParse, true);
|
||||||
m_SAX2XMLReader->setFeature(XMLUni::fgXercesUseCachedGrammarInParse, true);
|
m_SAX2XMLReader->setFeature(XMLUni::fgXercesUseCachedGrammarInParse, true);
|
||||||
|
m_SAX2XMLReader->setFeature(XMLUni::fgXercesSchema, true);
|
||||||
|
m_SAX2XMLReader->setFeature(XMLUni::fgXercesSchemaFullChecking, true);
|
||||||
m_SAX2XMLReader->setContentHandler(&saxHandler);
|
m_SAX2XMLReader->setContentHandler(&saxHandler);
|
||||||
m_SAX2XMLReader->setErrorHandler(&saxHandler);
|
m_SAX2XMLReader->setErrorHandler(&saxHandler);
|
||||||
m_SAX2XMLReader->setDeclarationHandler(&saxHandler);
|
m_SAX2XMLReader->setDeclarationHandler(&saxHandler);
|
||||||
|
|||||||
@@ -174,7 +174,11 @@ void EntityFilePreprocessor::parseDefaults()
|
|||||||
memset(ci.second.Defaults.get(), 0, ci.second.Meta.Stride);
|
memset(ci.second.Defaults.get(), 0, ci.second.Meta.Stride);
|
||||||
|
|
||||||
XercesDOMParser parser(nullptr, XMLPlatformUtils::fgMemoryManager);
|
XercesDOMParser parser(nullptr, XMLPlatformUtils::fgMemoryManager);
|
||||||
|
parser.setDoSchema(true);
|
||||||
|
parser.setDoNamespaces(true);
|
||||||
parser.setErrorHandler(&errorHandler);
|
parser.setErrorHandler(&errorHandler);
|
||||||
|
parser.setValidationScheme(XercesDOMParser::Val_Always);
|
||||||
|
parser.setValidationSchemaFullChecking(true);
|
||||||
|
|
||||||
std::string componentName = ci.first;
|
std::string componentName = ci.first;
|
||||||
LOG_DEBUG("Parsing defaults for component %s", componentName.c_str());
|
LOG_DEBUG("Parsing defaults for component %s", componentName.c_str());
|
||||||
|
|||||||
Reference in New Issue
Block a user