Monday, July 28, 2008

Level export and tools

I've setup the basics of level export – the NSDocument's associated BaseLevel now dumps its vertices correctly. […] It now exports floor polygons as well. Here comes the first experiment, setting up an object proxy between the level and editor. The trivial way would be to simply cache the object pointer with the proxy, but I wonder if that is a sane way with regards to undo/redo functionality...

Looked it up, should work fine with a cached pointer. This time around, I'll actually write the undo functionality the right way instead of the hack that was the El Ballo editor (in which I just restored entire object states, instead of delta information).

My plan for adding in object proxies is to create the object inside the proxy and then inject it into the level, instead of letting the level create it and then pull it back out. This way the interface wont be littered by hundreds of EditorCreatedMovingSmallJunkPile3(), just a single EditorCreatedBody().

And there we have it, the ToolAddObject now creates and positions a puck and injects it (properly!) into the level. Tomorrow is a day for writing unit tests...

No comments: