Sign in to follow this  
  • entries
    119
  • comments
    151
  • views
    73997

3 XML

Sign in to follow this  

94 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.
Sign in to follow this  


15 Comments


Recommended Comments

Guest Anonymous Poster

Posted

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

Share this comment


Link to comment
Guest Anonymous Poster

Posted

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

Share this comment


Link to comment
Guest Anonymous Poster

Posted

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

Share this comment


Link to comment
Guest Anonymous Poster

Posted

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

Share this comment


Link to comment
Guest Anonymous Poster

Posted

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

Share this comment


Link to comment
Guest Anonymous Poster

Posted

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

Share this comment


Link to comment
Guest Anonymous Poster

Posted

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/

Share this comment


Link to comment
Guest Anonymous Poster

Posted

Hello, Nice site. I am able to learn many stotras. Very good work.
http://pirzarewa.tripod.com/buy-cheap-cialis-generic.html

Share this comment


Link to comment
Guest Anonymous Poster

Posted

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

Share this comment


Link to comment
Guest Anonymous Poster

Posted

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

Share this comment


Link to comment
Guest Anonymous Poster

Posted

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

Share this comment


Link to comment
Guest Anonymous Poster

Posted

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

Share this comment


Link to comment
Guest Anonymous Poster

Posted

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!

Share this comment


Link to comment
Guest Anonymous Poster

Posted

Hello, Very Excellent site.
http://tiratquper.ohost.de/small-business-server/
Thanks!

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now