summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorneoraider <devnull@localhost>2007-05-13 16:58:03 +0200
committerneoraider <devnull@localhost>2007-05-13 16:58:03 +0200
commit48ce809334713ef75d0f3c8d6b5c9fab16e2f335 (patch)
tree45d13a9e89762838e1d072b58e4842241336801a
parentb63df0c05724905ec030e6ff3fcdc71299f2268f (diff)
downloadzoom-48ce809334713ef75d0f3c8d6b5c9fab16e2f335.tar
zoom-48ce809334713ef75d0f3c8d6b5c9fab16e2f335.zip
Added xml level + dtd.
-rw-r--r--levels/level.dtd42
-rw-r--r--levels/level2.xml35
2 files changed, 77 insertions, 0 deletions
diff --git a/levels/level.dtd b/levels/level.dtd
new file mode 100644
index 0000000..29397bc
--- /dev/null
+++ b/levels/level.dtd
@@ -0,0 +1,42 @@
+<!ELEMENT level (info, triangles, textures)>
+
+<!ELEMENT info (name, desc, start)>
+<!ELEMENT triangles (triangle)*>
+<!ELEMENT textures (texture)*>
+
+<!ELEMENT name (#PCDATA)>
+<!ELEMENT desc (#PCDATA)>
+<!ELEMENT start EMPTY>
+<!ATTLIST start
+ x CDATA #REQUIRED
+ y CDATA #REQUIRED
+ z CDATA #REQUIRED
+>
+
+<!ELEMENT triangle (vertex, texcoords?, vertex, texcoords?, vertex, texcoords?)>
+<!ATTLIST triangle
+ type (wall|floor) #REQUIRED
+ texture IDREF #IMPLIED
+>
+
+<!ELEMENT texture EMPTY>
+<!ATTLIST texture
+ id ID #REQUIRED
+ name CDATA #REQUIRED
+>
+
+<!ELEMENT vertex EMPTY>
+<!ATTLIST vertex
+ x CDATA #REQUIRED
+ y CDATA #REQUIRED
+ z CDATA #REQUIRED
+>
+
+<!ELEMENT texcoords EMPTY>
+<!ATTLIST texcoords
+ s CDATA "0.0"
+ t CDATA "0.0"
+ r CDATA "0.0"
+ q CDATA "0.0"
+>
+
diff --git a/levels/level2.xml b/levels/level2.xml
new file mode 100644
index 0000000..67a5f43
--- /dev/null
+++ b/levels/level2.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE level PUBLIC "-//libzoom//DTD level 0.1//EN" "level.dtd">
+<level>
+ <info>
+ <name>Test Level</name>
+ <desc>Just a simple test level.</desc>
+ <start x="0.0" y="0.0" z="0.0"/>
+ </info>
+ <triangles>
+ <triangle type="wall" texture="t0">
+ <vertex x="-2.0" y="-2.0" z="-6.0"/><texcoords s="0.0" t="1.0"/>
+ <vertex x="2.0" y="-2.0" z="-6.0"/><texcoords s="1.0" t="1.0"/>
+ <vertex x="2.0" y="2.0" z="-6.0"/><texcoords s="1.0" t="0.0"/>
+ </triangle>
+ <triangle type="wall" texture="t0">
+ <vertex x="-2.0" y="-2.0" z="-6.0"/><texcoords s="0.0" t="1.0"/>
+ <vertex x="2.0" y="2.0" z="-6.0"/><texcoords s="1.0" t="0.0"/>
+ <vertex x="-2.0" y="2.0" z="-6.0"/><texcoords s="0.0" t="0.0"/>
+ </triangle>
+ <triangle type="wall" texture="t0">
+ <vertex x="-2.0" y="-2.0" z="2.0"/><texcoords s="1.0" t="1.0"/>
+ <vertex x="-2.0" y="2.0" z="2.0"/><texcoords s="1.0" t="0.0"/>
+ <vertex x="2.0" y="2.0" z="2.0"/><texcoords s="0.0" t="0.0"/>
+ </triangle>
+ <triangle type="wall" texture="t0">
+ <vertex x="-2.0" y="-2.0" z="2.0"/><texcoords s="1.0" t="1.0"/>
+ <vertex x="2.0" y="2.0" z="2.0"/><texcoords s="0.0" t="0.0"/>
+ <vertex x="2.0" y="-2.0" z="2.0"/><texcoords s="0.0" t="1.0"/>
+ </triangle>
+ </triangles>
+ <textures>
+ <texture id="t0" name="green.png"/>
+ </textures>
+</level>
+