• entries
119
151
• views
74424

# 3 XML

130 views

I decided it was time to clean up my XML environment loader.

I had been using tinybind to bind everything, but it turned into a bit of a mess with all the map entities. Tinybind is easy to setup and use; it took all of about five lines to load my environment. The problem is, it produced XML like this:

"1.0" ?> 	Dummy	DummyResources	FileSystem	../assets/maps/dummy	1						AmbientLight												Color					0.1,0.1,0.1,1.0														PointLight												Ogre Name					Light1													Position					0.0,0.0,50.0													Diffuse					0.5,0.5,0.5,1.0													Specular					0.0,0.5,0.5,1.0														FreeCam										StaticMesh												Mesh File					Table.mesh													Entity Name					TableMesh													Position					100.0,0.0,0.0														Robot

I also needed a little bit of special hackery majiks for map containers, since tinybind doesn't really support them. It is pretty likely that I'll be editing at least some of the XML environments by hand, so I decided I needed something cleaner. The result is this:

"1.0" ?> "dummy">	"DummyResources" type="FileSystem" path="../assets/maps/dummy" />	"1" />			class="AmbientLight">			"Color" value="0.1,0.1,0.1,1.0" />				class="PointLight">			"Ogre Name" value="Light1" />			"Position" value="0.0,0.0,50.0" />			"Diffuse" value="0.5,0.5,0.5,1.0" />			"Specular" value="0.5,0.5,0.5,1.0" />				class="FreeCam" />		class="Robot" />		class="StaticMesh">			"Mesh File" value="Table.mesh" />			"Entity Name" value="TableMesh" />			"Position" value="100.0,0.0,0.0" />

Still a little clunky, but much cleaner and more compact. It uses straight tinyxml, so the actual loading code is a bit longer, but it is definitely worth it.

In case you're intrested, here's what the dummy environment looks like:

I'm *almost* back on schedule. I just need to finish integrating ODE into the rest of the engine and implement load/save. Then I'll just have to write game entities and create content and hope I can finish it all by the end of November.

Hey, this isn't candy.

Hi, great work, It's a wonderful site.
http://viagra-viagra.imzek.org http://womens-viagra.imzek.org http://cialis-free-sample.drzeo.org

Hi! You have a cool homepage!
http://aldara-molluscum-contagiosum.amrud.org

Hello, This site is cool!
http://university-of-chicago.orhat.info

Hello, This site is cool!
http://teen-erotica.orhat.info

Hello, Great site!
http://opewepo.275mb.com/order-levitra-online.html

Hello, An excellent site. I am able to learn many stotras. Very good work.
http://restor.blogster.com/cialis_2.html

Hello, Nice site. I am able to learn many stotras. Very good work.
http://tetaqu.ifrance.com/ http://glass-christmas-ornament.orhat.info http://yrutyt.ohost.de/ http://company-christmas-party.orhat.info http://tuwyqeqzot.3-hosting.net/

Hello, Nice site. I am able to learn many stotras. Very good work.

Hello, This site is simply very good...
http://otoquqisoweol.thehostcity.com/

Hello, This site is simply very good...
http://true-religion-brand-jeans.bebto.com/jeans-skirt/ http://rfaqi.nm.ru/diesel-jeans/

Hello, very nice site!
http://osypariwi.nightmail.ru

Hello, very nice site!
http://erizsa.tripod.com

Hello, Very good site with nice info's
http://piwyq.3-hosting.net/hydrocodone-watson-349/ http://piwyq.3-hosting.net/hydrocodone-cough-syrup/
Thanks!

Hello, Very Excellent site.
Thanks!

## Create an account

Register a new account